]> granicus.if.org Git - icinga2/commitdiff
Update test check output.
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 12 Sep 2013 08:36:50 +0000 (10:36 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 12 Sep 2013 08:36:50 +0000 (10:36 +0200)
lib/icinga/nullchecktask.cpp

index 55ee2b29aff744501dc38ca550177bdf89e582c5..885e38e1fae008e5af92c3a9824f1fbfbe5c1e97 100644 (file)
@@ -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, "<unknown host>");
+
+       String output = "Hello from ";
+       output += name;
+
        Dictionary::Ptr cr = boost::make_shared<Dictionary>();
-       cr->Set("output", "This is a test.");
+       cr->Set("output", output);
        cr->Set("state", StateOK);
 
        return cr;