mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-05 02:16:39 +00:00
Implements #4919 custom alert severity
This commit is contained in:
parent
89b21df6f6
commit
10fb8bbecc
64 changed files with 317 additions and 49 deletions
|
|
@ -19,6 +19,13 @@ local script = {
|
|||
|
||||
l4_proto = "udp",
|
||||
|
||||
-- This script is only for alerts generation
|
||||
is_alert = true,
|
||||
|
||||
default_value = {
|
||||
severity = alert_severities.notice,
|
||||
},
|
||||
|
||||
-- NOTE: hooks defined below
|
||||
hooks = {},
|
||||
|
||||
|
|
@ -48,13 +55,13 @@ end
|
|||
|
||||
-- #################################################################
|
||||
|
||||
function script.hooks.all(now)
|
||||
function script.hooks.all(now, conf)
|
||||
if((flow.getPacketsRcvd() == 0) and (flow.getPacketsSent() > 0)) then
|
||||
-- Now check if the recipient isn't a broadcast/multicast address
|
||||
if not flow.isClientNoIP() and flow.isServerUnicast() and not unidirectionalProtoWhitelist(flow.getnDPIAppProtoId()) then
|
||||
local alert = alert_consts.alert_types.alert_udp_unidirectional.new()
|
||||
|
||||
alert:set_severity(alert_severities.notice)
|
||||
alert:set_severity(conf.severity)
|
||||
|
||||
alert:trigger_status(5, 1, 5)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue