Revert "Properly set the next check time for active and passive checks"

This reverts commit 2a11b27972.

This patch does not properly work and breaks the check_interval setting
for passive checks. Requires a proper patch.

refs #11248
refs #11257
refs #11273

(the old issue)
refs #7287
This commit is contained in:
Michael Friedrich 2016-03-05 17:48:06 +01:00
parent ce3062904f
commit b8e3d61820
4 changed files with 22 additions and 10 deletions

View File

@ -156,4 +156,9 @@ void CheckResultReader::ProcessCheckResultFile(const String& path) const
Log(LogDebug, "CheckResultReader") Log(LogDebug, "CheckResultReader")
<< "Processed checkresult file for object '" << checkable->GetName() << "'"; << "Processed checkresult file for object '" << checkable->GetName() << "'";
/* Reschedule the next check. The side effect of this is that for as long
* as we receive check result files for a host/service we won't execute any
* active checks. */
checkable->SetNextCheck(Utility::GetTime() + checkable->GetCheckInterval());
} }

View File

@ -106,6 +106,11 @@ Dictionary::Ptr ApiActions::ProcessCheckResult(const ConfigObject::Ptr& object,
cr->SetCommand(params->Get("check_command")); cr->SetCommand(params->Get("check_command"));
checkable->ProcessCheckResult(cr); checkable->ProcessCheckResult(cr);
/* Reschedule the next check. The side effect of this is that for as long
* as we receive passive results for a service we won't execute any
* active checks. */
checkable->SetNextCheck(Utility::GetTime() + checkable->GetCheckInterval());
return ApiActions::CreateResult(200, "Successfully processed check result for object '" + checkable->GetName() + "'."); return ApiActions::CreateResult(200, "Successfully processed check result for object '" + checkable->GetName() + "'.");
} }

View File

@ -302,16 +302,8 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
UpdateFlappingStatus(stateChange); UpdateFlappingStatus(stateChange);
is_flapping = IsFlapping(); is_flapping = IsFlapping();
/* update next check time for active and passive check results */ /* update next check time on possible state changes */
if (!GetEnableActiveChecks() && GetEnablePassiveChecks()) { UpdateNextCheck();
/* Reschedule the next passive check. The side effect of this is that for as long
* as we receive passive results for a service we won't execute any
* active checks. */
SetNextCheck(Utility::GetTime() + GetCheckInterval());
} else if (GetEnableActiveChecks()) {
/* update next check time based on state changes and types */
UpdateNextCheck();
}
olock.Unlock(); olock.Unlock();

View File

@ -365,6 +365,11 @@ void ExternalCommandProcessor::ProcessHostCheckResult(double time, const std::ve
<< "Processing passive check result for host '" << arguments[0] << "'"; << "Processing passive check result for host '" << arguments[0] << "'";
host->ProcessCheckResult(result); host->ProcessCheckResult(result);
/* Reschedule the next check. The side effect of this is that for as long
* as we receive passive results for a service we won't execute any
* active checks. */
host->SetNextCheck(Utility::GetTime() + host->GetCheckInterval());
} }
void ExternalCommandProcessor::ProcessServiceCheckResult(double time, const std::vector<String>& arguments) void ExternalCommandProcessor::ProcessServiceCheckResult(double time, const std::vector<String>& arguments)
@ -395,6 +400,11 @@ void ExternalCommandProcessor::ProcessServiceCheckResult(double time, const std:
<< "Processing passive check result for service '" << arguments[1] << "'"; << "Processing passive check result for service '" << arguments[1] << "'";
service->ProcessCheckResult(result); service->ProcessCheckResult(result);
/* Reschedule the next check. The side effect of this is that for as long
* as we receive passive results for a service we won't execute any
* active checks. */
service->SetNextCheck(Utility::GetTime() + service->GetCheckInterval());
} }
void ExternalCommandProcessor::ScheduleHostCheck(double, const std::vector<String>& arguments) void ExternalCommandProcessor::ScheduleHostCheck(double, const std::vector<String>& arguments)