mirror of https://github.com/Icinga/icinga2.git
Merge pull request #8101 from Icinga/bugfix/timestamps-checkresult-differ-across-nodes-8092
State timestamps set by the same check result differ across nodes
This commit is contained in:
commit
4f6fecc74c
|
@ -209,7 +209,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
|
||||||
recovery = true;
|
recovery = true;
|
||||||
|
|
||||||
ResetNotificationNumbers();
|
ResetNotificationNumbers();
|
||||||
SaveLastState(ServiceOK, Utility::GetTime());
|
SaveLastState(ServiceOK, cr->GetExecutionEnd());
|
||||||
|
|
||||||
/* update reachability for child objects in OK state */
|
/* update reachability for child objects in OK state */
|
||||||
if (!children.empty())
|
if (!children.empty())
|
||||||
|
@ -234,7 +234,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsStateOK(cr->GetState())) {
|
if (!IsStateOK(cr->GetState())) {
|
||||||
SaveLastState(cr->GetState(), Utility::GetTime());
|
SaveLastState(cr->GetState(), cr->GetExecutionEnd());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update reachability for child objects in NOT-OK state */
|
/* update reachability for child objects in NOT-OK state */
|
||||||
|
@ -243,7 +243,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!reachable)
|
if (!reachable)
|
||||||
SetLastStateUnreachable(Utility::GetTime());
|
SetLastStateUnreachable(cr->GetExecutionEnd());
|
||||||
|
|
||||||
SetCheckAttempt(attempt);
|
SetCheckAttempt(attempt);
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
|
||||||
SetPreviousStateChange(GetLastStateChange());
|
SetPreviousStateChange(GetLastStateChange());
|
||||||
|
|
||||||
if (stateChange) {
|
if (stateChange) {
|
||||||
SetLastStateChange(now);
|
SetLastStateChange(cr->GetExecutionEnd());
|
||||||
|
|
||||||
/* remove acknowledgements */
|
/* remove acknowledgements */
|
||||||
if (GetAcknowledgement() == AcknowledgementNormal ||
|
if (GetAcknowledgement() == AcknowledgementNormal ||
|
||||||
|
@ -299,7 +299,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
|
||||||
|
|
||||||
if (hardChange || is_volatile) {
|
if (hardChange || is_volatile) {
|
||||||
SetLastHardStateRaw(new_state);
|
SetLastHardStateRaw(new_state);
|
||||||
SetLastHardStateChange(now);
|
SetLastHardStateChange(cr->GetExecutionEnd());
|
||||||
SetLastHardStatesRaw(GetLastHardStatesRaw() / 100u + new_state * 100u);
|
SetLastHardStatesRaw(GetLastHardStatesRaw() / 100u + new_state * 100u);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue