mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Don't increment check attempt counter on OK->NOT-OK transition
This fixes the problem that the first SOFT state is actually considered the second state. refs #7287 fixes #9897 Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
This commit is contained in:
parent
6ffdbce213
commit
6f252bb5c5
@ -319,9 +319,12 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
|
|||||||
} else {
|
} else {
|
||||||
if (old_attempt >= GetMaxCheckAttempts()) {
|
if (old_attempt >= GetMaxCheckAttempts()) {
|
||||||
SetStateType(StateTypeHard);
|
SetStateType(StateTypeHard);
|
||||||
} else if (old_stateType == StateTypeSoft || old_state == ServiceOK) {
|
} else if (old_stateType == StateTypeSoft && old_state != ServiceOK) {
|
||||||
SetStateType(StateTypeSoft);
|
SetStateType(StateTypeSoft);
|
||||||
attempt = old_attempt + 1;
|
attempt = old_attempt + 1; //NOT-OK -> NOT-OK counter
|
||||||
|
} else if (old_state == ServiceOK) {
|
||||||
|
SetStateType(StateTypeSoft);
|
||||||
|
attempt = 1; //OK -> NOT-OK transition, reset the counter
|
||||||
} else {
|
} else {
|
||||||
attempt = old_attempt;
|
attempt = old_attempt;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user