2019-02-25 14:48:22 +01:00
|
|
|
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
2016-08-08 14:14:45 +02:00
|
|
|
|
|
|
|
#include "icinga/checkable.hpp"
|
|
|
|
#include "base/configobject.hpp"
|
|
|
|
#include "base/dictionary.hpp"
|
|
|
|
#include "base/function.hpp"
|
|
|
|
#include "base/functionwrapper.hpp"
|
|
|
|
#include "base/scriptframe.hpp"
|
|
|
|
|
|
|
|
using namespace icinga;
|
|
|
|
|
|
|
|
static void CheckableProcessCheckResult(const CheckResult::Ptr& cr)
|
|
|
|
{
|
|
|
|
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
|
|
|
|
Checkable::Ptr self = vframe->Self;
|
2018-02-21 13:42:58 +01:00
|
|
|
REQUIRE_NOT_NULL(self);
|
2016-08-08 14:14:45 +02:00
|
|
|
self->ProcessCheckResult(cr);
|
|
|
|
}
|
|
|
|
|
2018-01-04 04:25:35 +01:00
|
|
|
Object::Ptr Checkable::GetPrototype()
|
2016-08-08 14:14:45 +02:00
|
|
|
{
|
2018-01-11 11:17:38 +01:00
|
|
|
static Dictionary::Ptr prototype = new Dictionary({
|
|
|
|
{ "process_check_result", new Function("Checkable#process_check_result", CheckableProcessCheckResult, { "cr" }, false) }
|
|
|
|
});
|
2016-08-08 14:14:45 +02:00
|
|
|
|
|
|
|
return prototype;
|
|
|
|
}
|
|
|
|
|