mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
23 lines
No EOL
433 B
Lua
23 lines
No EOL
433 B
Lua
--
|
|
-- (C) 2014-15-15 - ntop.org
|
|
--
|
|
|
|
dirs = ntop.getDirs()
|
|
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
|
|
|
require "lua_utils"
|
|
|
|
sendHTTPHeader('text/html; charset=iso-8859-1')
|
|
|
|
host_ip = _GET["host"]
|
|
|
|
interface.select(ifname)
|
|
host = interface.getHostInfo(host_ip)
|
|
|
|
if(host == nil) then
|
|
value = 0
|
|
else
|
|
value = host["packets.sent"]+host["packets.rcvd"]
|
|
end
|
|
|
|
print(' { "value": ' .. value .. ' } ') |