Module: check_mk
Branch: master
Commit: 801372145fbc3001fa51d224ce1991c62349c79d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=801372145fbc30…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Apr 18 14:52:43 2018 +0200
5800 FIX Availability: UNMONITORED timeperiods were incorrectly used in computation
results in certain scenarios
When honoring host and service periods, UNMONITORED timeperiods outside of a service
period were will still used in the computation.
Change-Id: I329be6e96ec0de920954b512ef9e64d863a68879
---
.werks/5800 | 10 ++++++++++
web/htdocs/availability.py | 12 +++++-------
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/.werks/5800 b/.werks/5800
new file mode 100644
index 0000000..e4f3a39
--- /dev/null
+++ b/.werks/5800
@@ -0,0 +1,10 @@
+Title: Availability: UNMONITORED timeperiods were incorrectly used in computation results
in certain scenarios
+Level: 1
+Component: multisite
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1524055633
+Class: fix
+
+When honoring host and service periods, UNMONITORED timeperiods outside of a service
period were will still used in the computation.
diff --git a/web/htdocs/availability.py b/web/htdocs/availability.py
index b9ffaaf..ad4cdf3 100644
--- a/web/htdocs/availability.py
+++ b/web/htdocs/availability.py
@@ -820,18 +820,16 @@ def compute_availability(what, av_rawdata, avoptions):
host_alias = span.get("host_alias", site_host[1])
consider = True
- if state == -1:
- s = "unmonitored"
- if not avoptions["consider"]["unmonitored"]:
- consider = False
-
- elif avoptions["service_period"] != "ignore" and \
+ if avoptions["service_period"] != "ignore" and \
(( span["in_service_period"] and
avoptions["service_period"] != "honor" )
or \
( not span["in_service_period"] and
avoptions["service_period"] == "honor" )):
s = "outof_service_period"
consider = False
-
+ elif state == -1:
+ s = "unmonitored"
+ if not avoptions["consider"]["unmonitored"]:
+ consider = False
elif span["in_notification_period"] == 0 and
avoptions["notification_period"] == "exclude":
consider = False