diff options
| author | Tobias Wiese <tobias@tobiaswiese.com> | 2020-05-11 20:35:04 +0200 |
|---|---|---|
| committer | Tobias Wiese <tobias@tobiaswiese.com> | 2020-05-11 20:35:04 +0200 |
| commit | 50be889b75116ae5b36ea9113e79649df16c6986 (patch) | |
| tree | 2c9304d31cfa916c7add63147878c1be542a6d6e /zones.d/master/notifications.conf | |
| parent | 4c255bd3feafb976e0030b699807d0bb8d3957a2 (diff) | |
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 <tobias@tobiaswiese.com>
Diffstat (limited to 'zones.d/master/notifications.conf')
| -rw-r--r-- | zones.d/master/notifications.conf | 72 |
1 files changed, 72 insertions, 0 deletions
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 +} |
