alert_utils.lua: handle non existance of last dump

This commit handles the case where the last dump used for
interface alerts does not exist.
This commit is contained in:
Arianna Avanzini 2015-05-21 16:06:18 +02:00
parent 8ebe5805c4
commit 1503b1f3c0

View file

@ -217,10 +217,12 @@ function check_interface_threshold(ifname, mode)
fname = fixPath(basedir.."/iface_"..ifname.."_lastdump")
if(verbose) then print(fname.."<p>\n") end
-- Read old version
old_dump = persistence.load(fname)
if (old_dump ~= nil) then
check_interface_alert(ifname, mode, old_dump, ifstats)
if (ntop.exists(fname)) then
-- Read old version
old_dump = persistence.load(fname)
if (old_dump ~= nil) then
check_interface_alert(ifname, mode, old_dump, ifstats)
end
end
-- Write new version