Module: check_mk
Branch: master
Commit: 3d2cd7f9498f6e75974ca66191e70f1b347eb62b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3d2cd7f9498f6e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jun 6 12:08:24 2016 +0200
Addition to Werk #3394: service non-downtime annotation also disable host downtimes now
---
web/htdocs/availability.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/web/htdocs/availability.py b/web/htdocs/availability.py
index 9c1dbd8..be04b12 100644
--- a/web/htdocs/availability.py
+++ b/web/htdocs/availability.py
@@ -834,6 +834,14 @@ def reclassify_service_by_annotation(history_entry, annotation,
key_to_change):
new_entry["duration"] = p_until - p_from
if is_in:
new_entry[key_to_change] = annotation["downtime"] and 1 or
0
+ # If the annotation removes a downtime from the services, but
+ # the actual reason for the service being in downtime is a host
+ # downtime, then we must cancel the host downtime (also), or else
+ # that would override the unset service downtime.
+ if key_to_change == "in_downtime" \
+ and history_entry.get("in_host_downtime") \
+ and annotation["downtime"] == False:
+ new_entry["in_host_downtime"] = 0
new_history.append(new_entry)
else:
new_history.append(history_entry)