Implements per-host file-based alert checks (e.g., bytes.lua)

This commit is contained in:
Simone Mainardi 2019-07-10 19:23:19 +02:00
parent a31c619500
commit 2172338948
11 changed files with 210 additions and 102 deletions

View file

@ -0,0 +1,27 @@
--
-- (C) 2019 - ntop.org
--
local alerts_api = require("alerts_api")
local check_module = {
key = "packets",
-- TODO gui specific parameters
}
-- #################################################################
function check_module.check_function(granularity, host_key, info, threshold_config)
local current_value = alerts_api.host_delta_val(check_module.key, granularity, info["packets.sent"] + info["packets.rcvd"])
return(alerts_api.check_threshold_cross(
granularity, check_module.key,
alerts_api.hostAlertEntity(host_key),
current_value, threshold_config
))
end
-- #################################################################
return check_module