]> granicus.if.org Git - icinga2/commitdiff
Make sure we're not running command_endpoint-based checks more than once
authorGunnar Beutner <gunnar@beutner.name>
Thu, 21 Jan 2016 09:32:38 +0000 (10:32 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Thu, 21 Jan 2016 09:37:47 +0000 (10:37 +0100)
refs #10963

lib/icinga/checkable-check.cpp

index 6272153a928a7fcc3045e15f6543c05d5c2f8a65..3068c984707dede81cc0e1a103e3a57fdb74335c 100644 (file)
@@ -451,6 +451,10 @@ void Checkable::ExecuteCheck(void)
                        if (listener)
                                listener->SyncSendMessage(endpoint, message);
 
+                       /* Re-schedule the check so we don't run it again until after we've received
+                          a check result from the remote instance. The check will be re-scheduled
+                          using the proper check interval once we've received a check result. */
+                       SetNextCheck(Utility::GetTime() + GetCheckCommand()->GetTimeout() + 30);
                } else if (Application::GetInstance()->GetStartTime() < Utility::GetTime() - 30) {
                        /* fail to perform check on unconnected endpoint */
                        cr->SetState(ServiceUnknown);