mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Implements Netfilter queue flush alerts
This commit is contained in:
parent
fd42cfd0cb
commit
67f7cdb47e
7 changed files with 45 additions and 5 deletions
|
|
@ -2238,7 +2238,7 @@ function check_mac_ip_association_alerts()
|
|||
break
|
||||
end
|
||||
|
||||
elems = json.decode(message)
|
||||
elems = json.decode(message)
|
||||
|
||||
if elems ~= nil then
|
||||
--io.write(elems.ip.." ==> "..message.."[".. elems.ifname .."]\n")
|
||||
|
|
@ -2252,6 +2252,38 @@ function check_mac_ip_association_alerts()
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
-- Global function
|
||||
function check_nfq_flushed_queue_alerts()
|
||||
while(true) do
|
||||
local message = ntop.lpopCache("ntopng.alert_nfq_flushed_queue")
|
||||
local elems
|
||||
|
||||
if((message == nil) or (message == "")) then
|
||||
break
|
||||
end
|
||||
|
||||
elems = json.decode(message)
|
||||
|
||||
if elems ~= nil then
|
||||
local entity = alertEntity("interface")
|
||||
local entity_value = "iface_"..elems.ifid
|
||||
local alert_type = alertType("nfq_flushed")
|
||||
local alert_severity = alertSeverity("info")
|
||||
|
||||
-- tprint(elems)
|
||||
-- io.write(elems.ip.." ==> "..message.."[".. elems.ifname .."]\n")
|
||||
|
||||
interface.select(elems.ifname)
|
||||
interface.storeAlert(entity, entity_value, alert_type, alert_severity,
|
||||
i18n("alert_messages.nfq_flushed",
|
||||
{name = elems.ifname, pct = elems.pct,
|
||||
tot = elems.tot, dropped = elems.dropped,
|
||||
url = ntop.getHttpPrefix().."/lua/if_stats.lua?ifid="..elems.ifid}))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Global function
|
||||
function check_process_alerts()
|
||||
while(true) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue