mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-05 19:15:03 +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
27
scripts/callbacks/interface/alerts/host/packets.lua
Normal file
27
scripts/callbacks/interface/alerts/host/packets.lua
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue