icinga2-telegram-notification

Push Icinga2 notificaitons into Telegram groups or channel as bot

icinga2-telegram-notification

Push Icinga2 notificaitons into Telegram groups or channel as bot

This is an modified version of https://github.com/seffparker/icinga2-rich-slack-notification made compatible with Telegram Bot API.

Preview

Sample Notification Preview

Features

  1. Custom emoji for states like OK, Warning, Critical etc.
  2. Includes raw plugin outputs.
  3. Shows alert state-duration in human readable format.
  4. Shows comment with owner for Acknowledgement and Custom notifications.
  5. Can send notifications to multiple Telegram Channels or Groups
  6. The default re-notification interval can be changed.
  7. The re-notification interval can be customized per host or service.
  8. When the notification for a host is enabled, it will be inherited to all of its services checks, unless disabled for the specific service(s).

Installation and Basic Configuration

  1. Copy the two telegram-notification-* confs to /etc/icinga2/conf.d/ directory and configure the existing host or service configuration like the provided one in sample.conf
  2. Modify the vars.telegram_notifications_icinga2_base_url in telegram-notifications-configuration.conf with your IcingaWeb2 Base URL. This is to jump to Alert Dashboard right from Telegram channel.
  3. Modify the vars.telegram_notifications_webhook_url in telegram-notifications-configuration.conf with the AUTH_TOKEN of Telegram Bot
  4. Get the chat_id of the bot instance and add in to the object User section of required notification user(s). Read more here
  5. Validate the Icinga2 configuration and restart the service.

Advanced Configuration

  1. The notification emoji can be changed in the array variable vars.telegram_notifications_emoji array.
  2. Notifications for Scheduled DOWNTIME alerts are disabled by default. It can be enabled in the variable types