-- -- (C) 2014-15-15 - ntop.org -- dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path require "lua_utils" require "flow_utils" sendHTTPContentTypeHeader('text/html') ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc") page = _GET["page"] if(page == nil) then page = "Protocols" end dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") pid_key = _GET["pid"] name_key = _GET["pid_name"] host_key = _GET["host"] application = _GET["application"] general_process = 0 interface.select(ifname) if((pid_key == nil) and (name_key == nil))then print("
"..i18n("processes_stats.missing_pid_name_message").."
") else if ((name_key ~= nil) and (pid_key == nil) and (host_key == nil)) then general_process = 1 end -- Prepare displayed value if (pid_key ~= nil) then flows = interface.findPidFlows(tonumber(pid_key)) err_label = "PID" err_val = pid_key elseif (name_key ~= nil) then flows = interface.findNameFlows(name_key) err = "Name" err_val = name_key end num = 0; if(flows ~= nil) then for key, value in pairs(flows) do num = num + 1 end end if(num == 0) then print("
"..i18n("processes_stats.no_traffic_detected").."
") else if(host_key ~= nil) then name = getResolvedAddress(hostkey2hostinfo(host_key)) if (name == nil) then name = host_key end end print [[ \n') if(page == "Protocols") then print [[
]] print [[
]] print(i18n("processes_stats.top_l7_protocols")) print[[
]] print [[
]] print(i18n("processes_stats.top_l4_protocols")) print[[
]] print [[
]] print [[ ]] elseif(page == "Flows") then stats = interface.getnDPIStats() num_param = 0 print [[
]] elseif(page == "Hosts") then print [[
]] print [[
]] print(i18n("processes_stats.top_hosts_traffic")) print[[
]] print [[
]] print [[ ]] end -- If page end -- Error one end -- Error two dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")