-- -- (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(page == nil) then page = "username_processes" end dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") local user_key = _GET["username"] local host_info = url2hostinfo(_GET) local uid = _GET["uid"] local name 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(user_key == nil) then print("
"..i18n("user_info.missing_user_name_message").."
") 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 == "username_processes") then print [[ ]] print [[
]] print(i18n("user_info.processes_overview")) print[[
]] elseif(page == "username_ndpi") then ebpf_utils.draw_ndpi_piecharts(ifstats, "get_username_data.lua", host_info, uid, nil) elseif page == "flows" then ebpf_utils.draw_flows_datatable(ifstats, host_info, uid, nil) end end dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")