ntopng/scripts/lua/aggregated_host_stats.lua
2015-04-30 12:22:35 +02:00

18 lines
473 B
Lua

--
-- (C) 2013-15 - ntop.org
--
dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
require "lua_utils"
host_ip = _GET["host"]
interface.select(ifname)
host = interface.getAggregatedHostInfo(host_ip)
sendHTTPHeader('text/html; charset=iso-8859-1')
--sendHTTPHeader('application/json')
print('{ "packets.rcvd": '.. host["packets.rcvd"] .. ', "last_seen": ' .. host["seen.last"] .. ', "epoch": ' .. os.time()..'" }\n')