Skip to content

Commit

Permalink
Send problem notification on downtime end if checkable is still not OK
Browse files Browse the repository at this point in the history
refs #5919
  • Loading branch information
Al2Klimov committed Jul 1, 2019
1 parent 58cb1e0 commit faae237
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/icinga/checkable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double>& lvalue, const ValidationUtils& utils)
Expand Down

0 comments on commit faae237

Please sign in to comment.