]> granicus.if.org Git - icinga2/commitdiff
Implement HOSTADDRESS and HOSTADDRESS6 macros.
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 2 Jul 2013 07:47:31 +0000 (09:47 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 2 Jul 2013 07:47:31 +0000 (09:47 +0200)
lib/icinga/host.cpp

index 0d6381682a784cee30d19cc10b03497af00832ac..27f069d0216b8f75a59b65da9d71f036fc4b2363 100644 (file)
@@ -610,9 +610,18 @@ bool Host::ResolveMacro(const String& macro, const Dictionary::Ptr&, String *res
 
        Dictionary::Ptr macros = GetMacros();
 
-       if (macros && macros->Contains(macro)) {
-               *result = macros->Get(macro);
-               return true;
+       if (macros) {
+               String name = macro;
+
+               if (name == "HOSTADDRESS")
+                       name = "address";
+               else if (macro == "HOSTADDRESS6")
+                       name = "address6";
+
+               if (macros->Contains(name)) {
+                       *result = macros->Get(name);
+                       return true;
+               }
        }
 
        return false;