-- -- (C) 2013-17 - ntop.org -- dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path require "lua_utils" local host_pools_utils = require "host_pools_utils" sendHTTPContentTypeHeader('text/html') ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc") protocol = _GET["protocol"] asn = _GET["asn"] vlan = _GET["vlan"] network = _GET["network"] country = _GET["country"] mac = _GET["mac"] os_ = _GET["os"] community = _GET["community"] pool = _GET["pool"] ipversion = _GET["version"] local base_url = ntop.getHttpPrefix() .. "/lua/hosts_stats.lua" local page_params = {} mode = _GET["mode"] if isEmptyString(mode) then mode = "all" else page_params["mode"] = mode end hosts_filter = '' if ((mode ~= "all") or (not isEmptyString(pool))) then hosts_filter = '' end active_page = "hosts" 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 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 network_name = ntop.getNetworkNameById(tonumber(network)) 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 print [[
]] if(asn ~= nil) then print [[
]] end -- if(asn ~= nil) else -- historical page require "graph_utils" local title = "" if asn ~= nil then title = i18n("asn")..": "..asn elseif vlan ~= nil then title = i18n("vlan")..": "..vlan end print[[
]] local rrdfile if(_GET["rrd_file"] == nil) then rrdfile = "bytes.rrd" else rrdfile = _GET["rrd_file"] end if asn ~= nil then drawRRD(ifstats.id, 'asn:'..asn, rrdfile, _GET["zoom"], base_url.."?asn="..asn.."&page=historical", 1, _GET["epoch"]) print[[
]] print(i18n('notes')) print[[
]] elseif vlan ~= nil then drawRRD(ifstats.id, 'vlan:'..vlan, rrdfile, _GET["zoom"], base_url.."?vlan="..vlan.."&page=historical", 1, _GET["epoch"]) end end dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")