-- -- (C) 2013-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') ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc") active_page = "hosts" dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") interface.select(ifname) hosts_stats,total = aggregateHostsStats(interface.getLocalHostsInfo()) --io.write(ifname.."/"..total.."\n") max_num = 25 localhosts = {} found = false num = 0 for key, value in pairs(hosts_stats) do --print(hosts_stats[key]["name"].."
\n") if((hosts_stats[key]["localhost"] == true) and (hosts_stats[key]["ip"] ~= nil)) then localhosts[key] = hosts_stats[key]["packets.sent"]+hosts_stats[key]["packets.rcvd"] found = true num = num + 1 end end if(found) then print [[