Make sure the next check timestamp can't be in the past.

This commit is contained in:
Gunnar Beutner 2013-09-12 15:47:45 +02:00
parent 6698d09a72
commit eb7d9e96f8
1 changed files with 9 additions and 0 deletions

View File

@ -266,6 +266,9 @@ void ExternalCommandProcessor::ScheduleHostCheck(double, const std::vector<Strin
Log(LogInformation, "icinga", "Rescheduling next check for host '" + arguments[0] + "'");
if (planned_check < Utility::GetTime())
planned_check = Utility::GetTime();
{
ObjectLock olock(hc);
@ -315,6 +318,9 @@ void ExternalCommandProcessor::ScheduleSvcCheck(double, const std::vector<String
Log(LogInformation, "icinga", "Rescheduling next check for service '" + arguments[1] + "'");
if (planned_check < Utility::GetTime())
planned_check = Utility::GetTime();
{
ObjectLock olock(service);
@ -453,6 +459,9 @@ void ExternalCommandProcessor::ScheduleHostSvcChecks(double, const std::vector<S
Host::Ptr host = Host::GetByName(arguments[0]);
if (planned_check < Utility::GetTime())
planned_check = Utility::GetTime();
BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) {
if (planned_check > service->GetNextCheck()) {
Log(LogInformation, "icinga", "Ignoring reschedule request for service '" +