Icinga2-teams-adaptive-notifications

A script for icinga2 to send alerts to MS teams

icinga2-teams-notification

This is a adaptive version of:

Which is based on:

This is trying to get back to be more in line with the slack alerts.

Limitation / ToDo

Code in markdown seems to be unsupported?

Preview

Sample Notification Preview

Features

  1. Colored Notifications for states like OK, Warning, Critical etc.
  2. Includes raw plugin outputs.(known to be broken in adaptice cards)
  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 Teams endpoints
  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).
  9. Emoticons!
  10. Mobile app support (Note: this is way better for adaptive cards than MessageCard's by default.)

Installation and Basic Configuration

  1. Copy the /configuration/master_* files to /etc/icinga2/conf.d/ or /etc/icinga2/zones.d/global-templates/ directory (depending on architecture)
  2. Modify the vars.teams_notifications_icinga2_base_url in the master_teams_config.conf with your IcingaWeb2 Base URL. This is to jump to Alert Dashboard right from Teams channel.
  3. Configure the existing host or service configuration like the provided one in the /configuration/host_sample.conf
  4. Get the webhook_url of the Teams Channel 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 color can be changed in the array variable vars.teams_notifications_color using the supported card colors Documentation.
  2. Notifications for Scheduled DOWNTIME alerts are disabled by default. It can be enabled in the variable types