mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
parent
1fbb653f94
commit
aeb7a4a70b
@ -79,6 +79,8 @@ void Checkable::UpdateNextCheck(const MessageOrigin::Ptr& origin)
|
|||||||
if (interval > 1)
|
if (interval > 1)
|
||||||
adj = fmod(now * 100 + GetSchedulingOffset(), interval * 100) / 100.0;
|
adj = fmod(now * 100 + GetSchedulingOffset(), interval * 100) / 100.0;
|
||||||
|
|
||||||
|
adj = std::min(0.5 + fmod(GetSchedulingOffset(), interval * 5) / 100.0, adj);
|
||||||
|
|
||||||
SetNextCheck(now - adj + interval, false, origin);
|
SetNextCheck(now - adj + interval, false, origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,17 +328,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
|
|||||||
is_flapping = IsFlapping();
|
is_flapping = IsFlapping();
|
||||||
|
|
||||||
if (cr->GetActive()) {
|
if (cr->GetActive()) {
|
||||||
/* If there was a OK -> NOT-OK state change for actively scheduled checks,
|
UpdateNextCheck(origin);
|
||||||
* update the next check time using the retry_interval.
|
|
||||||
* Important: Add the cluster message origin. */
|
|
||||||
if (GetStateType() == StateTypeSoft) {
|
|
||||||
UpdateNextCheck(origin);
|
|
||||||
} else if (hardChange) {
|
|
||||||
/* A hard state change must enforce the check interval again.
|
|
||||||
* UpdateNextCheck() will use the scheduling offset which generates
|
|
||||||
* an incorrect check time from the previous retry interval. */
|
|
||||||
SetNextCheck(Utility::GetTime() + GetCheckInterval(), false, origin);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
/* Reschedule the next check for passive check results. The side effect of
|
/* Reschedule the next check for passive check results. The side effect of
|
||||||
* this is that for as long as we receive passive results for a service we
|
* this is that for as long as we receive passive results for a service we
|
||||||
|
Loading…
x
Reference in New Issue
Block a user