diff --git a/icinga_template.conf b/icinga_template.conf new file mode 100644 index 0000000..d5005e1 --- /dev/null +++ b/icinga_template.conf @@ -0,0 +1,23 @@ +template NotificationCommand "jabber-template" { + import "plugin-notification-command" + command = [ + "/etc/icinga2/scripts/xmpp-notification.py", # fill in the path to the script + "$xmpp_recipient$", + "$xmpp_message$" + ] + vars.xmpp_recipient = "$jabberid$" + env = { + XMPP_USER = "$xmpp_user$" + XMPP_PASSWORD = "$xmpp_password$" + } +} + +template NotificationCommand "jabber-host-notification" { + import "jabber-template" + vars.xmpp_message = {{{$notification.type$|$host.display_name$|$host.state$|$host.output$|$notification.author$|$notification.comment$}}} +} + +template NotificationCommand "jabber-service-notification" { + import "jabber-template" + vars.xmpp_message = {{{$notification.type$|$host.display_name$/$service.name$|$service.state$|$service.output$|$notification.author$|$notification.comment$}}} +}