mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Fix alert engage/disengage
This commit is contained in:
parent
7b2db43e32
commit
f741dd26be
4 changed files with 59 additions and 41 deletions
|
|
@ -294,12 +294,15 @@ function alerts_api.trigger(entity_info, type_info, when, cur_alerts)
|
|||
end
|
||||
|
||||
if(triggered == nil) then
|
||||
if(do_trace) then print("[Don't Trigger alert (already triggered?) @ "..granularity_sec.."] "..
|
||||
entity_info.entity_val .."@"..type_info.alert_type.i18n_title..":".. subtype .. "\n") end
|
||||
if(do_trace) then
|
||||
print("Alert not triggered (already triggered?) @ "..granularity_sec.."] "..
|
||||
entity_info.entity_val .."@"..type_info.alert_type.i18n_title..":".. subtype .. "\n")
|
||||
end
|
||||
return(false)
|
||||
else
|
||||
if(do_trace) then print("[TRIGGER alert @ "..granularity_sec.."] "..
|
||||
entity_info.entity_val .."@"..type_info.alert_type.i18n_title..":".. subtype .. "\n") end
|
||||
if(do_trace) then
|
||||
print("Alert triggered @ "..granularity_sec.." ".. entity_info.entity_val .."@"..type_info.alert_type.i18n_title..":".. subtype .. "\n")
|
||||
end
|
||||
end
|
||||
|
||||
triggered.ifid = ifid
|
||||
|
|
@ -370,13 +373,15 @@ function alerts_api.release(entity_info, type_info, when, cur_alerts)
|
|||
end
|
||||
|
||||
if(released == nil) then
|
||||
if(do_trace) then tprint("[Dont't Release alert (not triggered?) @ "..granularity_sec.."] "..
|
||||
entity_info.entity_val .."@"..type_info.alert_type.i18n_title..":".. subtype .. "\n") end
|
||||
|
||||
if(do_trace) then
|
||||
print("Alert not released (not triggered?) @ "..granularity_sec.." "..
|
||||
entity_info.entity_val .."@"..type_info.alert_type.i18n_title..":".. subtype .. "\n")
|
||||
end
|
||||
return(false)
|
||||
else
|
||||
if(do_trace) then tprint("[RELEASE alert @ "..granularity_sec.."] "..
|
||||
entity_info.entity_val .."@"..type_info.alert_type.i18n_title..":".. subtype .. "\n") end
|
||||
if(do_trace) then
|
||||
print("Alert released @ "..granularity_sec.." ".. entity_info.entity_val .."@"..type_info.alert_type.i18n_title..":".. subtype .. "\n")
|
||||
end
|
||||
end
|
||||
|
||||
released.ifid = ifid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue