mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Rename local hosts iteration function
This commit is contained in:
parent
e3f52ee4c9
commit
1079beb244
2 changed files with 6 additions and 4 deletions
|
|
@ -104,9 +104,9 @@ end
|
|||
|
||||
-- ########################################################
|
||||
|
||||
-- Iterates each active host on the ifname interface.
|
||||
-- Iterates each active host on the ifname interface for RRD creation.
|
||||
-- Each host is passed to the callback with some more information.
|
||||
function callback_utils.foreachLocalHost(ifname, deadline, callback)
|
||||
function callback_utils.foreachLocalRRDHost(ifname, deadline, callback)
|
||||
local hostbase
|
||||
|
||||
interface.select(ifname)
|
||||
|
|
@ -114,6 +114,7 @@ function callback_utils.foreachLocalHost(ifname, deadline, callback)
|
|||
local iterator = callback_utils.getLocalHostsIterator(false --[[ no details ]])
|
||||
|
||||
for hostname, hoststats in iterator do
|
||||
-- Note: this is expensive
|
||||
local host = interface.getHostInfo(hostname)
|
||||
|
||||
if ((deadline ~= nil) and (os.time() >= deadline)) then
|
||||
|
|
@ -125,7 +126,8 @@ function callback_utils.foreachLocalHost(ifname, deadline, callback)
|
|||
if(host.localhost) then
|
||||
local keypath = getPathFromKey(hostname)
|
||||
hostbase = os_utils.fixPath(dirs.workingdir .. "/" .. getInterfaceId(ifname) .. "/rrd/" .. keypath)
|
||||
|
||||
|
||||
-- NOTE: filesystem activity here
|
||||
if(not(ntop.exists(hostbase))) then
|
||||
ntop.mkdir(hostbase)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue