mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Alert on software update
This commit is contained in:
parent
76391ff6a5
commit
5e5d50d72a
3 changed files with 15 additions and 1 deletions
|
|
@ -2353,6 +2353,13 @@ local function notify_ntopng_status(started)
|
|||
local event
|
||||
|
||||
if(started) then
|
||||
|
||||
-- reading current version and last version to check if it has been updated
|
||||
local last_version_key = "ntopng.updates.last_version"
|
||||
local last_version = ntop.getCache(last_version_key)
|
||||
local curr_version = info["version"].."-"..info["revision"]
|
||||
ntop.setCache(last_version_key, curr_version)
|
||||
|
||||
-- let's check if we are restarting from an anomalous termination
|
||||
-- e.g., from a crash
|
||||
if not recovery_utils.check_clean_shutdown() then
|
||||
|
|
@ -2361,8 +2368,12 @@ local function notify_ntopng_status(started)
|
|||
severity = alertSeverity("error")
|
||||
anomalous = true
|
||||
event = "anomalous_termination"
|
||||
elseif not isEmptyString(last_version) and last_version ~= curr_version then
|
||||
-- software update
|
||||
msg = string.format("%s %s", i18n("alert_messages.ntopng_update"), msg_details)
|
||||
event = "update"
|
||||
else
|
||||
-- normal termination
|
||||
-- normal termination
|
||||
msg = string.format("%s %s", i18n("alert_messages.ntopng_start"), msg_details)
|
||||
event = "start"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue