Skip to content

Commit

Permalink
Merge pull request #10187 from Icinga/state-before-suppression
Browse files Browse the repository at this point in the history
Fix lost recovery notifications after recovery outside of notification time period
  • Loading branch information
Al2Klimov authored Oct 24, 2024
2 parents 7df6baf + 7d0a43f commit fb8badf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/icinga/checkable-notification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void Checkable::FireSuppressedNotifications()
* If any of these conditions is not met, processing the suppressed notification is further delayed.
*/
if (!state_suppressed && GetStateType() == StateTypeHard && !IsLikelyToBeCheckedSoon() && !wasLastParentRecoveryRecent.Get()) {
if (NotificationReasonApplies(type)) {
if (cr->GetState() != GetStateBeforeSuppression()) {
Checkable::OnNotificationsRequested(this, type, cr, "", "", nullptr);
}
subtract |= NotificationRecovery|NotificationProblem;
Expand Down Expand Up @@ -266,12 +266,12 @@ bool Checkable::NotificationReasonApplies(NotificationType type)
case NotificationProblem:
{
auto cr (GetLastCheckResult());
return cr && !IsStateOK(cr->GetState()) && cr->GetState() != GetStateBeforeSuppression();
return cr && !IsStateOK(cr->GetState());
}
case NotificationRecovery:
{
auto cr (GetLastCheckResult());
return cr && IsStateOK(cr->GetState()) && cr->GetState() != GetStateBeforeSuppression();
return cr && IsStateOK(cr->GetState());
}
case NotificationFlappingStart:
return IsFlapping();
Expand Down

0 comments on commit fb8badf

Please sign in to comment.