[icinga-checkins] icinga.org: icinga2/master: configconvert: notification* attributes for services and users

git at icinga.org git at icinga.org
Wed Jun 26 09:23:27 CEST 2013


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

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Tue Jun 25 17:59:30 2013 +0200

configconvert: notification* attributes for services and users

refs #2743

---

 tools/configconvert/Icinga2/ExportIcinga2Cfg.pm |   29 +++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/tools/configconvert/Icinga2/ExportIcinga2Cfg.pm b/tools/configconvert/Icinga2/ExportIcinga2Cfg.pm
index 3fc2b47..a9fa589 100644
--- a/tools/configconvert/Icinga2/ExportIcinga2Cfg.pm
+++ b/tools/configconvert/Icinga2/ExportIcinga2Cfg.pm
@@ -380,6 +380,12 @@ sub dump_service_2x {
     if(defined($service_2x->{'notification_interval'})) {
         dump_config_line($icinga2_cfg, "\tnotification_interval = $service_2x->{'notification_interval'},");
     }
+    if(defined($service_2x->{'notifications_enabled'})) {
+        dump_config_line($icinga2_cfg, "\tnotifications_enabled = $service_2x->{'notifications_enabled'},");
+    }
+    if(defined($service_2x->{'notification_options'})) {
+        dump_config_line($icinga2_cfg, "\tnotification_options = \"$service_2x->{'notification_options'}\",");
+    }
 
     ####################################################
     # other service attributes, if set
@@ -536,6 +542,12 @@ sub dump_host_2x {
     if(defined($host_2x->{'notification_interval'})) {
         dump_config_line($icinga2_cfg, "\tnotification_interval = $host_2x->{'notification_interval'},");
     }
+    if(defined($host_2x->{'notifications_enabled'})) {
+        dump_config_line($icinga2_cfg, "\tnotifications_enabled = $host_2x->{'notifications_enabled'},");
+    }
+    if(defined($host_2x->{'notification_options'})) {
+        dump_config_line($icinga2_cfg, "\tnotification_options = \"$host_2x->{'notification_options'}\",");
+    }
 
     ####################################################
     # other host attributes, if set
@@ -686,6 +698,12 @@ sub dump_host_2x {
         if(defined($service_2x->{'notification_interval'})) {
             dump_config_line($icinga2_cfg, "\t\tnotification_interval = $service_2x->{'notification_interval'},");
         }
+        if(defined($service_2x->{'notifications_enabled'})) {
+            dump_config_line($icinga2_cfg, "\tnotifications_enabled = $service_2x->{'notifications_enabled'},");
+        }
+        if(defined($service_2x->{'notification_options'})) {
+            dump_config_line($icinga2_cfg, "\tnotification_options = \"$service_2x->{'notification_options'}\",");
+        }
 
         ####################################################
         # other service attributes, if set
@@ -769,6 +787,17 @@ sub dump_user_2x {
     dump_config_line($icinga2_cfg, "");
 
     ####################################################
+    # notifications
+    ####################################################
+
+    if(defined($user_2x->{'notification_options'})) {
+        dump_config_line($icinga2_cfg, "\tnotification_options = \"$user_2x->{'notification_options'}\",");
+    }
+    if(defined($user_2x->{'notification_period'})) {
+        dump_config_line($icinga2_cfg, "\tnotification_period = \"$user_2x->{'notification_period'}\",");
+    }
+
+    ####################################################
     # usergroups
     ####################################################
     if(defined($user_2x->{'usergroups'})) {





More information about the icinga-checkins mailing list