mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-27 15:44:11 +02:00
Merge pull request #10239 from Icinga/state-before-suppression214
Fix lost recovery notifications after recovery outside of notification time period
This commit is contained in:
commit
6f9ae05948
@ -203,7 +203,7 @@ void Checkable::FireSuppressedNotifications()
|
|||||||
* If any of these conditions is not met, processing the suppressed notification is further delayed.
|
* If any of these conditions is not met, processing the suppressed notification is further delayed.
|
||||||
*/
|
*/
|
||||||
if (!state_suppressed && GetStateType() == StateTypeHard && !IsLikelyToBeCheckedSoon() && !wasLastParentRecoveryRecent.Get()) {
|
if (!state_suppressed && GetStateType() == StateTypeHard && !IsLikelyToBeCheckedSoon() && !wasLastParentRecoveryRecent.Get()) {
|
||||||
if (NotificationReasonApplies(type)) {
|
if (cr->GetState() != GetStateBeforeSuppression()) {
|
||||||
Checkable::OnNotificationsRequested(this, type, cr, "", "", nullptr);
|
Checkable::OnNotificationsRequested(this, type, cr, "", "", nullptr);
|
||||||
}
|
}
|
||||||
subtract |= NotificationRecovery|NotificationProblem;
|
subtract |= NotificationRecovery|NotificationProblem;
|
||||||
@ -266,12 +266,12 @@ bool Checkable::NotificationReasonApplies(NotificationType type)
|
|||||||
case NotificationProblem:
|
case NotificationProblem:
|
||||||
{
|
{
|
||||||
auto cr (GetLastCheckResult());
|
auto cr (GetLastCheckResult());
|
||||||
return cr && !IsStateOK(cr->GetState()) && cr->GetState() != GetStateBeforeSuppression();
|
return cr && !IsStateOK(cr->GetState());
|
||||||
}
|
}
|
||||||
case NotificationRecovery:
|
case NotificationRecovery:
|
||||||
{
|
{
|
||||||
auto cr (GetLastCheckResult());
|
auto cr (GetLastCheckResult());
|
||||||
return cr && IsStateOK(cr->GetState()) && cr->GetState() != GetStateBeforeSuppression();
|
return cr && IsStateOK(cr->GetState());
|
||||||
}
|
}
|
||||||
case NotificationFlappingStart:
|
case NotificationFlappingStart:
|
||||||
return IsFlapping();
|
return IsFlapping();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user