mirror of https://github.com/Icinga/icinga2.git
parent
332a21a7d0
commit
bd37b9b62f
|
@ -262,7 +262,7 @@ void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& autho
|
||||||
SetLastStateType(old_stateType);
|
SetLastStateType(old_stateType);
|
||||||
SetLastReachable(reachable);
|
SetLastReachable(reachable);
|
||||||
|
|
||||||
long attempt;
|
long attempt = 1;
|
||||||
|
|
||||||
if (!old_cr) {
|
if (!old_cr) {
|
||||||
SetStateType(StateTypeHard);
|
SetStateType(StateTypeHard);
|
||||||
|
@ -270,14 +270,12 @@ void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& autho
|
||||||
if (old_state == StateOK && old_stateType == StateTypeSoft)
|
if (old_state == StateOK && old_stateType == StateTypeSoft)
|
||||||
SetStateType(StateTypeHard); // SOFT OK -> HARD OK
|
SetStateType(StateTypeHard); // SOFT OK -> HARD OK
|
||||||
|
|
||||||
attempt = 1;
|
|
||||||
recovery = true;
|
recovery = true;
|
||||||
ResetNotificationNumbers();
|
ResetNotificationNumbers();
|
||||||
SetLastStateOK(Utility::GetTime());
|
SetLastStateOK(Utility::GetTime());
|
||||||
} else {
|
} else {
|
||||||
if (old_attempt >= GetMaxCheckAttempts()) {
|
if (old_attempt >= GetMaxCheckAttempts()) {
|
||||||
SetStateType(StateTypeHard);
|
SetStateType(StateTypeHard);
|
||||||
attempt = 1;
|
|
||||||
} else if (GetStateType() == StateTypeSoft || GetState() == StateOK) {
|
} else if (GetStateType() == StateTypeSoft || GetState() == StateOK) {
|
||||||
SetStateType(StateTypeSoft);
|
SetStateType(StateTypeSoft);
|
||||||
attempt = old_attempt + 1;
|
attempt = old_attempt + 1;
|
||||||
|
|
Loading…
Reference in New Issue