diff --git a/httpdocs/inc/pool_stats_id.inc b/httpdocs/inc/pool_stats_id.inc index c307afbfb7..41559e747c 100644 --- a/httpdocs/inc/pool_stats_id.inc +++ b/httpdocs/inc/pool_stats_id.inc @@ -10,7 +10,7 @@ function pool_table_setID (row) { row.attr('id', pool_key); row.find("td").eq(index++).attr('id', pool_key+"_key"); - row.find("td").eq(index++).attr('id', pool_key+"_number"); + row.find("td").eq(index++).attr('id', pool_key+"_id"); // pool_stats_top row.find("td").eq(index++).attr('id', pool_key+"_chart"); row.find("td").eq(index++).attr('id', pool_key+"_hosts"); diff --git a/scripts/lua/get_grouped_hosts_data.lua b/scripts/lua/get_grouped_hosts_data.lua index 861fcd9c4c..0332684c32 100644 --- a/scripts/lua/get_grouped_hosts_data.lua +++ b/scripts/lua/get_grouped_hosts_data.lua @@ -68,7 +68,7 @@ if (all ~= nil) then currentPage = 0 end -if (as_n == nil and vlan_n == nil and network_n == nil and country_n == nil and os_n == nil) then -- single group info requested +if (as_n == nil and vlan_n == nil and network_n == nil and country_n == nil and os_n == nil and pool_n == nil) then -- single group info requested print ("{ \"currentPage\" : " .. currentPage .. ",\n \"data\" : [\n") end num = 0 @@ -137,7 +137,7 @@ function print_single_group(value) if(manufacturer == nil) then manufacturer = "" end print(manufacturer..'", ') elseif(group_col == "pool_id") then - pool_name = host_pools_utils.getPoolName(getInterfaceId(ifname), tostring(value["id"])) + local pool_name = host_pools_utils.getPoolName(getInterfaceId(ifname), tostring(value["id"])) print(pool_name..' " , ') if tostring(value["id"]) ~= host_pools_utils.DEFAULT_POOL_ID then @@ -263,7 +263,7 @@ elseif (network_n ~= nil) then end stats_by_group_col = {} elseif (pool_n ~= nil) then - pool_val = stats_by_group_col[tonumber(pool_val)] + pool_val = stats_by_group_col[tonumber(pool_n)] if (pool_val == nil) then print('{}') else @@ -329,7 +329,7 @@ for _key, _value in pairsByValues(vals, funct) do end end -- for -if (as_n == nil and vlan_n == nil and network_n == nil and country_n == nil and os_n == nil) then -- single group info requested +if (as_n == nil and vlan_n == nil and network_n == nil and country_n == nil and os_n == nil and pool_n == nil) then -- single group info requested print ("\n], \"perPage\" : " .. perPage .. ",\n") end @@ -341,7 +341,7 @@ if(sortOrder == nil) then sortOrder = "" end -if (as_n == nil and vlan_n == nil and network_n == nil and country_n == nil and os_n == nil) then -- single group info requested +if (as_n == nil and vlan_n == nil and network_n == nil and country_n == nil and os_n == nil and pool_n == nil) then -- single group info requested print ("\"sort\" : [ [ \"" .. sortColumn .. "\", \"" .. sortOrder .."\" ] ],\n") print ("\"totalRows\" : " .. total .. " \n}") end diff --git a/scripts/lua/modules/host_pools_utils.lua b/scripts/lua/modules/host_pools_utils.lua index f03b09297b..29a3e6b164 100644 --- a/scripts/lua/modules/host_pools_utils.lua +++ b/scripts/lua/modules/host_pools_utils.lua @@ -171,7 +171,7 @@ function host_pools_utils.updateRRDs(ifid, dump_ndpi, verbose) -- Traffic stats local rrdpath = fixPath(pool_base .. "/bytes.rrd") createRRDcounter(rrdpath, 300, verbose) - ntop.rrd_update(rrdpath, "N:"..tolongint(pool_stats["packets.sent"]) .. ":" .. tolongint(pool_stats["packets.recv"])) + ntop.rrd_update(rrdpath, "N:"..tolongint(pool_stats["bytes.sent"]) .. ":" .. tolongint(pool_stats["bytes.recv"])) -- nDPI stats if dump_ndpi then diff --git a/scripts/lua/pool_details.lua b/scripts/lua/pool_details.lua index 106164fbe7..005461c20d 100644 --- a/scripts/lua/pool_details.lua +++ b/scripts/lua/pool_details.lua @@ -23,8 +23,8 @@ if (not ntop.isPro()) then end interface.select(ifname) -ifstats = interface.getStats() -ifId = ifstats.id +local ifstats = interface.getStats() +local ifId = ifstats.id local pool_name = host_pools_utils.getPoolName(ifId, pool_id) sendHTTPHeader('text/html; charset=iso-8859-1') @@ -36,10 +36,29 @@ if(pool_id == nil) then return end +print [[ +