mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +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
|
|
@ -3404,6 +3404,28 @@ end
|
|||
|
||||
-- ###########################################
|
||||
|
||||
-- Returns the size of a folder (size is in bytes)
|
||||
function getFolderSize(path)
|
||||
local size = 0
|
||||
|
||||
if ntop.isWindows() then
|
||||
-- TODO
|
||||
else
|
||||
local line = os_utils.execWithOutput("du -s "..path.." 2>/dev/null")
|
||||
local values = split(line, '\t')
|
||||
if #values >= 1 then
|
||||
local used = tonumber(values[1])
|
||||
if used ~= nil then
|
||||
size = used*1024
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return size
|
||||
end
|
||||
|
||||
-- ###########################################
|
||||
|
||||
-- Compares IPv4 / IPv6 addresses
|
||||
function ip_address_asc(a, b)
|
||||
return(ntop.ipCmp(a, b) < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue