File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -623,12 +623,16 @@ void Checkable::ExecuteCheck()
623
623
if (service)
624
624
params->Set (" service" , service->GetShortName ());
625
625
626
+ double checkTimeout = GetCheckCommand ()->GetTimeout ();
627
+
626
628
/*
627
629
* If the host/service object specifies the 'check_timeout' attribute,
628
630
* forward this to the remote endpoint to limit the command execution time.
629
631
*/
630
- if (!GetCheckTimeout ().IsEmpty ())
631
- params->Set (" check_timeout" , GetCheckTimeout ());
632
+ if (auto ckCheckTimeout (GetCheckTimeout ()); !ckCheckTimeout.IsEmpty ()) {
633
+ checkTimeout = Convert::ToDouble (ckCheckTimeout);
634
+ params->Set (" check_timeout" , ckCheckTimeout);
635
+ }
632
636
633
637
params->Set (" macros" , macros);
634
638
@@ -641,7 +645,7 @@ void Checkable::ExecuteCheck()
641
645
* a check result from the remote instance. The check will be re-scheduled
642
646
* using the proper check interval once we've received a check result.
643
647
*/
644
- SetNextCheck (Utility::GetTime () + GetCheckCommand ()-> GetTimeout () + 30 );
648
+ SetNextCheck (Utility::GetTime () + checkTimeout + 30 );
645
649
646
650
/*
647
651
* Let the user know that there was a problem with the check if
You can’t perform that action at this time.
0 commit comments