mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-24 10:17:59 +02:00
Recognize PENDING -> UNKNOWN as state change
... to get notified about that state change. refs #7807
This commit is contained in:
parent
a65f2d6b41
commit
5af4bc82b6
@ -231,7 +231,7 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* SOFT state change, increase attempt counter. */
|
/* SOFT state change, increase attempt counter. */
|
||||||
if (old_stateType == StateTypeSoft && !IsStateOK(old_state)) {
|
if (old_stateType == StateTypeSoft && old_cr && !IsStateOK(old_state)) {
|
||||||
SetStateType(StateTypeSoft);
|
SetStateType(StateTypeSoft);
|
||||||
attempt = old_attempt + 1;
|
attempt = old_attempt + 1;
|
||||||
}
|
}
|
||||||
@ -257,11 +257,15 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
|||||||
|
|
||||||
bool stateChange;
|
bool stateChange;
|
||||||
|
|
||||||
/* Exception on state change calculation for hosts. */
|
if (old_cr) {
|
||||||
if (checkableType == CheckableService)
|
/* Exception on state change calculation for hosts. */
|
||||||
stateChange = (old_state != new_state);
|
if (checkableType == CheckableService)
|
||||||
else
|
stateChange = (old_state != new_state);
|
||||||
stateChange = (Host::CalculateState(old_state) != Host::CalculateState(new_state));
|
else
|
||||||
|
stateChange = (Host::CalculateState(old_state) != Host::CalculateState(new_state));
|
||||||
|
} else {
|
||||||
|
stateChange = true;
|
||||||
|
}
|
||||||
|
|
||||||
/* Store the current last state change for the next iteration. */
|
/* Store the current last state change for the next iteration. */
|
||||||
SetPreviousStateChange(GetLastStateChange());
|
SetPreviousStateChange(GetLastStateChange());
|
||||||
@ -281,9 +285,9 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
|||||||
if (GetAcknowledgement() == AcknowledgementNone)
|
if (GetAcknowledgement() == AcknowledgementNone)
|
||||||
remove_acknowledgement_comments = true;
|
remove_acknowledgement_comments = true;
|
||||||
|
|
||||||
bool hardChange = (GetStateType() == StateTypeHard && old_stateType == StateTypeSoft);
|
bool hardChange = (GetStateType() == StateTypeHard && old_stateType == StateTypeSoft && old_cr);
|
||||||
|
|
||||||
if (stateChange && old_stateType == StateTypeHard && GetStateType() == StateTypeHard)
|
if (stateChange && (old_stateType == StateTypeHard || !old_cr) && GetStateType() == StateTypeHard)
|
||||||
hardChange = true;
|
hardChange = true;
|
||||||
|
|
||||||
bool is_volatile = GetVolatile();
|
bool is_volatile = GetVolatile();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user