Fixes slow hash entries purging alert

Fixes #4527
This commit is contained in:
Simone Mainardi 2020-10-05 14:38:51 +02:00
parent cd687baaf6
commit f6c42554bc
3 changed files with 8 additions and 6 deletions

View file

@ -3,6 +3,7 @@
--
local alert_keys = require "alert_keys"
local format_utils = require "format_utils"
-- #######################################################
@ -32,10 +33,11 @@ end
local function formatSlowPurge(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"])
local max_idle_perc = threshold_info.threshold or 0
local max_idle_perc = format_utils.round(threshold_info.edge or 0, 0)
local actual_idle_perc = format_utils.round(threshold_info.idle_perc or 0, 0)
return(i18n("alert_messages.slow_purge", {
iface = entity, max_idle = max_idle_perc,
iface = entity, idle = actual_idle_perc, max_idle = max_idle_perc,
url = ntop.getHttpPrefix() .. "/lua/if_stats.lua?ifid=" .. ifid .. "&page=internals",
}))
end