Module: check_mk
Branch: master
Commit: 1f98022545b03e2863bc5c4bfcbcecdee13778fa
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1f98022545b03e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 13 16:25:30 2017 +0100
Failed notification check: Advance acknowledgement time when no issues have been found on
any site
Change-Id: I8e06ef4901de5f276bca0e23b6c7e3f87a4a05d5
---
web/htdocs/notifications.py | 12 +++++++++++-
web/plugins/sidebar/shipped.py | 3 ---
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/notifications.py b/web/htdocs/notifications.py
index 21fc2d9..3457238 100644
--- a/web/htdocs/notifications.py
+++ b/web/htdocs/notifications.py
@@ -123,7 +123,17 @@ def load_failed_notifications(before=None, after=None,
stat_only=False, extra_he
query += extra_headers
if stat_only:
- return sites.live().query_summed_stats(query)
+ result = sites.live().query_summed_stats(query)
+ if result is None:
+ result = [0] # Normalize the result when no site answered
+
+ if result[0] == 0 and not sites.live().dead_sites():
+ # In case there are no errors and all sites are reachable:
+ # advance the users acknowledgement time
+ acknowledge_failed_notifications(time.time())
+
+ return result
+
else:
return sites.live().query(query)
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index d325b8b..1b41fbb 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -634,9 +634,6 @@ def get_tactical_overview_data(extra_filter_headers):
stat_only=True,
extra_headers=extra_filter_headers)
- if notdata is None:
- notdata = [0]
-
try:
event_data = sites.live().query_summed_stats(event_query)
except livestatus.MKLivestatusNotFoundError: