Rework network threshold alerts definition

This commit is contained in:
emanuele-f 2019-07-11 19:35:34 +02:00
parent 55cf8ffcf4
commit e26a7949ac
5 changed files with 105 additions and 129 deletions

View file

@ -0,0 +1,29 @@
--
-- (C) 2019 - ntop.org
--
local alerts_api = require("alerts_api")
local alert_consts = require("alert_consts")
local check_module = {
key = "egress",
alert_type = alert_consts.alert_types.threshold_cross,
check_function = alerts_api.threshold_check_function,
gui = {
i18n_title = "alerts_thresholds_config.egress_traffic",
i18n_description = "alerts_thresholds_config.alert_network_egress_description",
i18n_field_unit = alert_consts.field_units.bytes,
input_builder = alerts_api.threshold_cross_input_builder,
}
}
-- #################################################################
function check_module.get_threshold_value(granularity, info)
return alerts_api.network_delta_val(check_module.key, granularity, info["egress"])
end
-- #################################################################
return check_module