--
-- (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_ip == nil) then
host_info = url2hostinfo(_GET)
else
-- print("host_ip:"..host_ip.."
")
host_info = {}
host_info = hostkey2hostinfo(host_ip)
end
if(mode == nil) then
mode = _GET["mode"]
end
if(host_name == nil) then
host_name = _GET["name"]
end
if(mode ~= "embed") then
sendHTTPHeader('text/html; charset=iso-8859-1')
ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc")
active_page = "hosts"
dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
end
num_top_hosts = 10
if(host_info["host"] ~= nil) then
num = 1
else
interface.select(ifname)
hosts_stats = interface.getHostsInfo()
num = 0
for key, value in pairs(hosts_stats) do
num = num + 1
end
end
if(num > 0) then
if(mode ~= "embed") then
if(host_info["host"] == nil) then
print("
NOTE