mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
Storage status in the interface page (rrd, flows index, pcap)
recording_utils.storageInfo now returns everything in bytes Added getFolderSize to lua utils Added rrd_utils.storageInfo
This commit is contained in:
parent
9e12db7cda
commit
931070804c
7 changed files with 112 additions and 27 deletions
|
|
@ -1,5 +1,6 @@
|
|||
local os_utils = require "os_utils"
|
||||
require "lua_utils"
|
||||
require "rrd_paths"
|
||||
|
||||
SECONDS_IN_A_HOUR = 3600
|
||||
SECONDS_IN_A_DAY = SECONDS_IN_A_HOUR*24
|
||||
|
|
@ -280,4 +281,23 @@ function rrd_interval_integrate(epoch_start, epoch_end, resolution, start, rawda
|
|||
return times
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
|
||||
-- Read information about the disk space used by rrd (size is in bytes)
|
||||
function rrd_utils.storageInfo(ifid)
|
||||
local dirs = ntop.getDirs()
|
||||
local paths = getRRDPaths()
|
||||
local info = { total = 0 }
|
||||
|
||||
for _, path in pairs(paths) do
|
||||
local absolute_path = os_utils.fixPath(dirs.workingdir .. "/" .. ifid .. "/".. path .."/")
|
||||
info[path] = getFolderSize(absolute_path)
|
||||
info["total"] = info["total"] + info[path]
|
||||
end
|
||||
|
||||
return info
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
|
||||
return rrd_utils
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue