Merge pull request #10187 from Icinga/state-before-suppression

Fix lost recovery notifications after recovery outside of notification time period
This commit is contained in:
Alexander Aleksandrovič Klimov 2024-10-24 10:07:59 +02:00 committed by GitHub
commit fb8badfd2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -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;
@ -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();