From 50be889b75116ae5b36ea9113e79649df16c6986 Mon Sep 17 00:00:00 2001 From: Tobias Wiese Date: Mon, 11 May 2020 20:35:04 +0200 Subject: notifications: Notify via email and telegram Provide notification in case of a state change via email and telegram bot. The telegram bot is especially helpful in cases where a problem with email delivery is to be reportet. Signed-off-by: Tobias Wiese --- zones.d/master/notifications.conf | 72 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 zones.d/master/notifications.conf (limited to 'zones.d/master/notifications.conf') diff --git a/zones.d/master/notifications.conf b/zones.d/master/notifications.conf new file mode 100644 index 0000000..b980851 --- /dev/null +++ b/zones.d/master/notifications.conf @@ -0,0 +1,72 @@ +template Notification "generic-notification" { + types = [ + Problem, + Acknowledgement, + Recovery, + Custom, + FlappingStart, + FlappingEnd, + ] +} + +template Notification "generic-host-notification" { + import "generic-notification" + states = [ Up, Down ] +} + +template Notification "generic-service-notification" { + import "generic-notification" + states = [ OK, Warning, Critical, Unknown ] +} + +apply Notification "mail" to Host { + import "generic-host-notification" + + command = "mail-host-notification" + + user_groups = host.vars.notification.mail.groups + users = host.vars.notification.mail.users + + interval = 2h + + assign where host.vars.notification.mail +} + +apply Notification "mail" to Service { + import "generic-service-notification" + + command = "mail-service-notification" + + user_groups = host.vars.notification.mail.groups + users = host.vars.notification.mail.users + + interval = 2h + + assign where host.vars.notification.mail +} + +apply Notification "telegram" to Host { + import "generic-host-notification" + + command = "telegram-host-notification" + + user_groups = host.vars.notification.telegram.groups + users = host.vars.notification.telegram.users + + interval = 2h + + assign where host.vars.notification.telegram +} + +apply Notification "telegram" to Service { + import "generic-service-notification" + + command = "telegram-service-notification" + + user_groups = host.vars.notification.telegram.groups + users = host.vars.notification.telegram.users + + interval = 2h + + assign where host.vars.notification.telegram +} -- cgit v1.2.3