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() << "'.";