-- -- (C) 2018 - ntop.org -- local dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path require "lua_utils" local page_utils = require("page_utils") local ebpf_utils = require "ebpf_utils" sendHTTPContentTypeHeader('text/html') page_utils.print_header() local page = _GET["page"] if isEmptyString(page) then page = "process_ndpi" end dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") local pid = _GET["pid"] local name_key = _GET["pid_name"] or "no name" local host_info = url2hostinfo(_GET) local ifstats = interface.getStats() local refresh_rate local have_nedge = ntop.isnEdge() if have_nedge then refresh_rate = 5 else refresh_rate = getInterfaceRefreshRate(ifstats["id"]) end if not pid or not name_key then print("
"..i18n("processes_stats.missing_pid_name_message").."
") else local name = '' if num == 0 then print("
"..i18n("processes_stats.no_traffic_detected").."
") else if host_info and host_info["host"] then name = getResolvedAddress(hostkey2hostinfo(host_info["host"])) if isEmptyString(name) then name = host_info["host"] end end print [[ \n') if page == "process_ndpi" then ebpf_utils.draw_ndpi_piecharts(ifstats, "get_process_data.lua", host_info, nil, name_key) elseif page == "flows" then ebpf_utils.draw_flows_datatable(ifstats, host_info, nil, name_key) end end end dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")