Add safety check reading per interface storage utilization

This commit is contained in:
Alfredo Cardigliano 2021-01-26 12:16:46 +01:00
parent 9a8d3c521a
commit 8a1cc0e398

View file

@ -98,10 +98,12 @@ function storage_utils.storageInfo(refresh_cache, timeout)
for id, name in pairs(ifnames) do
local ifid = tonumber(id)
local if_info = storage_utils.interfaceStorageInfo(ifid, separate_pcap_volume, refresh_cache, timeout)
info.interfaces[ifid] = if_info
info.total = info.total + if_info.total
if if_info.pcap ~= nil then
info.pcap_total = info.pcap_total + if_info.pcap
if if_info then
info.interfaces[ifid] = if_info
info.total = info.total + if_info.total
if if_info.pcap ~= nil then
info.pcap_total = info.pcap_total + if_info.pcap
end
end
end