mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 08:50:12 +00:00
Fix value computation in Throughput Alert (#fix #4000)
This commit is contained in:
parent
7b995070a2
commit
b8fdee7fa9
1 changed files with 7 additions and 1 deletions
|
|
@ -31,7 +31,13 @@ local script = {
|
|||
|
||||
function script.hooks.all(params)
|
||||
local host_bytes = host.getBytes()
|
||||
local value = alerts_api.host_delta_val(script.key, params.granularity, host_bytes["bytes.sent"] + host_bytes["bytes.rcvd"]) * 8 / alert_consts.granularity2sec(params.granularity)
|
||||
|
||||
-- Delta
|
||||
local value = alerts_api.host_delta_val(script.key, params.granularity, host_bytes["bytes.sent"] + host_bytes["bytes.rcvd"])
|
||||
-- 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