mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Uses stats rather than grouped hosts data for network stats
This commit is contained in:
parent
244d45eb00
commit
74c545d079
14 changed files with 247 additions and 31 deletions
25
scripts/lua/get_network_data.lua
Normal file
25
scripts/lua/get_network_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"
|
||||
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))
|
||||
Loading…
Add table
Add a link
Reference in a new issue