mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-06 03:45:26 +00:00
Various fixes to ASN Traffic Rules (#9555)
* Various fixes to ASN Traffic Rules * Formatted ASN names for ASN traffic rules alerts
This commit is contained in:
parent
5b06353a9d
commit
33ad9fc7b6
3 changed files with 9 additions and 6 deletions
|
|
@ -1,5 +1,5 @@
|
|||
--
|
||||
-- (C) 2019-24 - ntop.org
|
||||
-- (C) 2019-25 - ntop.org
|
||||
--
|
||||
|
||||
-- ##############################################
|
||||
|
|
@ -61,7 +61,9 @@ function alert_asn_rule_threshold_crossed.format(ifid, alert, alert_type_params)
|
|||
alert_type_params.frequency = i18n("edit_check.hooks_name.day")
|
||||
end
|
||||
|
||||
if(alert_type_params.metric == "asn:traffic") then
|
||||
if(alert_type_params.metric == "asn:traffic" or
|
||||
alert_type_params.metric == "asn:traffic_rcvd" or
|
||||
alert_type_params.metric == "asn:traffic_sent") then
|
||||
if(alert_type_params.metric_type == "volume") then
|
||||
alert_type_params.value = bytesToSize(alert_type_params.value)
|
||||
alert_type_params.threshold = bytesToSize(alert_type_params.threshold)
|
||||
|
|
@ -78,10 +80,11 @@ function alert_asn_rule_threshold_crossed.format(ifid, alert, alert_type_params)
|
|||
alert_type_params.threshold = string.format("%s",tostring(alert_type_params.threshold)).. "%"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return(i18n("alert_messages.traffic_asn_volume_alert", {
|
||||
url = "/lua/as_overview.lua?asn=",
|
||||
url = "/lua/as_overview.lua?asn="..alert_type_params.asn,
|
||||
asn = alert_type_params.asn,
|
||||
asn_name = format_utils.formatASN(tonumber(alert_type_params.asn), true, false),
|
||||
metric = alert_type_params.metric,
|
||||
value = alert_type_params.value,
|
||||
threshold_sign = alert_type_params.threshold_sign,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue