mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 09:20:10 +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
|
|
@ -6,6 +6,7 @@ local user_scripts = require("user_scripts")
|
|||
local flow_consts = require("flow_consts")
|
||||
local alerts_api = require "alerts_api"
|
||||
local alert_severities = require "alert_severities"
|
||||
local alert_consts = require("alert_consts")
|
||||
|
||||
local UNEXPECTED_PLUGINS_ENABLED_CACHE_KEY = "ntopng.cache.user_scripts.unexpected_plugins_enabled"
|
||||
|
||||
|
|
@ -78,9 +79,14 @@ function script.hooks.protocolDetected(now, conf)
|
|||
end
|
||||
|
||||
if ok == 0 then
|
||||
local unexpected_dhcp_type = flow_consts.status_types.status_unexpected_dhcp.create(client_ip, server_ip)
|
||||
local alert = alert_consts.alert_types.alert_unexpected_dhcp.new(
|
||||
client_ip,
|
||||
server_ip
|
||||
)
|
||||
|
||||
alerts_api.trigger_status(unexpected_dhcp_type, alert_severities.error, 0, 100, 100)
|
||||
alert:set_severity(alert_severities.error)
|
||||
|
||||
alert:trigger_status(0, 100, 100)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue