[icinga-checkins] icinga.org: icingaweb2-module-director/master: IcingaObject(legacy): Render check_command with ARGn from customvars

git at icinga.org git at icinga.org
Thu Nov 3 14:23:27 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: 6b9d23cdd5ded46299758fc87c2d6f707c8bf83e
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=6b9d23cdd5ded46299758fc87c2d6f707c8bf83e

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Thu Nov  3 13:40:37 2016 +0100

IcingaObject(legacy): Render check_command with ARGn from customvars

refs #12919

---

 library/Director/Objects/IcingaObject.php |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php
index 9e0717e..899d299 100644
--- a/library/Director/Objects/IcingaObject.php
+++ b/library/Director/Objects/IcingaObject.php
@@ -1975,6 +1975,19 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
         );
     }
 
+    protected function renderLegacyCheck_command($value)
+    {
+        $args = array();
+        foreach($this->vars() as $k => $v) {
+            if (substr($k, 0, 3) == 'ARG') {
+                $args[] = $v->getValue();
+            }
+        }
+
+        array_unshift($args, $this->get('check_command'));
+        return c1::renderKeyValue('check_command', join('!', $args));
+    }
+
     /**
      * We do not render zone properties, objects are stored to zone dirs
      *



More information about the icinga-checkins mailing list