Avoids unnecessary executions of flow user script external_alert_check.lua

Fixes #4080
This commit is contained in:
Simone Mainardi 2020-06-26 12:08:06 +02:00
parent 97efebb0ba
commit 9e5e63e28f
6 changed files with 31 additions and 1 deletions

View file

@ -482,6 +482,11 @@ local function loadAndCheckScript(mod_fname, full_path, plugin, script_type, sub
return(nil)
end
if((not return_all) and user_script.external_alerts_only and (not interface.hasExternalAlerts())) then
traceError(TRACE_DEBUG, TRACE_CONSOLE, string.format("Skipping module '%s' for interface with no external alerts", mod_fname))
return(nil)
end
if((not return_all) and ((user_script.nedge_exclude and ntop.isnEdge()) or (user_script.nedge_only and (not ntop.isnEdge())))) then
return(nil)
end