ntopng/scripts/plugins/flow_flood/alert_definitions/alert_flows_flood.lua
emanuele-f 5b05b06c96 Use extended icon classes.
Also fixes mining alert icon
2020-01-10 17:02:11 +01:00

31 lines
973 B
Lua

--
-- (C) 2019-20 - ntop.org
--
local function formatFlowsFlood(ifid, alert, threshold_info)
local alert_consts = require("alert_consts")
local entity = alert_consts.formatAlertEntity(ifid, alert_consts.alertEntityRaw(alert["alert_entity"]), alert["alert_entity_val"])
if(alert.alert_subtype == "flow_flood_attacker") then
return i18n("alert_messages.flow_flood_attacker", {
entity = firstToUpper(entity),
value = string.format("%u", math.ceil(threshold_info.value)),
threshold = threshold_info.threshold,
})
else
return i18n("alert_messages.flow_flood_victim", {
entity = firstToUpper(entity),
value = string.format("%u", math.ceil(threshold_info.value)),
threshold = threshold_info.threshold,
})
end
end
-- #######################################################
return {
alert_id = 1,
i18n_title = "alerts_dashboard.flows_flood",
i18n_description = formatFlowsFlood,
icon = "fas fa-life-ring",
}