mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 00:19:33 +00:00
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:
parent
8ebe5805c4
commit
1503b1f3c0
1 changed files with 6 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue