Alerts cleanup

This commit is contained in:
emanuele-f 2019-07-10 15:45:20 +02:00
parent 046db90246
commit 4ec4043b35
2 changed files with 14 additions and 166 deletions

View file

@ -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