Module: check_mk
Branch: master
Commit: 18596cebe64747bc56c6b28fa50ec93889cc69c6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=18596cebe64747…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Mon Oct 15 11:30:25 2018 +0200
6413 FIX Availability: don't try to merge completely disconnected intervals
If the option "Ignore intervals shorter or equal X sec" was used an exception
occured if intervals should be merged that were completely disconnected.
Disconnected intervals occur e.g. if the a host/service is outside of
the host/service period.
Change-Id: Ie89aa4ba70c3c0fab44cbaa7a7ad3b40776ff186
---
.werks/6413 | 14 ++++++++++++++
cmk/gui/availability.py | 1 +
2 files changed, 15 insertions(+)
diff --git a/.werks/6413 b/.werks/6413
new file mode 100644
index 0000000..0e6ce1b
--- /dev/null
+++ b/.werks/6413
@@ -0,0 +1,14 @@
+Title: Availability: don't try to merge completely disconnected intervals
+Level: 1
+Component: reporting
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1539594354
+
+If the option "Ignore intervals shorter or equal X sec" was used an exception
+occured if intervals should be merged that were completely disconnected.
+Disconnected intervals occur e.g. if the a host/service is outside of
+the host/service period.
diff --git a/cmk/gui/availability.py b/cmk/gui/availability.py
index cfb8851..cb115f6 100644
--- a/cmk/gui/availability.py
+++ b/cmk/gui/availability.py
@@ -1100,6 +1100,7 @@ def melt_short_intervals(entries, duration, dont_merge):
need_merge = False
while n < len(entries) - 1:
if entries[n][0]["duration"] <= duration and \
+ (entries[n-1][0]["until"] == entries[n][0]["from"] or
entries[n][0]["until"] == entries[n+1][0]["from"]) and \
entries[n-1][1] == entries[n+1][1]:
entries[n] = (entries[n][0], entries[n-1][1])
need_merge = True