mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Add interfaces stats api and refactor the others health api. (#7141)
This commit is contained in:
parent
193927107e
commit
ba9bfd3d1a
9 changed files with 205 additions and 49 deletions
25
scripts/lua/rest/v2/get/system/health/influxdb.lua
Normal file
25
scripts/lua/rest/v2/get/system/health/influxdb.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
--
|
||||
-- (C) 2021 - ntop.org
|
||||
--
|
||||
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
require "lua_utils"
|
||||
local ts_utils = require("ts_utils")
|
||||
local rest_utils = require("rest_utils")
|
||||
|
||||
local influxdb = ts_utils.getQueryDriver()
|
||||
local info = {}
|
||||
|
||||
if influxdb.getInfluxdbVersion then
|
||||
info.version = influxdb:getInfluxdbVersion()
|
||||
info.db_bytes = influxdb:getDiskUsage()
|
||||
info.memory = influxdb:getMemoryUsage()
|
||||
info.num_series = influxdb:getSeriesCardinality()
|
||||
info.points_exported = influxdb:get_exported_points()
|
||||
info.exports = influxdb:get_exports()
|
||||
info.health = influxdb:get_health()
|
||||
end
|
||||
|
||||
rest_utils.answer(rest_utils.consts.success.ok, info)
|
||||
Loading…
Add table
Add a link
Reference in a new issue