mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 17:30:11 +00:00
Migrates alerts to an object-oriented implementation
This commit is contained in:
parent
e24ef4ef35
commit
bcf2c2c1ed
95 changed files with 1923 additions and 1522 deletions
|
|
@ -31,17 +31,18 @@ local function dropped_alerts_check(params)
|
|||
-- Compute the delta with the previous value for drops
|
||||
local delta_drops = alerts_api.interface_delta_val(script.key, params.granularity, dropped_alerts, true --[[ skip first --]])
|
||||
|
||||
local alert_type = alert_consts.alert_types.alert_dropped_alerts.create(
|
||||
alert_severities.error,
|
||||
alert_consts.alerts_granularities[params.granularity],
|
||||
local alert = alert_consts.alert_types.alert_dropped_alerts.new(
|
||||
interface.getId(),
|
||||
delta_drops
|
||||
)
|
||||
)
|
||||
|
||||
alert:set_severity(alert_severities.error)
|
||||
alert:set_granularity(params.granularity)
|
||||
|
||||
if(delta_drops > 0) then
|
||||
alerts_api.trigger(params.alert_entity, alert_type, nil, params.cur_alerts)
|
||||
alert:trigger(params.alert_entity, nil, params.cur_alerts)
|
||||
else
|
||||
alerts_api.release(params.alert_entity, alert_type, nil, params.cur_alerts)
|
||||
alert:release(params.alert_entity, nil, params.cur_alerts)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue