-- -- (C) 2013-20 - ntop.org -- local dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path require "lua_utils" local host_pools_utils = require "host_pools_utils" local page_utils = require("page_utils") local custom_column_utils = require("custom_column_utils") local discover = require("discover_utils") local have_nedge = ntop.isnEdge() sendHTTPContentTypeHeader('text/html') page_utils.set_active_menu_entry(page_utils.menu_entries.hosts) local protocol = _GET["protocol"] local asn = _GET["asn"] local vlan = _GET["vlan"] local network = _GET["network"] local cidr = _GET["network_cidr"] local country = _GET["country"] local mac = _GET["mac"] local os_ = _GET["os"] local community = _GET["community"] local pool = _GET["pool"] local ipversion = _GET["version"] local traffic_type = _GET["traffic_type"] local base_url = ntop.getHttpPrefix() .. "/lua/hosts_stats.lua" local page_params = {} local charts_icon = "" local mode = _GET["mode"] if isEmptyString(mode) then mode = "all" else page_params["mode"] = mode end local hosts_filter = '' if ((mode ~= "all") or (not isEmptyString(pool))) then hosts_filter = '' end dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") prefs = ntop.getPrefs() ifstats = interface.getStats() if (_GET["page"] ~= "historical") then if(asn ~= nil) then print [[
") if(asn ~= nil) then print [[
]] end -- build the current filter url page_params["os"] = os_ page_params["asn"] = asn page_params["community"] = community page_params["vlan"] = vlan page_params["country"] = country page_params["mac"] = mac page_params["pool"] = pool page_params["network_cidr"] = cidr if(protocol ~= nil) then -- Example HTTP.Facebook dot = string.find(protocol, '%.') if(dot ~= nil) then protocol = string.sub(protocol, dot+1) end page_params["protocol"] = protocol end if(network ~= nil) then page_params["network"] = network local network_key = ntop.getNetworkNameById(tonumber(network)) network_name = getLocalNetworkAlias(network_key) if not isEmptyString(network_name) then local charts_available = areInterfaceTimeseriesEnabled(ifstats.id) charts_icon = " " if charts_available then charts_icon = charts_icon.."  " end charts_icon = charts_icon.."" else network_name = i18n("hosts_stats.remote") end else network_name = "" end local ipver_title if not isEmptyString(ipversion) then page_params["version"] = ipversion ipver_title = i18n("hosts_stats.ipver_title",{version_num=ipversion}) else ipver_title = "" end local traffic_type_title if not isEmptyString(traffic_type) then page_params["traffic_type"] = traffic_type if traffic_type == "one_way" then traffic_type_title = i18n("hosts_stats.traffic_type_one_way") elseif traffic_type == "bidirectional" then traffic_type_title = i18n("hosts_stats.traffic_type_two_ways") end else traffic_type_title = "" end custom_column_utils.updateCustomColumn() local custom_name, custom_key, custom_align = custom_column_utils.getCustomColumnName() print [[
]] if(have_nedge) then print[[ ]] end if(asn ~= nil) then print [[
]] end -- if(asn ~= nil) end dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")