mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 08:50:12 +00:00
Fix computation of interface throughput (alert) (fix #4000)
This commit is contained in:
parent
0477d77550
commit
d56122c900
1 changed files with 8 additions and 1 deletions
|
|
@ -29,7 +29,14 @@ local script = {
|
|||
-- #################################################################
|
||||
|
||||
function script.hooks.all(params)
|
||||
local value = alerts_api.interface_delta_val(script.key, params.granularity, params.entity_info["stats"]["bytes"]) * 8 / alert_consts.granularity2sec(params.granularity)
|
||||
local interface_bytes = params.entity_info["stats"]["bytes"]
|
||||
|
||||
-- Delta
|
||||
local value = alerts_api.interface_delta_val(script.key, params.granularity, interface_bytes)
|
||||
-- Granularity
|
||||
value = value / alert_consts.granularity2sec(params.granularity)
|
||||
-- Bytes to Mbit
|
||||
value = (value * 8) / 1000000
|
||||
|
||||
-- Check if the configured threshold is crossed by the value and possibly trigger an alert
|
||||
alerts_api.checkThresholdAlert(params, alert_consts.alert_types.alert_threshold_cross, value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue