From eb20b7e33e039751ad7b2f7924c276678769b0a7 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 12 Sep 2013 10:36:50 +0200 Subject: [PATCH] Update test check output. --- lib/icinga/nullchecktask.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/icinga/nullchecktask.cpp b/lib/icinga/nullchecktask.cpp index 55ee2b29a..885e38e1f 100644 --- a/lib/icinga/nullchecktask.cpp +++ b/lib/icinga/nullchecktask.cpp @@ -28,8 +28,16 @@ REGISTER_SCRIPTFUNCTION(NullCheck, &NullCheckTask::ScriptFunc); Dictionary::Ptr NullCheckTask::ScriptFunc(const Service::Ptr&) { + char name[255]; + + if (gethostname(name, sizeof(name)) < 0) + strcpy(name, ""); + + String output = "Hello from "; + output += name; + Dictionary::Ptr cr = boost::make_shared(); - cr->Set("output", "This is a test."); + cr->Set("output", output); cr->Set("state", StateOK); return cr;