Module: check_mk
Branch: master
Commit: 7fcaf623ff86dfcc1f4587b608b8ad062002a5ff
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7fcaf623ff86df…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Jan 17 15:32:17 2013 +0100
Add: bi views now support debug of livestatus queries
---
ChangeLog | 3 +++
web/htdocs/bi.py | 21 +++++++++++++++++----
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f1b8e73..0b0b6d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -23,6 +23,9 @@
* Fix: On site configaration changes, only relevant sites are marked as dirty
* Fix: Distributed setup: Correct cleanup of pending changes logfile after
"Activate changes"
+ Bi:
+ * Add: Bi views now support debug of livestatus queries
+
1.2.1i4:
Core:
* Better exception handling when executing "Check_MK"-Check. Printing
python
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index c8b5c16..1d8295d 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -1096,10 +1096,23 @@ def get_status_info_filtered(filter_header, only_sites, limit,
add_columns, fetc
html.live.set_only_sites(only_sites)
html.live.set_prepend_site(True)
- data = html.live.query(
- "GET hosts\n" +
- "Columns: " + (" ".join(columns)) + "\n" +
- filter_header)
+
+ query = "GET hosts\n"
+ query += "Columns: " + (" ".join(columns)) + "\n"
+ query += filter_header
+
+
+ if config.debug_livestatus_queries \
+ and html.output_format == "html" and 'W' in
html.display_options:
+ html.write('<div class="livestatus message"
onmouseover="this.style.display=\'none\';">'
+ '<tt>%s</tt></div>\n' %
(query.replace('\n', '<br>\n')))
+
+
+ html.live.set_only_sites(only_sites)
+ html.live.set_prepend_site(True)
+
+ data = html.live.query(query)
+
html.live.set_prepend_site(False)
html.live.set_only_sites(None)