mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Fixes wrongly formatter used for behavior anomaly alert
This commit is contained in:
parent
221629ff74
commit
c3a85560a7
8 changed files with 37 additions and 23 deletions
|
|
@ -787,9 +787,15 @@ function alert_utils.formatBehaviorAlert(params, anomalies, stats, id, subtype,
|
|||
local value = stats[anomaly_type]["value"]
|
||||
|
||||
if anomaly_table["formatter"] then
|
||||
value = anomaly_table["formatter"](value)
|
||||
lower_bound = anomaly_table["formatter"](lower_bound)
|
||||
upper_bound = anomaly_table["formatter"](upper_bound)
|
||||
value = anomaly_table["formatter"](value * (anomaly_table["multiplier"] or 1))
|
||||
lower_bound = anomaly_table["formatter"](lower_bound * (anomaly_table["multiplier"] or 1))
|
||||
upper_bound = anomaly_table["formatter"](upper_bound * (anomaly_table["multiplier"] or 1))
|
||||
end
|
||||
|
||||
if anomaly_table["cut_values"] then
|
||||
value = string.format("%.2f", value)
|
||||
lower_bound = string.format("%.2f", lower_bound)
|
||||
upper_bound = string.format("%.2f", upper_bound)
|
||||
end
|
||||
|
||||
local alert = alert_consts.alert_types.alert_behavior_anomaly.new(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue