From f48e41bd4b64e2a58c74917c6434e00d04b8bb5b Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Mon, 7 Feb 2022 20:30:56 +0100 Subject: [PATCH] v2.0 --- icinga_template.conf | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 icinga_template.conf 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$}}} +}