[icinga-checkins] icinga.org: icinga2-migration/master: add `vars.USER1 = PluginDir` command template mapping

git at icinga.org git at icinga.org
Sun Jun 15 01:56:17 CEST 2014


Module: icinga2-migration
Branch: master
Commit: a0ee61c04ed7bebf6dba3af205e70c077f577115
URL:    https://git.icinga.org/?p=icinga2-migration.git;a=commit;h=a0ee61c04ed7bebf6dba3af205e70c077f577115

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Sun Jun 15 01:45:30 2014 +0200

add `vars.USER1 = PluginDir` command template mapping

---

 .../library/Conftool/Icinga2/Icinga2Command.php    |    2 ++
 .../Conftool/Icinga2/Icinga2ObjectDefinition.php   |   21 ++++++++++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/modules/conftool/library/Conftool/Icinga2/Icinga2Command.php b/modules/conftool/library/Conftool/Icinga2/Icinga2Command.php
index 43fc735..3cd2b30 100644
--- a/modules/conftool/library/Conftool/Icinga2/Icinga2Command.php
+++ b/modules/conftool/library/Conftool/Icinga2/Icinga2Command.php
@@ -44,6 +44,8 @@ class Icinga2Command extends Icinga2ObjectDefinition
 	$line = $this->migrateLegacyMacros($line);
 
         $this->properties['command'] = "\"".$line."\"";
+
+	$this->imports[] = "migration-check-command";
         return $line;
     }
 }
diff --git a/modules/conftool/library/Conftool/Icinga2/Icinga2ObjectDefinition.php b/modules/conftool/library/Conftool/Icinga2/Icinga2ObjectDefinition.php
index 27f25f6..122fa25 100644
--- a/modules/conftool/library/Conftool/Icinga2/Icinga2ObjectDefinition.php
+++ b/modules/conftool/library/Conftool/Icinga2/Icinga2ObjectDefinition.php
@@ -760,7 +760,7 @@ class Icinga2ObjectDefinition
         $str = '';
         foreach ($this->eventcommands as $command => $line) {
             $str .= sprintf("\nobject EventCommand \"%s\" {\n", $command);
-            $str .= sprintf("    import \"plugin-event-command\"\n");
+            $str .= sprintf("    import \"migration-event-command\"\n");
             $str .= sprintf("    command = \"%s\"\n", $line);
             $str .= sprintf("}\n");
         }
@@ -771,7 +771,7 @@ class Icinga2ObjectDefinition
         $str = '';
         foreach ($this->notificationcommands as $command => $line) {
             $str .= sprintf("\nobject NotificationCommand \"%s\" {\n", $command);
-            $str .= sprintf("    import \"plugin-notification-command\"\n");
+            $str .= sprintf("    import \"migration-notification-command\"\n");
             $str .= sprintf("    command = \"%s\"\n", $line);
             $str .= sprintf("}\n\n");
         }
@@ -958,6 +958,23 @@ object NotificationCommand "generic-escalation-dummy" {
     import "plugin-notification-command"
     command = "echo \"This escalation needs a proper notification command. Please FIXME.\""
 }
+
+object CheckCommand "migration-check-command" {
+    import "plugin-check-command"
+    vars.USER1 = PluginDir
+}
+
+object EventCommand "migration-event-command" {
+    import "plugin-event-command"
+    vars.USER1 = PluginDir
+}
+
+object NotificationCommand "migration-notification-command" {
+    import "plugin-notification-command"
+    vars.USER1 = PluginDir
+}
+
+
 //MIGRATION DEFAULT TEMPLATES -- END
 
 ');



More information about the icinga-checkins mailing list