Icinga Integration Guide

This guide describes how to integrate your Icinga installation with PagerDuty using a simple Perl-based plugin. As Icinga is a fork of Nagios, we’ll be using PagerDuty’s built in support for Nagios for this integration. Note that you must be logged in as root to complete the installation. You might need to slightly alter these instructions depending on your exact Linux distribution and your Icinga configuration. If you are having trouble completing the installation, please contact us.

Looking for Icinga 2? Go here

Getting Started

If you don’t already have a PagerDuty “Icinga” service, you should create one:

In PagerDuty

        1. Go to the Services menu and select Service Directory.
        2. On the Service Directory page:
          • If you are creating a new service for your integration, click +New Service and follow the steps outlined, selecting this integration in step 4.
          • If you are adding your integration to an existing service, click the name of the service you want to add the integration to. Then click the Integrations tab and click Add a new integration.
        3. Under Select the integration(s) you use to send alerts to this service search and select this integration.
        4. Click the Add Service or Add Integration button to save your new integration. You will be redirected to the Integrations page for your service.
        5. Find the integration in the list, copy the Integration Key and keep it in a safe place for later use.

Setup

        1. Install the necessary Perl dependencies: For Debian, Ubuntu, and other Debian-derived systems:
          aptitude install libwww-perl libcrypt-ssleay-perl
          RHEL, Fedora, CentOS, and other Redhat-derived systems:
          yum install perl-libwww-perl perl-Crypt-SSLeay
        2. Download pagerduty_icinga.cfg from github
          wget https://raw.github.com/PagerDuty/pagerduty-icinga-pl/master/pagerduty_icinga.cfg
        3. Open the file in your favorite editor.
        4. Enter the integration key corresponding to your Nagios/Icinga service into the pager field. The integration key is a 32 character string that can be found on the service’s detail page.
        5. Copy the Icinga configuration file into place and change owner:
          cp pagerduty_icinga.cfg /usr/local/icinga/etc/objects
          chown icinga:icinga /usr/local/icinga/etc/objects/pagerduty_icinga.cfg
        6. Add the contact “pagerduty” to your Icinga configuration’s main contact group. If you’re using the default configuration, open /usr/local/icinga/etc/objects/contacts.cfg and look for the “admins” contact group. Then, simply add the “pagerduty” contact.
          define contactgroup{
               contactgroup_name admins
               alias Icinga Administrators
               members icingaadmin,pagerduty ; <-- Add 'pagerduty' here. 
          }
        7. Download pagerduty_icinga.pl from github and copy it to /usr/local/bin.
          wget https://raw.github.com/PagerDuty/pagerduty-icinga-pl/master/pagerduty_icinga.pl
          cp pagerduty_icinga.pl /usr/local/bin
        8. Make sure the file is executable by Icinga
          chmod 755 /usr/local/bin/pagerduty_icinga.pl
        9. Enable environment variable macros in /usr/local/icinga/icinga.cfg (if not enabled already)
          enable_environment_macros=1
        10. Edit the icinga user’s crontab
          crontab -u icinga -e
        11. Add the following line to the crontab
          * * * * * /usr/local/bin/pagerduty_icinga.pl flush
        12. Restart Icinga
          /etc/init.d/icinga restart

FAQ

What if a Icinga event happens while my network is down?

If a PagerDuty server can’t be reached for any reason, events will be stored to an on-disk queue. The installed cron job will attempt to re-send the events at one minute interval..

Since Icinga needs my external Internet connection to send failure reports to PagerDuty, how will I receive notification if our site loses external connectivity?

You should configure an external ping check service like Pingdom to monitor your site’s external connectivity. Of course, you can use PagerDuty to forward alerts from these services.

It doesn’t seem to be working. What’s going on?

Check the syslog for messages from “pagerduty_icinga”. On most systems:
grep pagerduty_icinga /var/log/syslog
Please contact us if you’re unable to sort out the difficulty.

What sort of Icinga messages does PagerDuty understand?

PagerDuty can process PROBLEM, ACKNOWLEDGEMENT, and RECOVERY messages. All other messages, including FLAPPINGSTART and FLAPPINGSTOP, are ignored. If you’d like PagerDuty to process additional Icinga messages, please let us know!

What about a 2-way ack integration between Icinga and PagerDuty?

PagerDuty customers have built a bi-directional integration package for Nagios/Icinga and PagerDuty making use of PagerDuty's generic integration API and webhooks to send notifications from Nagios/Icinga to PagerDuty and to keep alert acknowledgment status in sync. Learn more about it here.

Ready to get started?

Try any product on the Operations Cloud for free. No credit card required.