Reports engaged alerts in system status bar

Implements #4522
This commit is contained in:
Simone Mainardi 2020-10-06 11:11:08 +02:00
parent 38f6435982
commit b052eeebee
8 changed files with 38 additions and 64 deletions

View file

@ -6,6 +6,7 @@ local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
local system_utils = {}
local alert_utils = require "alert_utils"
-- #################################
@ -141,8 +142,14 @@ end
-- #################################
function system_utils.systemHostStats()
local cur_id = interface.getId()
interface.select(getSystemInterfaceId())
local system_host_stats = ntop.systemHostStat()
system_host_stats["cpu_states"] = system_utils.get_cpu_states()
system_host_stats["engaged_alerts"] = alert_utils.getNumAlerts("engaged", {})
interface.select(tostring(cur_id))
return system_host_stats
end