Alerts are no longer enqueued if disabled

This commit is contained in:
Alfredo Cardigliano 2020-07-23 00:49:28 +02:00
parent 09eb53a16d
commit f038baf804
2 changed files with 24 additions and 13 deletions

View file

@ -236,6 +236,11 @@ end
-- #################################################################
local function triggerFlowAlert(now, l4_proto)
if not areAlertsEnabled() then
return(false)
end
local cli_key = flow.getClientKey()
local srv_key = flow.getServerKey()
local cli_disabled_status = hosts_disabled_status[cli_key] or 0
@ -436,7 +441,10 @@ local function call_modules(l4_proto, master_id, app_id, mod_fn, update_ctr)
-- Only trigger the alert if its score is greater than the currently
-- triggered alert score
if alerted_status and (alerted_status_score > flow.getAlertedStatusScore()) then
if areAlertsEnabled() and
alerted_status and
(alerted_status_score > flow.getAlertedStatusScore()) then
triggerFlowAlert(now, l4_proto)
if calculate_stats then