From faae237482fdef4a7880c91b763cb6768c5e47a9 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 1 Jul 2019 13:15:53 +0200 Subject: [PATCH] Send problem notification on downtime end if checkable is still not OK refs #5919 --- lib/icinga/checkable.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/icinga/checkable.cpp b/lib/icinga/checkable.cpp index 0f1879dda32..df28d50b931 100644 --- a/lib/icinga/checkable.cpp +++ b/lib/icinga/checkable.cpp @@ -183,6 +183,18 @@ void Checkable::NotifyDowntimeEnd(const Downtime::Ptr& downtime) if (!checkable->IsPaused()) OnNotificationsRequested(checkable, NotificationDowntimeEnd, checkable->GetLastCheckResult(), downtime->GetAuthor(), downtime->GetComment(), nullptr); + + if (downtime->IsTriggered() && checkable->GetProblem() && checkable->GetStateType() == StateTypeHard) { + double nextNotification = Utility::GetTime() + 1; + + for (auto& notification : checkable->GetNotifications()) { + auto types (notification->GetTypes()); + + if (types->Contains(NotificationProblem) && notification->GetNextNotification() > nextNotification) { + notification->SetNextNotification(nextNotification); + } + } + } } void Checkable::ValidateCheckInterval(const Lazy& lvalue, const ValidationUtils& utils)