Module: check_mk
Branch: master
Commit: e12998227bb59a948787a4485d42f4d8612db107
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e12998227bb59a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 3 14:20:42 2016 +0100
BI communicates via livestatus with the sites to first gather a list of
all hosts in all sites. Once this has been done BI knows which host
status can be found on which site.
But this info was not used when fetching the states of the hosts. The
host state queries were always sent to all sites causing a lot of needless
livestatus queries.
This should improve the performance of the BI views when having a higher
number of sites or some sites which have a bad connection.
---
.werks/3232 | 19 +++++++++++++++++++
ChangeLog | 1 +
web/htdocs/bi.py | 5 ++++-
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/.werks/3232 b/.werks/3232
new file mode 100644
index 0000000..b74516c
--- /dev/null
+++ b/.werks/3232
@@ -0,0 +1,19 @@
+Title: BI: Only querying site of host for specific host status info
+Level: 2
+Component: bi
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1457010960
+
+BI communicates via livestatus with the sites to first gather a list of
+all hosts in all sites. Once this has been done BI knows which host
+status can be found on which site.
+
+But this info was not used when fetching the states of the hosts. The
+host state queries were always sent to all sites causing a lot of needless
+livestatus queries.
+
+This should improve the performance of the BI views when having a higher
+number of sites or some sites which have a bad connection.
diff --git a/ChangeLog b/ChangeLog
index 859415b..559aadc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -91,6 +91,7 @@
BI:
* 3247 FIX: Do not allow multiple BI aggregates with the same title...
+ * 3232 FIX: BI: Only querying site of host for specific host status info...
Reporting & Availability:
* 3249 FIX: Fix missing filter for non-OK services when report is called via context
button
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index 07bc9c3..29c7f02 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -1219,11 +1219,14 @@ def get_status_info(required_hosts):
if len(hosts) > 1:
filter += "Or: %d\n" % len(hosts)
sites.live().set_auth_domain('bi')
+ sites.live().set_only_sites([site])
data = sites.live().query(
"GET hosts\n"
- "Columns: name state hard_state plugin_output
scheduled_downtime_depth acknowledged in_service_period services_with_fullstate\n"
+ "Columns: name state hard_state plugin_output
scheduled_downtime_depth "
+ "acknowledged in_service_period services_with_fullstate\n"
+ filter)
sites.live().set_auth_domain('read')
+ sites.live().set_only_sites(None)
tuples += [((site, e[0]), e[1:]) for e in data]
return dict(tuples)