diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp index 4464a0e9b..c82756b50 100644 --- a/lib/icinga/checkable-check.cpp +++ b/lib/icinga/checkable-check.cpp @@ -551,7 +551,7 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr return Result::Ok; } -void Checkable::ExecuteRemoteCheck(const Dictionary::Ptr& resolvedMacros) +void Checkable::ExecuteRemoteCheck(const ApiListener::Ptr& listener, const Dictionary::Ptr& resolvedMacros) { CONTEXT("Executing remote check for object '" << GetName() << "'"); @@ -562,7 +562,7 @@ void Checkable::ExecuteRemoteCheck(const Dictionary::Ptr& resolvedMacros) cr->SetScheduleStart(scheduled_start); cr->SetExecutionStart(before_check); - GetCheckCommand()->Execute(this, cr, resolvedMacros, true); + GetCheckCommand()->Execute(this, cr, listener, resolvedMacros, true); } void Checkable::ExecuteCheck(const CheckResultProducer::Ptr& producer) diff --git a/lib/icinga/checkable.hpp b/lib/icinga/checkable.hpp index 8c14c055e..667e35146 100644 --- a/lib/icinga/checkable.hpp +++ b/lib/icinga/checkable.hpp @@ -12,6 +12,7 @@ #include "icinga/notification.hpp" #include "icinga/comment.hpp" #include "icinga/downtime.hpp" +#include "remote/apilistener.hpp" #include "remote/crproducer.hpp" #include "remote/endpoint.hpp" #include "remote/messageorigin.hpp" @@ -111,7 +112,7 @@ public: static void UpdateStatistics(const CheckResult::Ptr& cr, CheckableType type); - void ExecuteRemoteCheck(const Dictionary::Ptr& resolvedMacros = nullptr); + void ExecuteRemoteCheck(const ApiListener::Ptr& listener, const Dictionary::Ptr& resolvedMacros = nullptr); void ExecuteCheck(const CheckResultProducer::Ptr& producer); enum class ProcessingResult diff --git a/lib/icinga/clusterevents-check.cpp b/lib/icinga/clusterevents-check.cpp index 40325b4c0..dc09f514e 100644 --- a/lib/icinga/clusterevents-check.cpp +++ b/lib/icinga/clusterevents-check.cpp @@ -279,7 +279,7 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons if (command_type == "check_command") { try { - host->ExecuteRemoteCheck(macros); + host->ExecuteRemoteCheck(ApiListener::GetInstance(), macros); } catch (const std::exception& ex) { String output = "Exception occurred while checking '" + host->GetName() + "': " + DiagnosticInformation(ex); ServiceState state = ServiceUnknown;