Uses stats rather than grouped hosts data for network stats

This commit is contained in:
Simone Mainardi 2019-08-19 17:39:18 +02:00
parent 244d45eb00
commit 74c545d079
14 changed files with 247 additions and 31 deletions

View 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"
require "network_utils"
local json = require("dkjson")
sendHTTPContentTypeHeader('text/html')
-- sendHTTPHeader('application/json')
local network = tonumber(_GET["network"])
local n = interface.getNetworkStats(network)
local res = {}
for k, v in pairs(n) do
res = network2record(interface.getStats()["id"], v)
break
end
print(json.encode(res, nil))