diff --git a/lib/icinga/apiactions.cpp b/lib/icinga/apiactions.cpp index 9faa0304c..a67121b53 100644 --- a/lib/icinga/apiactions.cpp +++ b/lib/icinga/apiactions.cpp @@ -104,6 +104,10 @@ Dictionary::Ptr ApiActions::ProcessCheckResult(const ConfigObject::Ptr& object, cr->SetCheckSource(HttpUtility::GetLastParameter(params, "check_source")); cr->SetPerformanceData(params->Get("performance_data")); cr->SetCommand(params->Get("check_command")); + + /* Mark this check result as passive. */ + cr->SetActive(false); + checkable->ProcessCheckResult(cr); /* Reschedule the next check. The side effect of this is that for as long diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp index 42dd993f5..79c690f06 100644 --- a/lib/icinga/checkable-check.cpp +++ b/lib/icinga/checkable-check.cpp @@ -197,7 +197,14 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig attempt = old_attempt + 1; // NOT-OK -> NOT-OK counter } else if (IsStateOK(old_state)) { SetStateType(StateTypeSoft); - attempt = 1; //OK -> NOT-OK transition, reset the counter + attempt = 1; // OK -> NOT-OK transition, reset the counter + + /* If there was a OK -> NOT-OK state change for actively scheduled checks, + * update the next check time using the retry_interval. + * Important: Add the cluster message origin. + */ + if (cr->GetActive()) + SetNextCheck(Utility::GetTime() + GetRetryInterval(), false, origin); } else { attempt = old_attempt; } diff --git a/lib/icinga/externalcommandprocessor.cpp b/lib/icinga/externalcommandprocessor.cpp index f0889376c..a98127e1e 100644 --- a/lib/icinga/externalcommandprocessor.cpp +++ b/lib/icinga/externalcommandprocessor.cpp @@ -321,6 +321,8 @@ void ExternalCommandProcessor::ProcessHostCheckResult(double time, const std::ve result->SetScheduleEnd(time); result->SetExecutionStart(time); result->SetExecutionEnd(time); + + /* Mark this check result as passive. */ result->SetActive(false); Log(LogNotice, "ExternalCommandProcessor") @@ -356,6 +358,8 @@ void ExternalCommandProcessor::ProcessServiceCheckResult(double time, const std: result->SetScheduleEnd(time); result->SetExecutionStart(time); result->SetExecutionEnd(time); + + /* Mark this check result as passive. */ result->SetActive(false); Log(LogNotice, "ExternalCommandProcessor")