--
-- (C) 2013-15 - ntop.org
--
dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
require "lua_utils"
host_info = url2hostinfo(_GET)
if(host_info["host"] == nil) then
sendHTTPHeader('text/html; charset=iso-8859-1')
ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc")
dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
print("
 .. )
Host parameter is missing (internal error ?)
")
return
end
interface.select(ifname)
host = interface.getHostInfo(host_info["host"], host_info["vlan"])
if(host == nil) then
sendHTTPHeader('text/html; charset=iso-8859-1')
ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc")
dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
print(" .. )
Host ".. host_info["host"] .. " Vlan" ..host_info["vlan"].." cannot be found (expired ?)
")
return
else
sendHTTPHeader('application/json')
print(host["json"])
end