]> granicus.if.org Git - icinga2/commitdiff
Use NodeName instead of GetFQDN() in embedded checks
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 10 Dec 2015 14:27:49 +0000 (15:27 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 10 Dec 2015 14:28:48 +0000 (15:28 +0100)
fixes #10818

lib/methods/nullchecktask.cpp
lib/methods/randomchecktask.cpp

index cbbe27467b5c5a35a59a5dc23418c43dad3af47b..78d849ee2198688a76eb1d50a31067c75216b4e2 100644 (file)
@@ -22,6 +22,7 @@
 #endif /* _WIN32 */
 #include "methods/nullchecktask.hpp"
 #include "icinga/perfdatavalue.hpp"
+#include "icinga/icingaapplication.hpp"
 #include "base/utility.hpp"
 #include "base/convert.hpp"
 #include "base/function.hpp"
@@ -38,7 +39,7 @@ void NullCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult:
                return;
 
        String output = "Hello from ";
-       output += Utility::GetFQDN();
+       output += IcingaApplication::GetInstance()->GetNodeName();
 
        Array::Ptr perfdata = new Array();
        perfdata->Add(new PerfdataValue("time", Convert::ToDouble(Utility::GetTime())));
index 095c60f1b288414e02fd83f4cd5d5d3dd6f3685b..0af8928ff2ba18bb7c206955321dae09a78267c7 100644 (file)
@@ -22,6 +22,7 @@
 #endif /* _WIN32 */
 #include "methods/randomchecktask.hpp"
 #include "icinga/perfdatavalue.hpp"
+#include "icinga/icingaapplication.hpp"
 #include "base/utility.hpp"
 #include "base/convert.hpp"
 #include "base/function.hpp"
@@ -38,7 +39,7 @@ void RandomCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResul
                return;
 
        String output = "Hello from ";
-       output += Utility::GetFQDN();
+       output += IcingaApplication::GetInstance()->GetNodeName();
 
        Array::Ptr perfdata = new Array();
        perfdata->Add(new PerfdataValue("time", Convert::ToDouble(Utility::GetTime())));