Module: check_mk
Branch: master
Commit: f1bd57cecc7bfbc0d61917da55e80c82a6083325
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f1bd57cecc7bfb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Apr 22 17:09:07 2014 +0200
BI: Add error message when no statehist data available
---
web/plugins/views/availability.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index a76f7f0..5a60a48 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -1354,6 +1354,8 @@ def render_bi_availability(title, aggr_rows):
html.end_context_buttons()
avoptions = render_availability_options()
+ timewarpcode = ""
+
if not html.has_user_errors():
rows = []
for aggr_row in aggr_rows:
@@ -1424,6 +1426,9 @@ def get_bi_timeline(tree, aggr_group, avoptions, timewarp):
query += "Filter: host_name = %s\n" % host
query += "Or: %d\n" % len(hosts)
data = html.live.query(query)
+ if not data:
+ raise MKGeneralException(_("No historical data available for this
aggregation. Query was: <pre>%s</pre>") % query)
+
html.live.set_prepend_site(False)
html.live.set_only_sites(None)
columns = ["site"] + columns