mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Adds badge upon influxdb export errors
This commit is contained in:
parent
15bf893cc3
commit
2200453862
3 changed files with 19 additions and 1 deletions
|
|
@ -3,10 +3,13 @@
|
|||
--
|
||||
|
||||
local dirs = ntop.getDirs()
|
||||
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
require "lua_utils"
|
||||
local json = require("dkjson")
|
||||
local ts_utils = require("ts_utils_core")
|
||||
local system_scripts = require("system_scripts_utils")
|
||||
|
||||
sendHTTPHeader('application/json')
|
||||
|
||||
|
|
@ -76,6 +79,11 @@ function dumpInterfaceStats(interface_name)
|
|||
local alert_cache = interface.getCachedNumAlerts() or {}
|
||||
res["engaged_alerts"] = alert_cache["num_alerts_engaged"] or 0
|
||||
res["alerts_stored"] = alert_cache["alerts_stored"] or 0
|
||||
res["ts_alerts"] = {}
|
||||
|
||||
if ts_utils.getDriverName() == "influxdb" and system_scripts.hasAlerts({entity = alertEntity("influx_db")}) then
|
||||
res["ts_alerts"]["influxdb"] = true
|
||||
end
|
||||
end
|
||||
|
||||
if not userHasRestrictions() then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue