Update documentation for optional arguments and add old updated command config

See https://www.icinga.com/docs/icinga2/latest/doc/03-monitoring-basics/#notification-commands-in-27

refs #5474
This commit is contained in:
Michael Friedrich 2017-08-14 17:09:44 +02:00
parent 57a092fc2a
commit ccd10bef57
2 changed files with 54 additions and 2 deletions

View 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$`.

View 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$"
}
}
*/