-- -- (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" sendHTTPHeader('text/html; charset=iso-8859-1') 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("
Missing pid name
") 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("
No traffic detected for this process, flow process expired, or process terminated.
") else if(host_key ~= nil) then name = ntop.getResolvedAddress(host_key) if (name == nil) then name = host_key end end print [[ \n') if(page == "Protocols") then print [[
]] print [[
Top L7 Protocols
]] print [[
Top L4 Protocols
]] print [[
]] print [[ ]] elseif(page == "Flows") then stats = interface.getnDPIStats() num_param = 0 print [[
]] end -- If page end -- Error one end -- Error two dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")