mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 17:00:10 +00:00
Implement the host per-hour stats
Stats are available via the am_utils.getHourStats() call. Implements #3807
This commit is contained in:
parent
57c7abccfb
commit
ed64370093
2 changed files with 112 additions and 0 deletions
|
|
@ -89,10 +89,12 @@ local function run_am_check(params, all_hosts, granularity)
|
|||
if(do_trace) then print("[TRIGGER] Host "..resolved_host.."/"..key.." [value: "..host_value.."][threshold: "..threshold.."]\n") end
|
||||
|
||||
am_utils.triggerAlert(resolved_host, key, host_value, threshold, granularity)
|
||||
am_utils.incNumExceededChecks(key, when)
|
||||
else
|
||||
if(do_trace) then print("[OK] Host "..resolved_host.."/"..key.." [value: "..host_value.."][threshold: "..threshold.."]\n") end
|
||||
|
||||
am_utils.releaseAlert(resolved_host, key, host_value, threshold, granularity)
|
||||
am_utils.incNumOkChecks(key, when)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -103,6 +105,7 @@ local function run_am_check(params, all_hosts, granularity)
|
|||
if(hosts_am[key] == nil) then
|
||||
if(do_trace) then print("[TRIGGER] Host "..ip.."/"..key.." is unreacheable\n") end
|
||||
am_utils.triggerAlert(ip, key, 0, 0, granularity)
|
||||
am_utils.incNumUnreachableChecks(key, when)
|
||||
|
||||
if params.ts_enabled then
|
||||
-- Also write 0 in its timeseries to indicate that the host is unreacheable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue