mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Rework scanAlerts to avoid iterating hosts twice
This commit is contained in:
parent
0afb961ca2
commit
83a58ad016
3 changed files with 150 additions and 125 deletions
|
|
@ -648,6 +648,11 @@ function areAlertsEnabled()
|
|||
return (ntop.getPref("ntopng.prefs.disable_alerts_generation") ~= "1")
|
||||
end
|
||||
|
||||
function mustScanAlerts(ifstats)
|
||||
-- can't alert on view interfaces as checkpoints will collide for their underlying real interfaces
|
||||
return areAlertsEnabled() and not ifstats["isView"]
|
||||
end
|
||||
|
||||
function hasAlertsDisabled()
|
||||
return ((_POST["disable_alerts_generation"] ~= nil) and (_POST["disable_alerts_generation"] == "1")) or
|
||||
((_POST["disable_alerts_generation"] == nil) and (ntop.getPref("ntopng.prefs.disable_alerts_generation") == "1"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue