mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
PluginCheckTask::ScriptFunc(): take CheckResultProducer::Ptr
This commit is contained in:
parent
fca4b185c1
commit
a14ac3f41e
@ -14,10 +14,10 @@
|
|||||||
|
|
||||||
using namespace icinga;
|
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,
|
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(checkable);
|
||||||
REQUIRE_NOT_NULL(cr);
|
REQUIRE_NOT_NULL(cr);
|
||||||
@ -48,8 +48,8 @@ void PluginCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes
|
|||||||
if (Checkable::ExecuteCommandProcessFinishedHandler) {
|
if (Checkable::ExecuteCommandProcessFinishedHandler) {
|
||||||
callback = Checkable::ExecuteCommandProcessFinishedHandler;
|
callback = Checkable::ExecuteCommandProcessFinishedHandler;
|
||||||
} else {
|
} else {
|
||||||
callback = [checkable, cr](const Value& commandLine, const ProcessResult& pr) {
|
callback = [checkable, cr, producer](const Value& commandLine, const ProcessResult& pr) {
|
||||||
ProcessFinishedHandler(checkable, cr, commandLine, 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::CurrentConcurrentChecks.fetch_sub(1);
|
||||||
Checkable::DecreasePendingChecks();
|
Checkable::DecreasePendingChecks();
|
||||||
@ -93,5 +94,5 @@ void PluginCheckTask::ProcessFinishedHandler(const Checkable::Ptr& checkable, co
|
|||||||
cr->SetExecutionStart(pr.ExecutionStart);
|
cr->SetExecutionStart(pr.ExecutionStart);
|
||||||
cr->SetExecutionEnd(pr.ExecutionEnd);
|
cr->SetExecutionEnd(pr.ExecutionEnd);
|
||||||
|
|
||||||
checkable->ProcessCheckResult(cr);
|
checkable->ProcessCheckResult(cr, producer);
|
||||||
}
|
}
|
||||||
|
@ -19,13 +19,13 @@ class PluginCheckTask
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void ScriptFunc(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
|
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:
|
private:
|
||||||
PluginCheckTask();
|
PluginCheckTask();
|
||||||
|
|
||||||
static void ProcessFinishedHandler(const Checkable::Ptr& service,
|
static void ProcessFinishedHandler(const Checkable::Ptr& service, const CheckResult::Ptr& cr,
|
||||||
const CheckResult::Ptr& cr, const Value& commandLine, const ProcessResult& pr);
|
const CheckResultProducer::Ptr& producer, const Value& commandLine, const ProcessResult& pr);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user