Settings cleanup, docs and strings, Removal of ENABLE_ARPSCAN

This commit is contained in:
Jokob-sk
2023-08-16 08:01:56 +10:00
parent c8bae60060
commit a3359dbec4
11 changed files with 40 additions and 28 deletions

View File

@@ -39,7 +39,6 @@ changedPorts_json_struc = None
# ACTUAL CONFIGRATION ITEMS set to defaults
# General
ENABLE_ARPSCAN = True
SCAN_SUBNETS = ['192.168.1.0/24 --interface=eth1', '192.168.1.0/24 --interface=eth0']
LOG_LEVEL = 'verbose'
TIMEZONE = 'Europe/Berlin'

View File

@@ -96,8 +96,7 @@ def importConfigs (db):
conf.HRS_TO_KEEP_NEWDEV = ccd('HRS_TO_KEEP_NEWDEV', 0 , c_d, 'Keep new devices for', 'integer', "0", 'General')
conf.API_CUSTOM_SQL = ccd('API_CUSTOM_SQL', 'SELECT * FROM Devices WHERE dev_PresentLastScan = 0' , c_d, 'Custom endpoint', 'text', '', 'General')
# ARPSCAN (+ other settings provided by the ARPSCAN plugin)
conf.ENABLE_ARPSCAN = ccd('ENABLE_ARPSCAN', True , c_d, 'Enable arpscan', 'boolean', '', 'ARPSCAN', ['run'])
# ARPSCAN (+ other settings provided by the ARPSCAN plugin)
conf.SCAN_SUBNETS = ccd('SCAN_SUBNETS', ['192.168.1.0/24 --interface=eth1', '192.168.1.0/24 --interface=eth0'] , c_d, 'Subnets to scan', 'subnets', '', 'ARPSCAN')
# Email

View File

@@ -25,6 +25,7 @@ import const
from const import pialertPath, logPath, apiPath
from helper import noti_struc, generate_mac_links, removeDuplicateNewLines, timeNowTZ, hide_email, updateState, get_file_content, write_file
from logger import logResult, mylog, print_log
from plugin import execute_plugin
from publishers.email import (check_config as email_check_config,
send as send_email )
@@ -512,12 +513,11 @@ def check_and_run_event(db):
def handle_run(runType, db):
mylog('minimal', ['[', timeNowTZ(), '] START Run: ', runType])
if runType == 'ENABLE_ARPSCAN':
# run the plugin to run
for plugin in conf.plugins:
if plugin["unique_prefix"] == 'ARPSCAN':
execute_plugin(db, plugin)
# run the plugin to run
for plugin in conf.plugins:
if plugin["unique_prefix"] == runType:
execute_plugin(db, plugin)
mylog('minimal', ['[', timeNowTZ(), '] END Run: ', runType])