From bd7d7ef84560f250aa6bccb8393a945d61783fd1 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Tue, 8 Aug 2017 12:10:29 +0200 Subject: [PATCH] Docs: Add a note on required configuration updates for new notification scripts in v2.7.0 --- CHANGELOG.md | 2 +- doc/03-monitoring-basics.md | 47 +++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d121ca11..c7e2c34f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Notes -* New mail notification scripts +* New mail notification scripts. Please note that this requires a configuration update to NotificationCommand objects, Notification apply rules for specific settings and of course the notification scripts. More can be found [here](https://github.com/Icinga/icinga2/pull/5475). * check_nscp_api plugin for NSClient++ REST API checks * Work queues for features including logs & metrics * More metrics for the "icinga" check diff --git a/doc/03-monitoring-basics.md b/doc/03-monitoring-basics.md index 317a6ab37..5dd53c5ce 100644 --- a/doc/03-monitoring-basics.md +++ b/doc/03-monitoring-basics.md @@ -1581,6 +1581,53 @@ defaults can always be overwritten locally. > This example requires the `mail` binary installed on the Icinga 2 > master. +#### Notification Commands in 2.7 + +Icinga 2 v2.7.0 introduced new notification scripts which support both +environment variables and command line parameters. + +Therefore the `NotificationCommand` objects inside the [commands.conf](04-configuring-icinga-2.md#commands-conf) +and `Notification` apply rules inside the [notifications.conf](04-configuring-icinga-2.md#notifications-conf) +configuration files have been updated. Your configuration needs to be +updated next to the notification scripts themselves. + +> **Note** +> +> Several parameters have been changed. Please review the notification +> script parameters and configuration objects before updating your production +> environment. + +The safest way is to incorporate the configuration updates from +v2.7.0 inside the [commands.conf](04-configuring-icinga-2.md#commands-conf) and [notifications.conf](04-configuring-icinga-2.md#notifications-conf) +configuration files. + +A quick-fix is shown below: + +@@ -5,7 +5,8 @@ object NotificationCommand "mail-host-notification" { + + env = { + NOTIFICATIONTYPE = "$notification.type$" +- HOSTALIAS = "$host.display_name$" ++ HOSTNAME = "$host.name$" ++ HOSTDISPLAYNAME = "$host.display_name$" + HOSTADDRESS = "$address$" + HOSTSTATE = "$host.state$" + LONGDATETIME = "$icinga.long_date_time$" +@@ -22,8 +23,9 @@ object NotificationCommand "mail-service-notification" { + + env = { + NOTIFICATIONTYPE = "$notification.type$" +- SERVICEDESC = "$service.name$" +- HOSTALIAS = "$host.display_name$" ++ SERVICENAME = "$service.name$" ++ HOSTNAME = "$host.name$" ++ HOSTDISPLAYNAME = "$host.display_name$" + HOSTADDRESS = "$address$" + SERVICESTATE = "$service.state$" + LONGDATETIME = "$icinga.long_date_time$" +``` + + #### mail-host-notification The `mail-host-notification` NotificationCommand object uses the