]> granicus.if.org Git - icinga2/commitdiff
Make sure the next check timestamp can't be in the past.
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 12 Sep 2013 13:47:45 +0000 (15:47 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 12 Sep 2013 13:47:45 +0000 (15:47 +0200)
lib/icinga/externalcommandprocessor.cpp

index e478346ae0b690d4fa027dc4c8371be61ef0b1d0..aa1b9ca62b08cf279b6623ac63e3d7e7ccfd8bcb 100644 (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 '" +