2019-02-25 14:48:22 +01:00
|
|
|
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
2013-06-13 11:33:00 +02:00
|
|
|
|
2014-05-25 16:23:35 +02:00
|
|
|
#include "methods/nulleventtask.hpp"
|
2015-01-21 08:47:45 +01:00
|
|
|
#include "base/function.hpp"
|
2014-10-19 14:21:12 +02:00
|
|
|
#include "base/logger.hpp"
|
2013-06-13 11:33:00 +02:00
|
|
|
|
|
|
|
using namespace icinga;
|
|
|
|
|
2018-08-07 13:55:41 +02:00
|
|
|
REGISTER_FUNCTION_NONCONST(Internal, NullEvent, &NullEventTask::ScriptFunc, "checkable:resolvedMacros:useResolvedMacros");
|
2013-06-13 11:33:00 +02:00
|
|
|
|
2018-01-30 11:26:07 +01:00
|
|
|
void NullEventTask::ScriptFunc(const Checkable::Ptr& checkable, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
|
|
|
|
{
|
2018-02-21 13:42:58 +01:00
|
|
|
REQUIRE_NOT_NULL(checkable);
|
2020-07-21 08:33:43 +02:00
|
|
|
|
|
|
|
if (Checkable::ExecuteCommandProcessFinishedHandler) {
|
|
|
|
double now = Utility::GetTime();
|
|
|
|
ProcessResult pr;
|
|
|
|
pr.PID = -1;
|
|
|
|
pr.Output = "";
|
|
|
|
pr.ExecutionStart = now;
|
|
|
|
pr.ExecutionEnd = now;
|
|
|
|
pr.ExitStatus = 0;
|
|
|
|
|
|
|
|
Checkable::ExecuteCommandProcessFinishedHandler("", pr);
|
|
|
|
}
|
2018-01-30 11:26:07 +01:00
|
|
|
}
|