-- -- (C) 2018 - ntop.org -- local dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path require "lua_utils" require "flow_utils" local page_utils = require("page_utils") sendHTTPContentTypeHeader('text/html') page_utils.print_header() local page = _GET["page"] if(page == nil) then page = "Protocols" end dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") local pid_key = _GET["pid"] local name_key = _GET["pid_name"] local host_key = _GET["host"] local application = _GET["application"] local general_process = 0 local flows 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("user_info.top_l7_protocols")) print[[
]] print [[
]] print(i18n("user_info.top_l4_protocols")) print[[
]] print [[
]] print [[ ]] elseif(page == "Flows") then stats = interface.getActiveFlowsStats() 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")