From c86b17132c39fde140a4cd749ab1abde02b8a347 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 25 Feb 2015 15:18:35 +0100 Subject: [PATCH] Make sure that the scheduled start time for downtimes isn't ignored fixes #6959 --- lib/icinga/checkable-downtime.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/icinga/checkable-downtime.cpp b/lib/icinga/checkable-downtime.cpp index d643aa163..ab35185e8 100644 --- a/lib/icinga/checkable-downtime.cpp +++ b/lib/icinga/checkable-downtime.cpp @@ -201,6 +201,14 @@ void Checkable::TriggerDowntime(const String& id) return; } + double now = Utility::GetTime(); + + if (now < downtime->GetStartTime() && now > downtime->GetEndTime()) { + Log(LogDebug, "Checkable") + << "Not triggering downtime with ID '" << downtime->GetLegacyId() << "': current time is outside downtime window."; + return; + } + Log(LogNotice, "Checkable") << "Triggering downtime with ID '" << downtime->GetLegacyId() << "'.";