https://github.com/rwaffen/icinga2-html-notifications
HTML Notifications for Icinga2
https://github.com/rwaffen/icinga2-html-notifications
icinga2 mail ruby script
Last synced: about 1 year ago
JSON representation
HTML Notifications for Icinga2
- Host: GitHub
- URL: https://github.com/rwaffen/icinga2-html-notifications
- Owner: rwaffen
- License: bsd-3-clause
- Created: 2017-03-02T12:28:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-02T12:45:43.000Z (over 9 years ago)
- Last Synced: 2025-03-28T18:54:45.514Z (about 1 year ago)
- Topics: icinga2, mail, ruby, script
- Language: Ruby
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# icinga2-html-notifications
HTML Notifications for Icinga2
Add ``mail-host.rb`` and ``mail-service.rb`` to ``/etc/icinga2/scripts``.
Update the Icinga2 definition of the Mail Command in ``/etc/icinga2/conf.d/commands.conf``.
Mail Script for Hosts
```
/* Command objects */
object NotificationCommand "mail-host-notification" {
import "plugin-notification-command"
command = [ SysconfDir + "/icinga2/scripts/mail-host.rb" ]
env = {
NOTIFICATIONTYPE = "$notification.type$"
HOSTALIAS = "$host.display_name$"
HOSTADDRESS = "$address$"
HOSTNAME = "$host.name$"
HOSTSTATE = "$host.state$"
LONGDATETIME = "$icinga.long_date_time$"
HOSTOUTPUT = "$host.output$"
NOTIFICATIONAUTHORNAME = "$notification.author$"
NOTIFICATIONCOMMENT = "$notification.comment$"
HOSTDISPLAYNAME = "$host.display_name$"
USEREMAIL = "$user.email$"
ICINGA2_HOST = "icinga2.example.com"
ZONE = "$host.zone$"
}
}
```
Mail Script for Services
```
object NotificationCommand "mail-service-notification" {
import "plugin-notification-command"
command = [ SysconfDir + "/icinga2/scripts/mail-service.rb" ]
env = {
NOTIFICATIONTYPE = "$notification.type$"
SERVICEDESC = "$service.name$"
HOSTALIAS = "$host.display_name$"
HOSTADDRESS = "$address$"
HOSTNAME = "$host.name$"
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$"
ICINGA2_HOST = "icinga2.example.com"
ZONE = "$host.zone$"
}
}
```