mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Add ability to manually release an alert
This commit is contained in:
parent
463b5d8325
commit
b62e4183f0
6 changed files with 89 additions and 9 deletions
|
|
@ -312,6 +312,11 @@ function alerts_api.release(entity_info, type_info, when)
|
|||
local params = {alert_key_name, granularity_id, when}
|
||||
local released = nil
|
||||
|
||||
if(type_info.alert_severity == nil) then
|
||||
alertErrorTraceback(string.format("Missing alert_severity [type=%s]", type_info.alert_type and type_info.alert_type.alert_id or ""))
|
||||
return(false)
|
||||
end
|
||||
|
||||
if(entity_info.alert_entity.entity_id == alertEntity("host")) then
|
||||
host.checkContext(entity_info.alert_entity_val)
|
||||
released = host.releaseTriggeredAlert(table.unpack(params))
|
||||
|
|
@ -334,11 +339,6 @@ function alerts_api.release(entity_info, type_info, when)
|
|||
entity_info.alert_entity_val .."@"..type_info.alert_type.i18n_title..":".. subtype .. "\n") end
|
||||
end
|
||||
|
||||
if(type_info.alert_severity == nil) then
|
||||
alertErrorTraceback(string.format("Missing alert_severity [type=%s]", type_info.alert_type and type_info.alert_type.alert_id or ""))
|
||||
return(false)
|
||||
end
|
||||
|
||||
enqueueStoreAlert(ifid, released)
|
||||
pushAlertNotification(ifid, "release", released)
|
||||
return(true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue