Add rest/v1/get/alert/severity/counters.lua REST API

This commit is contained in:
Alfredo Cardigliano 2020-05-27 11:05:59 +02:00
parent ec3f3de17d
commit 97046a8a97
2 changed files with 67 additions and 0 deletions

View file

@ -383,6 +383,17 @@ end
-- #################################
function alert_utils.getNumAlertsPerSeverity(what, epoch_begin, epoch_end)
local opts = {
epoch_begin = epoch_begin,
epoch_end = epoch_end,
}
return performAlertsQuery("select alert_severity severity, count(*) count", what, opts, nil, "alert_severity" --[[ group by ]])
end
-- #################################
local function refreshAlerts(ifid)
ntop.delCache(string.format("ntopng.cache.alerts.ifid_%d.has_alerts", ifid))
ntop.delCache("ntopng.cache.update_alerts_stats_time")