mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Add check for periodic scripts changing the interface
This commit is contained in:
parent
55df85e4e0
commit
2ff83bcdc3
4 changed files with 14 additions and 6 deletions
|
|
@ -406,20 +406,22 @@ function alerts_api.release(entity_info, type_info, when, cur_alerts)
|
|||
|
||||
if(entity_info.alert_entity.entity_id == alert_consts.alertEntity("interface")) then
|
||||
if(interface.checkContext(entity_info.entity_val) == false) then
|
||||
alertErrorTraceback("Invalid interface entity value detected for entity id "..entity_info.alert_entity.entity_id)
|
||||
alertErrorTraceback("Invalid interface context detected for entity id "..entity_info.alert_entity.entity_id)
|
||||
tprint(entity_info)
|
||||
return(false)
|
||||
else
|
||||
released = interface.releaseTriggeredAlert(table.unpack(params))
|
||||
end
|
||||
|
||||
elseif(entity_info.alert_entity.entity_id == alert_consts.alertEntity("network")) then
|
||||
if(network.checkContext(entity_info.entity_val) == false) then
|
||||
alertErrorTraceback("Invalid network entity value detected for entity id "..entity_info.alert_entity.entity_id)
|
||||
alertErrorTraceback("Invalid network context detected for entity id "..entity_info.alert_entity.entity_id)
|
||||
tprint(entity_info)
|
||||
return(false)
|
||||
else
|
||||
released = network.releaseTriggeredAlert(table.unpack(params))
|
||||
end
|
||||
|
||||
else
|
||||
released = interface.releaseExternalAlert(entity_info.alert_entity.entity_id, entity_info.entity_val, table.unpack(params))
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue