Module: check_mk
Branch: master
Commit: dbbea82eebdb00e06b28e23e2bbed7198a12b18f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dbbea82eebdb00…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Jan 9 15:36:46 2017 +0100
4009 FIX Business intelligence: Multihost aggregations are no longer broken after a core
restart
Change-Id: I8c5f2b2b93e5a00ca1887f287faf0b31b0360e15
---
.werks/4009 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/bi.py | 7 ++++---
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/.werks/4009 b/.werks/4009
new file mode 100644
index 0000000..1189230
--- /dev/null
+++ b/.werks/4009
@@ -0,0 +1,9 @@
+Title: Business intelligence: Multihost aggregations are no longer broken after a core
restart
+Level: 1
+Component: bi
+Compatible: compat
+Version: 1.4.0i4
+Date: 1483972494
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 1794caa..2a90dd8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -54,6 +54,7 @@
BI:
* 4202 FIX: Availability now avoids pending states for times before new hosts or
services were added...
+ * 4009 FIX: Business intelligence: Multihost aggregations are no longer broken after
a core restart
Reporting & Availability:
* 3652 FIX: Unbreak PDF exports...
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index 80fcaa0..16f193c 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -910,7 +910,7 @@ class BIJobManager(object):
# Single host aggregation, no hosts in queue - GOOD!
continue
else:
- if info.get("compiled") == True:
+ if not discard_old_cache and info.get("compiled") == True:
# Fully compiled multi aggregation - GOOD!
continue
@@ -981,12 +981,13 @@ class BIJobManager(object):
job_id = job["id"]
job_info = job["info"]
- jobfile_data["jobs"].setdefault(job_id, {"queued_hosts":
set([]),
- "compiled_hosts":
set([])})
if job_id[0] == AGGR_HOST:
+ jobfile_data["jobs"].setdefault(job_id,
{"queued_hosts": set([]),
+ "compiled_hosts":
set([])})
jobfile_data["jobs"][job_id]["queued_hosts"] -=
job_info["queued_hosts"]
jobfile_data["jobs"][job_id]["compiled_hosts"].update(job_info["queued_hosts"])
else:
+ jobfile_data["jobs"].setdefault(job_id, {})
jobfile_data["jobs"][job_id]["compiled"] = True
self.save_jobs(jobfile_data)
g_bi_cache_manager.generate_cachefiles()