mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
NMAP plugin conversion v0.2
This commit is contained in:
@@ -389,7 +389,7 @@
|
||||
{
|
||||
"function": "RUN_TIMEOUT",
|
||||
"type": "integer",
|
||||
"default_value": 300,
|
||||
"default_value": 30,
|
||||
"options": [],
|
||||
"localized": ["name", "description"],
|
||||
"name": [
|
||||
|
||||
@@ -156,7 +156,7 @@ def execute_plugin(db, plugin, pluginsState = plugins_state() ):
|
||||
|
||||
# handle missing "function":"CMD" setting
|
||||
if set == None:
|
||||
return
|
||||
return pluginsState
|
||||
|
||||
set_CMD = set["value"]
|
||||
|
||||
@@ -168,7 +168,7 @@ def execute_plugin(db, plugin, pluginsState = plugins_state() ):
|
||||
else:
|
||||
set_RUN_TIMEOUT = set["value"]
|
||||
|
||||
mylog('debug', ['[Plugins] Timeout: ', set_RUN_TIMEOUT])
|
||||
|
||||
|
||||
# Prepare custom params
|
||||
params = []
|
||||
@@ -191,7 +191,8 @@ def execute_plugin(db, plugin, pluginsState = plugins_state() ):
|
||||
|
||||
mylog('debug', [f'[Plugins] The parameter "name":"{param["name"]}" will multiply the timeout {tempParam.paramValuesCount} times. Total timeout: {set_RUN_TIMEOUT}s'])
|
||||
|
||||
|
||||
mylog('debug', ['[Plugins] Timeout: ', set_RUN_TIMEOUT])
|
||||
|
||||
# build SQL query parameters to insert into the DB
|
||||
sqlParams = []
|
||||
|
||||
@@ -316,7 +317,7 @@ def execute_plugin(db, plugin, pluginsState = plugins_state() ):
|
||||
# handle missing "function":"DB_PATH" setting
|
||||
if set == None:
|
||||
mylog('none', ['[Plugins] Error: DB_PATH setting for plugin type sqlite-db-query missing.'])
|
||||
return
|
||||
return pluginsState
|
||||
|
||||
fullSqlitePath = set["value"]
|
||||
|
||||
@@ -356,7 +357,7 @@ def execute_plugin(db, plugin, pluginsState = plugins_state() ):
|
||||
# check if the subprocess / SQL query failed / there was no valid output
|
||||
if len(sqlParams) == 0:
|
||||
mylog('none', ['[Plugins] No output received from the plugin ', plugin["unique_prefix"], ' - enable LOG_LEVEL=debug and check logs'])
|
||||
return
|
||||
return pluginsState
|
||||
else:
|
||||
mylog('verbose', ['[Plugins] SUCCESS, received ', len(sqlParams), ' entries'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user