2019-02-25 08:48:22 -05:00
|
|
|
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
2013-06-13 05:33:00 -04:00
|
|
|
|
2014-05-25 10:23:35 -04:00
|
|
|
#include "methods/nulleventtask.hpp"
|
2015-01-21 02:47:45 -05:00
|
|
|
#include "base/function.hpp"
|
2014-10-19 08:21:12 -04:00
|
|
|
#include "base/logger.hpp"
|
2013-06-13 05:33:00 -04:00
|
|
|
|
|
|
|
|
using namespace icinga;
|
|
|
|
|
|
2018-08-07 07:55:41 -04:00
|
|
|
REGISTER_FUNCTION_NONCONST(Internal, NullEvent, &NullEventTask::ScriptFunc, "checkable:resolvedMacros:useResolvedMacros");
|
2013-06-13 05:33:00 -04:00
|
|
|
|
2018-01-30 05:26:07 -05:00
|
|
|
void NullEventTask::ScriptFunc(const Checkable::Ptr& checkable, const Dictionary::Ptr& resolvedMacros, bool useResolvedMacros)
|
|
|
|
|
{
|
2018-02-21 07:42:58 -05:00
|
|
|
REQUIRE_NOT_NULL(checkable);
|
2020-07-21 02:33:43 -04: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 05:26:07 -05:00
|
|
|
}
|