mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Alerts cleanup
This commit is contained in:
parent
046db90246
commit
4ec4043b35
2 changed files with 14 additions and 166 deletions
|
|
@ -21,17 +21,17 @@ local function test_assert(cond, error_msg)
|
|||
end
|
||||
end
|
||||
|
||||
function test_utils.check_alerts(ifid, working_status)
|
||||
function test_utils.check_alerts(ifid, granularity)
|
||||
local if_stats = interface.getStats()
|
||||
if working_status.granularity == "min" then
|
||||
if granularity == "min" then
|
||||
-- minute checks
|
||||
test_assert(if_stats.stats.hosts > 0, string.format("No host detected. [hosts: %d]", if_stats.stats.hosts))
|
||||
test_assert(if_stats.stats.flows > 0, string.format("No flow detected. [flows: %d]", if_stats.stats.flows))
|
||||
elseif working_status.granularity == "5mins" then
|
||||
elseif granularity == "5mins" then
|
||||
-- 5-minute checks
|
||||
elseif working_status.granularity == "hour" then
|
||||
elseif granularity == "hour" then
|
||||
-- hourly checks
|
||||
elseif working_status.granularity == "day" then
|
||||
elseif granularity == "day" then
|
||||
-- daily checks
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue