Module: check_mk
Branch: master
Commit: ee27b39ee695530439c1f5bacbddf13d99bf748a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ee27b39ee69553…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Nov 18 10:34:14 2016 +0100
4045 FIX Tactical Overview: do not count OK events as problems
---
.werks/4045 | 9 +++++++++
ChangeLog | 1 +
web/plugins/sidebar/shipped.py | 15 ++++++++++++++-
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/.werks/4045 b/.werks/4045
new file mode 100644
index 0000000..c67f6ef
--- /dev/null
+++ b/.werks/4045
@@ -0,0 +1,9 @@
+Title: Tactical Overview: do not count OK events as problems
+Level: 2
+Component: wato
+Compatible: multisite
+Version: 1.4.0i3
+Date: 1479461630
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 3667e80..74c8146 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,6 +34,7 @@
* 3976 FIX: Fixed broken link in LDAP automatic sync help text
* 3977 FIX: Fixed poping up changes button in sidebar snapin after a change
* 3982 FIX: Some MKPs created with WATO could not be uploaded to the Check_MK
Exchange
+ * 4045 FIX: Tactical Overview: do not count OK events as problems
Notifications:
* 4042 FIX: Fix missing From address in synchronous SMTP notifications...
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index 52dddac..2350bc3 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -600,9 +600,16 @@ def get_tactical_overview_data(extra_filter_headers):
event_query = (
"GET eventconsoleevents\n"
"Stats: event_phase != \n"
+ )
+
+ event_problems_query = (
+ "GET eventconsoleevents\n"
"Stats: event_phase = ack\n"
"Stats: event_phase = open\n"
+ "Filter: event_state != 0\n"
)
+ # TODO: We should rather use Stats: event_state != 0\nStatsAnd: 2 here. But that
+ # segfaults the CMC currently ;-)
try:
hstdata = sites.live().query_summed_stats(host_query)
@@ -616,13 +623,19 @@ def get_tactical_overview_data(extra_filter_headers):
if notdata is None:
notdata = [0]
- event_data = sites.live().query_summed_stats(event_query)
+ event_data = tactical_overview_get_event_data(event_query, event_problems_query)
except livestatus.MKLivestatusNotFoundError:
return None, None, None, None
return hstdata, svcdata, notdata, event_data
+
+def tactical_overview_get_event_data(event_query, event_problems_query):
+ return sites.live().query_summed_stats(event_query) + \
+ sites.live().query_summed_stats(event_problems_query)
+
+
def render_tactical_overview(extra_filter_headers="",
extra_url_variables=None):
if extra_url_variables is None:
extra_url_variables = []