Module: check_mk
Branch: master
Commit: d2a8a2bf1f6232dc290917b07d061ae69d32a71b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d2a8a2bf1f6232…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Dec 9 15:51:21 2016 +0100
Werk 4045 reloaded: Correcting the events counts.
---
web/plugins/sidebar/shipped.py | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index 7c8ffbe..387485f 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -608,18 +608,22 @@ def get_tactical_overview_data(extra_filter_headers):
extra_filter_headers
event_query = (
+ # "Events" column
"GET eventconsoleevents\n"
- "Stats: event_phase != \n"
- )
-
- event_problems_query = (
- "GET eventconsoleevents\n"
+ "Stats: event_phase = open\n"
"Stats: event_phase = ack\n"
+ "StatsOr: 2\n"
+ # "Problems" column
"Stats: event_phase = open\n"
- "Filter: event_state != 0\n"
+ "Stats: event_phase = ack\n"
+ "StatsOr: 2\n"
+ "Stats: event_state != 0\n"
+ "StatsAnd: 2\n"
+ # "Unhandled" column
+ "Stats: event_phase = open\n"
+ "Stats: event_state != 0\n"
+ "StatsAnd: 2\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)
@@ -633,7 +637,7 @@ def get_tactical_overview_data(extra_filter_headers):
if notdata is None:
notdata = [0]
- event_data = tactical_overview_get_event_data(event_query, event_problems_query)
+ event_data = sites.live().query_summed_stats(event_query)
except livestatus.MKLivestatusNotFoundError:
return None, None, None, None
@@ -641,11 +645,6 @@ def get_tactical_overview_data(extra_filter_headers):
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 = []