
object NotificationCommand "Service Alarm By Email" { import "plugin-notification-command" command = [ "/etc/icinga2/scripts/service-by-mail.sh" ] arguments += { "-4" = { required = true value = "$address$" } "-6" = "$address6$" "-b" = "$notification.author$" "-c" = "$notification.comment$" "-d" = { required = true value = "$icinga.long_date_time$" } "-e" = { required = true value = "$service.name$" } "-f" = "$notification_from$" "-i" = "$icingaweb2url$" "-l" = { required = true value = "$host.name$" } "-n" = { required = true value = "$host.display_name$" } "-o" = { required = true value = "$service.output$" } "-r" = { required = true value = "$user.email$" } "-s" = { required = true value = "$service.state$" } "-t" = "$notification.type$" "-u" = { required = true value = "$service.display_name$" } "-v" = "$notification_logtosyslog$" } }
35 Comments
Thank you for this tutorial. I don’t understand how to import the icinga command into the director. I add my notification command to the file „commands.conf“ but it doesn’t appear in the commands.
I try to add the command through the interface but it does not allow to provide arguments.
Please help
Hi Bastien,
when you add entries to commands.conf, Director does not know about them; so you have to re-run the Director kickstart. I would suggest you to add the command and its arguments via Director: first add the command itself and store it, and then add arguments and data fields as needed (once stored, there appears a tab for them).
HTH,
Marianne