mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Implement interface in/out stats read from proc
This commit is contained in:
parent
bb09c42de1
commit
08a8c67966
9 changed files with 82 additions and 7 deletions
|
|
@ -13,12 +13,13 @@ local callback_utils = {}
|
|||
|
||||
-- Iterates available interfaces, excluding PCAP interfaces.
|
||||
-- Each valid interface is select-ed and passed to the callback.
|
||||
function callback_utils.foreachInterface(ifnames, condition, callback)
|
||||
-- NOTE: get_direction_stats should only be used by second.lua
|
||||
function callback_utils.foreachInterface(ifnames, condition, callback, get_direction_stats)
|
||||
for _,_ifname in pairs(ifnames) do
|
||||
if(ntop.isShutdown()) then return true end
|
||||
|
||||
interface.select(_ifname)
|
||||
local ifstats = interface.getStats()
|
||||
local ifstats = interface.getStats(get_direction_stats)
|
||||
|
||||
if condition == nil or condition(ifstats.id) then
|
||||
if((ifstats.type ~= "pcap dump") and (ifstats.type ~= "unknown")) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue