Global storage utilization in Runtime Status

This commit is contained in:
Alfredo Cardigliano 2018-12-12 16:23:34 +01:00
parent 0eea23bf5a
commit a3d370ea7e
6 changed files with 145 additions and 40 deletions

View file

@ -3411,14 +3411,16 @@ function getFolderSize(path)
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
if ntop.isdir(path) then
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
end
return size