mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
Feature request - configurable arp-scan args #486 🎁
This commit is contained in:
@@ -12,9 +12,11 @@ from time import strftime
|
||||
sys.path.append("/home/pi/pialert/front/plugins")
|
||||
sys.path.append('/home/pi/pialert/pialert')
|
||||
|
||||
# pialert modules
|
||||
from database import DB
|
||||
from plugin_helper import Plugin_Object, Plugin_Objects, handleEmpty
|
||||
from logger import mylog, append_line_to_file
|
||||
from helper import timeNowTZ
|
||||
from helper import timeNowTZ, get_setting_value
|
||||
from const import logPath, pialertPath
|
||||
|
||||
CUR_PATH = str(pathlib.Path(__file__).parent.resolve())
|
||||
@@ -62,6 +64,11 @@ def main():
|
||||
subnets_list = userSubnetsParam.split(',')
|
||||
else:
|
||||
subnets_list = [userSubnetsParam]
|
||||
|
||||
|
||||
# Create a database connection
|
||||
db = DB() # instance of class DB
|
||||
db.open()
|
||||
|
||||
# Execute the ARP scanning process on the list of subnets (whether it's one or multiple subnets).
|
||||
# The function 'execute_arpscan' is assumed to be defined elsewhere in the code.
|
||||
@@ -132,7 +139,7 @@ def execute_arpscan(userSubnets):
|
||||
|
||||
def execute_arpscan_on_interface(interface):
|
||||
# Prepare command arguments
|
||||
arpscan_args = ['sudo', 'arp-scan', '--ignoredups', '--retry=6'] + interface.split()
|
||||
arpscan_args = get_setting_value('ARPSCAN_ARGS').split() + interface.split()
|
||||
|
||||
# Execute command
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user