From 0fc5db82dda2a210cbdc342b434796a7c7e34a2c Mon Sep 17 00:00:00 2001 From: Jean Flach Date: Fri, 8 Jun 2018 10:54:06 +0200 Subject: [PATCH] Fix ScheduledDowntimes replicating on restart fixes #4272 --- lib/icinga/scheduleddowntime.cpp | 3 +++ lib/icinga/scheduleddowntime.ti | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/lib/icinga/scheduleddowntime.cpp b/lib/icinga/scheduleddowntime.cpp index d8120691f..6a715fc40 100644 --- a/lib/icinga/scheduleddowntime.cpp +++ b/lib/icinga/scheduleddowntime.cpp @@ -176,6 +176,9 @@ void ScheduledDowntime::CreateNextDowntime() return; } + Log(LogDebug, "ScheduledDowntime") + << "Creating new Downtime for ScheduledDowntime \"" << GetName() << "\""; + std::pair segment = FindNextSegment(); if (segment.first == 0 && segment.second == 0) { diff --git a/lib/icinga/scheduleddowntime.ti b/lib/icinga/scheduleddowntime.ti index 10e88417b..e119eaa11 100644 --- a/lib/icinga/scheduleddowntime.ti +++ b/lib/icinga/scheduleddowntime.ti @@ -36,6 +36,10 @@ public: class ScheduledDowntime : CustomVarObject < ScheduledDowntimeNameComposer { + // Scheduled Downtimes have a dependency on Downtimes. This is to make sure ScheduledDowntimes are activated after + // the Downtimes (and other checkables) + activation_priority 20; + load_after Host; load_after Service;