mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Implements stats rather than grouped hosts data for host pools stats
This commit is contained in:
parent
9f482f612f
commit
3413a6afd0
12 changed files with 518 additions and 164 deletions
25
scripts/lua/get_pool_data.lua
Normal file
25
scripts/lua/get_pool_data.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
--
|
||||
-- (C) 2013-19 - ntop.org
|
||||
--
|
||||
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
require "lua_utils"
|
||||
local host_pools_utils = require "host_pools_utils"
|
||||
local json = require("dkjson")
|
||||
|
||||
sendHTTPContentTypeHeader('text/html')
|
||||
|
||||
-- sendHTTPHeader('application/json')
|
||||
|
||||
local pool = tonumber(_GET["pool"])
|
||||
|
||||
local n = interface.getHostPoolStats(pool)
|
||||
local res = {}
|
||||
|
||||
for k, v in pairs(n) do
|
||||
res = host_pools_utils.hostpool2record(interface.getStats()["id"], k, v)
|
||||
break
|
||||
end
|
||||
|
||||
print(json.encode(res, nil))
|
||||
Loading…
Add table
Add a link
Reference in a new issue