Fix always_enabled required for non-alert scripts

This commit is contained in:
emanuele-f 2019-10-10 18:03:26 +02:00
parent c9a95543dd
commit b8f1a039fb
5 changed files with 45 additions and 13 deletions

View file

@ -254,6 +254,7 @@ end
function user_scripts.load(script_type, ifid, subdir, hook_filter, ignore_disabled, do_benchmark)
local rv = {modules = {}, hooks = {}}
local is_nedge = ntop.isnEdge()
local alerts_disabled = (not areAlertsEnabled())
local check_dirs = {
user_scripts.getSubdirectoryPath(script_type, subdir),
@ -310,6 +311,10 @@ function user_scripts.load(script_type, ifid, subdir, hook_filter, ignore_disabl
check_module.enabled = user_scripts.isEnabled(ifid, subdir, check_module.key)
check_module.is_alert = is_alert_path
if(alerts_disabled and check_module.is_alert) then
goto next_module
end
if((not check_module.enabled) and (not ignore_disabled)) then
traceError(TRACE_DEBUG, TRACE_CONSOLE, string.format("Skipping disabled module '%s'", check_module.key))
goto next_module