Start Using PagerDuty Today
Try PagerDuty free for 14 days — no credit card required.
This guide describes how to integrate your Icinga 2 installation with PagerDuty using PagerDuty Agent.
Please 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 2 configuration.
If you are having trouble completing the installation, please contact us.
wget https://raw.githubusercontent.com/PagerDuty/pdagent-integrations/master/conf.d/pagerduty-icinga2.conf
mv pagerduty-icinga2.conf /etc/icinga2/conf.d/
Alternatively, if you’re using Icinga’s objects.d configuration:
mv pagerduty-icinga2.conf /etc/icinga2/objects.d/
enable_pagerduty
to your configuration’s host and service configuration objects.vars.enable_pagerduty = true # Add this line to hosts/services that will send events to PagerDuty
Note, the easiest way to do this is to add it to templates that are used by all of your configuration objects. For instance, on Debian-based systems, the default configuration has host objects that use the generic-host
template and service objects that use the generic-service
template. The templates are defined in /etc/icinga2/conf.d/templates.conf and can be modified as follows:template Host "generic-host" {
max_check_attempts = 5
check_interval = 1m
retry_interval = 30s
check_command = "hostalive"
vars.enable_pagerduty = true # Add this line
}
template Service "generic-service" {
max_check_attempts = 3
check_interval = 1m
retry_interval = 30s
vars.enable_pagerduty = true # Add this line
}
generic-host
and generic-service
templates, your objects should have one of the following lines:
import "generic-host" # All host objects should have this line in them
import "generic-service" # All service objects should have this line in them
/etc/init.d/icinga2 restart
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.
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.
Check the Icinga log file for messages containing “pagerduty”. On most systems:
grep -i pagerduty /var/log/icinga2/icinga2.log
Another log to check is the syslog for messages containing “Icinga event”:
grep "Icinga event" /var/log/syslog
Please contact us if you’re unable to sort out the difficulty.
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!
Try PagerDuty free for 14 days — no credit card required.