mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-05 02:16:39 +00:00
Implements per-host file-based alert checks (e.g., bytes.lua)
This commit is contained in:
parent
a31c619500
commit
2172338948
11 changed files with 210 additions and 102 deletions
|
|
@ -9,9 +9,9 @@ require "alert_utils"
|
|||
|
||||
local alerts_api = require("alerts_api")
|
||||
|
||||
local do_trace = false
|
||||
local config_alerts = nil
|
||||
local ifname = nil
|
||||
local do_trace = false
|
||||
local config_alerts = nil
|
||||
local ifname = nil
|
||||
local available_modules = nil
|
||||
|
||||
-- #################################################################
|
||||
|
|
@ -34,12 +34,12 @@ function checkHostAlerts(granularity)
|
|||
local host_key = info.ip.."@"..info.vlan
|
||||
local host_alert = config_alerts[host_key] or config_alerts["local_hosts"]
|
||||
|
||||
if((host_alert ~= nil) and (table.len(host_alert) > 0)) then
|
||||
if host_alert and table.len(host_alert) > 0 then
|
||||
for _, check in pairs(available_modules) do
|
||||
local config = host_alert[check.key]
|
||||
|
||||
if(config) then
|
||||
check.check_function(granularity, host_key, info, config)
|
||||
if config then
|
||||
check.check_function(granularity, host_key, info, config)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue