mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 16:30:10 +00:00
Added flow collection health (#8607)
This commit is contained in:
parent
b09688beee
commit
d01fcc3c15
1 changed files with 31 additions and 0 deletions
31
scripts/lua/rest/v2/get/system/health/flow_collection.lua
Normal file
31
scripts/lua/rest/v2/get/system/health/flow_collection.lua
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
--
|
||||
-- (C) 2019-24 - ntop.org
|
||||
--
|
||||
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
local rest_utils = require("rest_utils")
|
||||
local names = interface.getIfNames()
|
||||
local stats = {}
|
||||
|
||||
|
||||
for _,iface in pairs(names) do
|
||||
local ifstats
|
||||
|
||||
interface.select(iface)
|
||||
ifstats = interface.getStats()
|
||||
|
||||
stats[iface] = {}
|
||||
|
||||
for interface_id, probe_list in pairs(ifstats.probes or {}) do
|
||||
stats[iface] = {}
|
||||
|
||||
for probe_ip, probe_info in pairsByKeys(probe_list or {}) do
|
||||
table.insert(stats[iface], probe_info)
|
||||
tprint(probe_list.exporters)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
rest_utils.answer(rest_utils.consts.success.ok, stats)
|
||||
Loading…
Add table
Add a link
Reference in a new issue