[icinga-checkins] icinga.org: icinga2/feature/magic: Fix $ido_name$ macro when using the IDO check type with command_endpoint

git at icinga.org git at icinga.org
Sun Aug 14 19:30:29 CEST 2016


Module: icinga2
Branch: feature/magic
Commit: c6e5f3dcb81d39f6b91babb7e91afd9bfc6e8ffb
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=c6e5f3dcb81d39f6b91babb7e91afd9bfc6e8ffb

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Sun Aug 14 19:27:35 2016 +0200

Fix $ido_name$ macro when using the IDO check type with command_endpoint

fixes #12428

---

 lib/db_ido/idochecktask.cpp |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/lib/db_ido/idochecktask.cpp b/lib/db_ido/idochecktask.cpp
index bcab7aa..049928e 100644
--- a/lib/db_ido/idochecktask.cpp
+++ b/lib/db_ido/idochecktask.cpp
@@ -55,6 +55,9 @@ void IdoCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult
 	String idoType = MacroProcessor::ResolveMacros("$ido_type$", resolvers, checkable->GetLastCheckResult(),
 	    NULL, MacroProcessor::EscapeCallback(), resolvedMacros, useResolvedMacros);
 
+	String idoName = MacroProcessor::ResolveMacros("$ido_name$", resolvers, checkable->GetLastCheckResult(),
+	    NULL, MacroProcessor::EscapeCallback(), resolvedMacros, useResolvedMacros);
+
 	if (resolvedMacros && !useResolvedMacros)
 		return;
 
@@ -65,12 +68,6 @@ void IdoCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult
 		return;
 	}
 
-	String idoName = MacroProcessor::ResolveMacros("$ido_name$", resolvers, checkable->GetLastCheckResult(),
-	    NULL, MacroProcessor::EscapeCallback(), resolvedMacros, useResolvedMacros);
-
-	if (resolvedMacros && !useResolvedMacros)
-		return;
-
 	if (idoName.IsEmpty()) {
 		cr->SetOutput("Macro 'ido_name' must be set.");
 		cr->SetState(ServiceUnknown);



More information about the icinga-checkins mailing list