mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
22 lines
441 B
Lua
22 lines
441 B
Lua
--
|
|
-- (C) 2014-15-15 - ntop.org
|
|
--
|
|
|
|
local dirs = ntop.getDirs()
|
|
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
|
|
|
require "lua_utils"
|
|
|
|
sendHTTPContentTypeHeader('text/html')
|
|
|
|
local host_ip = _GET["host"]
|
|
|
|
interface.select(ifname)
|
|
local host = interface.getHostInfo(host_ip)
|
|
local value = 0
|
|
|
|
if(host ~= nil) then
|
|
value = host["packets.sent"]+host["packets.rcvd"]
|
|
end
|
|
|
|
print(' { "value": ' .. value .. ' } ')
|