]> granicus.if.org Git - icinga2/commitdiff
Update documentation for optional arguments and add old updated command config
authorMichael Friedrich <michael.friedrich@icinga.com>
Mon, 14 Aug 2017 15:09:44 +0000 (17:09 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Mon, 14 Aug 2017 15:22:52 +0000 (17:22 +0200)
See https://www.icinga.com/docs/icinga2/latest/doc/03-monitoring-basics/#notification-commands-in-27

refs #5474

doc/03-monitoring-basics.md
etc/icinga2/conf.d/commands.conf

index 293aabdd6d632a772b472d34e7887a2118f53be6..eb8b6c197fbf50063767c144c42b76f8dd79fd10 100644 (file)
@@ -1690,7 +1690,6 @@ information.
 
   Name                           | Description
   -------------------------------|---------------------------------------
-  `notification_address`         | **Required.** The host's IPv4 address. Defaults to `$address$`.
   `notification_date`            | **Required.** Date and time. Defaults to `$icinga.long_date_time$`.
   `notification_hostname`        | **Required.** The host's `FQDN`. Defaults to `$host.name$`.
   `notification_hostdisplayname` | **Required.** The host's display name. Defaults to `$host.display_name$`.
@@ -1698,6 +1697,7 @@ information.
   `notification_useremail`       | **Required.** The notification's recipient(s). Defaults to `$user.email$`.
   `notification_hoststate`       | **Required.** Current state of host. Defaults to `$host.state$`.
   `notification_type`            | **Required.** Type of notification. Defaults to `$notification.type$`.
+  `notification_address`         | **Optional.** The host's IPv4 address. Defaults to `$address$`.
   `notification_address6`        | **Optional.** The host's IPv6 address. Defaults to `$address6$`.
   `notification_author`          | **Optional.** Comment author. Defaults to `$notification.author$`.
   `notification_comment`         | **Optional.** Comment text. Defaults to `$notification.comment$`.
@@ -1716,7 +1716,6 @@ information.
 
   Name                              | Description
   ----------------------------------|---------------------------------------
-  `notification_address`            | **Required.** The host's IPv4 address. Defaults to `$address$`.
   `notification_date`               | **Required.** Date and time. Defaults to `$icinga.long_date_time$`.
   `notification_hostname`           | **Required.** The host's `FQDN`. Defaults to `$host.name$`.
   `notification_servicename`        | **Required.** The service name. Defaults to `$service.name$`.
@@ -1726,6 +1725,7 @@ information.
   `notification_useremail`          | **Required.** The notification's recipient(s). Defaults to `$user.email$`.
   `notification_servicestate`       | **Required.** Current state of host. Defaults to `$service.state$`.
   `notification_type`               | **Required.** Type of notification. Defaults to `$notification.type$`.
+  `notification_address`            | **Optional.** The host's IPv4 address. Defaults to `$address$`.
   `notification_address6`           | **Optional.** The host's IPv6 address. Defaults to `$address6$`.
   `notification_author`             | **Optional.** Comment author. Defaults to `$notification.author$`.
   `notification_comment`            | **Optional.** Comment text. Defaults to `$notification.comment$`.
index 11bfa8266cc486e4abe9b81f795350867b0ed59d..9c5153811a7d4aee4cfbd41399ff56ec78447d81 100644 (file)
@@ -133,3 +133,55 @@ object NotificationCommand "mail-service-notification" {
     notification_servicedisplayname = "$service.display_name$"
   }
 }
+
+/*
+ * If you prefer to use the notification scripts with environment
+ * variables instead of command line parameters, you can use
+ * the following commands. They have been updated from < 2.7
+ * to support the new notification scripts and should help
+ * with an upgrade.
+ * Remove the comment blocks and comment the notification commands above.
+ */
+
+/*
+
+object NotificationCommand "mail-host-notification" {
+  command = [ SysconfDir + "/icinga2/scripts/mail-host-notification.sh" ]
+
+  env = {
+    NOTIFICATIONTYPE = "$notification.type$"
+    HOSTDISPLAYNAME = "$host.display_name$"
+    HOSTNAME = "$host.name$"
+    HOSTADDRESS = "$address$"
+    HOSTSTATE = "$host.state$"
+    LONGDATETIME = "$icinga.long_date_time$"
+    HOSTOUTPUT = "$host.output$"
+    NOTIFICATIONAUTHORNAME = "$notification.author$"
+    NOTIFICATIONCOMMENT = "$notification.comment$"
+    HOSTDISPLAYNAME = "$host.display_name$"
+    USEREMAIL = "$user.email$"
+  }
+}
+
+object NotificationCommand "mail-service-notification" {
+  command = [ SysconfDir + "/icinga2/scripts/mail-service-notification.sh" ]
+
+  env = {
+    NOTIFICATIONTYPE = "$notification.type$"
+    SERVICENAME = "$service.name$"
+    HOSTNAME = "$host.name$"
+    HOSTDISPLAYNAME = "$host.display_name$"
+    HOSTADDRESS = "$address$"
+    SERVICESTATE = "$service.state$"
+    LONGDATETIME = "$icinga.long_date_time$"
+    SERVICEOUTPUT = "$service.output$"
+    NOTIFICATIONAUTHORNAME = "$notification.author$"
+    NOTIFICATIONCOMMENT = "$notification.comment$"
+    HOSTDISPLAYNAME = "$host.display_name$"
+    SERVICEDISPLAYNAME = "$service.display_name$"
+    USEREMAIL = "$user.email$"
+  }
+}
+
+*/
+