diff --git a/lib/methods/pluginchecktask.cpp b/lib/methods/pluginchecktask.cpp index 1a3df8105..1f851f9da 100644 --- a/lib/methods/pluginchecktask.cpp +++ b/lib/methods/pluginchecktask.cpp @@ -14,10 +14,10 @@ using namespace icinga; -REGISTER_FUNCTION_NONCONST(Internal, PluginCheck, &PluginCheckTask::ScriptFunc, "checkable:cr:resolvedMacros:useResolvedMacros"); +REGISTER_FUNCTION_NONCONST(Internal, PluginCheck, &PluginCheckTask::ScriptFunc, "checkable:cr:producer:resolvedMacros:useResolvedMacros"); void PluginCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, - const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros) + const CheckResultProducer::Ptr& producer, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros) { REQUIRE_NOT_NULL(checkable); REQUIRE_NOT_NULL(cr); @@ -48,8 +48,8 @@ void PluginCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes if (Checkable::ExecuteCommandProcessFinishedHandler) { callback = Checkable::ExecuteCommandProcessFinishedHandler; } else { - callback = [checkable, cr](const Value& commandLine, const ProcessResult& pr) { - ProcessFinishedHandler(checkable, cr, commandLine, pr); + callback = [checkable, cr, producer](const Value& commandLine, const ProcessResult& pr) { + ProcessFinishedHandler(checkable, cr, producer, commandLine, pr); }; } @@ -62,7 +62,8 @@ void PluginCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes } } -void PluginCheckTask::ProcessFinishedHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, const Value& commandLine, const ProcessResult& pr) +void PluginCheckTask::ProcessFinishedHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, + const CheckResultProducer::Ptr& producer, const Value& commandLine, const ProcessResult& pr) { Checkable::CurrentConcurrentChecks.fetch_sub(1); Checkable::DecreasePendingChecks(); @@ -93,5 +94,5 @@ void PluginCheckTask::ProcessFinishedHandler(const Checkable::Ptr& checkable, co cr->SetExecutionStart(pr.ExecutionStart); cr->SetExecutionEnd(pr.ExecutionEnd); - checkable->ProcessCheckResult(cr); + checkable->ProcessCheckResult(cr, producer); } diff --git a/lib/methods/pluginchecktask.hpp b/lib/methods/pluginchecktask.hpp index a4fc3a385..6276d8609 100644 --- a/lib/methods/pluginchecktask.hpp +++ b/lib/methods/pluginchecktask.hpp @@ -19,13 +19,13 @@ class PluginCheckTask { public: static void ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr, - const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros); + const CheckResultProducer::Ptr& producer, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros); private: PluginCheckTask(); - static void ProcessFinishedHandler(const Checkable::Ptr& service, - const CheckResult::Ptr& cr, const Value& commandLine, const ProcessResult& pr); + static void ProcessFinishedHandler(const Checkable::Ptr& service, const CheckResult::Ptr& cr, + const CheckResultProducer::Ptr& producer, const Value& commandLine, const ProcessResult& pr); }; }