Turn any signal into insight and action. See how PagerDuty Digital Operations Management Platform integrates machine data and human intelligence to improve visibility and agility across organizations.
Cut through the noise. Unleash innovation and productivity.
Check out the latest features we’ve been working on—including event intelligence, machine learning, response automation, on-call, analytics, operations health management, integrations, and more.
Digital Operations Management arms organizations with the insights needed to turn data into opportunity across every operational use case, from DevOps, ITOps, Security, Support, and beyond.
Over 200 Integrations
Discover DevOps best practices with our library of webinars, whitepapers, reports, and much more.
Learn best practices and get support help with resources from our award-winning support team.
See how PagerDuty works with our live product demo — twice a week, every week.
Join live and on-demand webinars for product deep dives, industry trends, configuration training, and use case-specific best practices.
Interactive, simple-to-use API and technical documentation enables users to easily try updates and extend PagerDuty.
Engage with users and PagerDuty experts from our global community of 200k+ users. Become a member, connect, and share insights for success.
Get all your PagerDuty-related questions answered by exploring our in-depth support documentation and community forums.
Real-Time Operations Management in the Cloud Just Got Easier Cloud infrastructure, by nature, is constantly changing as new instances are spun up and decommissioned, which...
PagerDuty helps organizations transform their digital operations. Learn more about PagerDuty's mission and what we do.
Meet our experienced and passionate executive team.
We are risk-taking innovators dedicated to delivering amazing products and delighting customers. Join us and do the best work of your career.
With the PagerDuty Foundation, we are committed to doing our part in giving back to the community.
Nagios is one of the leading providers of open source, enterprise-grade IT infrastructure monitoring tools. Used by hundreds of thousands of users worldwide, Nagios allows its users to monitor their entire IT infrastructure, spot problems before they occur, detect security breaches and plan/budget for IT upgrades.
By integrating PagerDuty into your existing Nagios monitoring solution, you can have Nagios alerts go directly to the the person on-call in your PagerDuty schedule. The benefit of the two-way integration is that users can acknowledge an incident in PagerDuty and the acknowledgment will be passed on to the relevant service or host in Nagios, meaning both systems will reflect the most current status of an issue.
The guide below describes how to integrate your Nagios 2, 3 or 4 installation with PagerDuty using our easy to install agent. 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, Nagios configuration and Nagios version. Please contact our support team if you have any trouble completing the integration.
Note: If you are running Nagios on CentOS 5, you will need to use the Perl-based integration for Nagios instead of following this guide.
On the Services page:
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 the New Integration button.
Select your app from the Integration Type menu and enter an Integration Name.
If you are creating a new service for your integration, in General Settings, enter a Name for your new service. Then, in Incident Settings, specify the Escalation Policy, Notification Urgency, and Incident Behavior for your new service.
Click the Add Service or Add Integration button to save your new integration. You will be redirected to the Integrations page for your service.
Copy the Integration Key for your new integration.
This guide includes steps for Debian-based (i.e. Ubuntu) and RHEL-based (i.e. CentOS, Fedora) Linux distributions. You do not need to execute all commands in this guide, only the ones for your type of system. Note that all commands provided are intended to be run as the root user.
Download pagerduty_nagios.cfg from GitHub:
Enter the integration key corresponding to your Nagios service into the pager field. The key is a 32-character string that can be found on the service’s detail page (step 5 in the PagerDuty section above).
Move the Nagios configuration file into place.
For Debian-based systems this is usually /etc/nagios3/conf.d:
mv pagerduty_nagios.cfg /etc/nagios3/conf.d
For RHEL-based systems this is usually /etc/nagios:
mv pagerduty_nagios.cfg /etc/nagios
alias Nagios Administrators
members root,pagerduty ; Add pagerduty here
service nagios3 restart
service nagios restart
Download pagerduty.cgi for the two-way integration:
grep "^command_file" /etc/nagios3/nagios.cfg
grep "^command_file" /etc/nagios/nagios.cfg
Move pagerduty.cgi to the Nagios cgi-bin.
For Debian-based systems this is usually /usr/lib/cgi-bin/nagios3/:
mv pagerduty.cgi /usr/lib/cgi-bin/nagios3/
For RHEL-based systems this is usually /usr/lib64/nagios/cgi/:
mv pagerduty.cgi /usr/lib64/nagios/cgi/
chmod +x /usr/lib/cgi-bin/nagios3/pagerduty.cgi
For RHEL-based systems:
chmod +x /usr/lib64/nagios/cgi/pagerduty.cgi
apt-get install libwww-perl libjson-perl
For Ubuntu 16.04 systems, you will also need to install libcgi-pm-perl:
apt-get install libwww-perl libjson-perl libcgi-pm-perl
yum install perl-JSON perl-CGI perl-libwww-perl
Skip this step if you are using a RHEL-based distribution. If you are using a Debian-based distribution, you will need to make sure that your web server user (usually www-data) is able to write to the Nagios command file. The following commands enable this for the default command file location:
/etc/init.d/nagios3 stop ## Note: This will stop your Nagios service!
dpkg-statoverride --update --add nagios www-data 2730 /var/lib/nagios3/rw
dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3
For the Extension Type select Generic V1 Webhook, then enter in a Name for your webhook (i.e. Nagios), paste in the URL and click Save.The URL will look similar to this: http://user:password@ip-or-domain/nagios3/cgi-bin/pagerduty.cgiNote: Unless you’ve disabled it, the Nagios web interface requires a username and password. We highly recommend configuring a user that is able to run Nagios commands that is only used for the webhook.
If you go to this URL in your browser you should see 400 Requests must be POSTs. If you do not see this, check your web server logs for details on what happened when you tried to call this URL.
400 Requests must be POSTs
At this point, you should be all set. To test it out, you’d need to have an issue within Nagios that generates an incident. From there, acknowledging the incident should add a comment stating the incident has been “Acknowledged by PagerDuty.”
The two-way integration requires that your Nagios server be accessible over the internet to receive webhook calls from PagerDuty. If you wish to restrict access to your Nagios web server to specific IPs, you can find PagerDuty’s webhook IPs in our knowledge base: What are PagerDuty’s IPs for whitelisting and firewall purposes?
Alternatively, you can use a service like ngrok to create a secure tunnel to your Nagios server with a public URL that can be used for your webhook or the poller script originally developed by Zoosk and now maintained by PagerDuty to reach out instead of having your Nagios server publicly accessible.
This is easy to do with the current integration, as a Nagios service in PagerDuty is directly mapped to a “contact” in Nagios. By default, this contact is named pagerduty and defined in the pagerduty_nagios.cfg file. In order to configure multiple services, just duplicate the existing contact definition and rename it (i.e. pagerduty_database, pagerduty_network, etc.). Then copy and paste the corresponding Integration Key from PagerDuty into the pager field. Don’t forget to restart your Nagios for the changes to take effect.
If a PagerDuty server can’t be reached for any reason, events will be stored to an on-disk queue. The PagerDuty agent will attempt to re-send the events when connectivity is restored.
You should configure an external ping check service such as StatusCake or NodePing to monitor your site’s external connectivity. Of course, you can use PagerDuty to receive alerts from these services as well.
First, make sure you’ve installed the PagerDuty Agent, and that there were no errors from your package manager when attempting to install it. Failed installs (i.e. due to an incompatible distribution, such as CentOS 5) are the most common issue with the integration not working.
Check that the pagerduty contact is getting the HOST or SERVICE NOTIFICATIONS in syslog. You can grep your syslog to see if the pagerduty contact is being notified. Here’s an example from an Ubuntu system (on RHEL-based systems, syslog is at /var/log/messages):
grep NOTIFICATION /var/log/syslog
May 28 18:20:57 ip-10-11-139-249 nagios3: SERVICE NOTIFICATION: pagerduty;localhost;Current Users;CRITICAL;notify-service-by-pagerduty;USERS CRITICAL - 3 users currently logged in
As you can see, the pagerduty contact was notified for this SERVICE NOTIFICATION. If the pagerduty contact never shows up, that means that the pagerduty contact is not associated with notifications for the host/service in question. If you’re using the default configuration, make sure that the pagerduty contact is a member of the admins contact group. If the pagerduty contact is getting notified, check the agent log at /var/log/pdagent/pdagentd.log.
More troubleshooting tips can be found in our Nagios Troubleshooting Guide.
PagerDuty can process PROBLEM, ACKNOWLEDGEMENT, and RECOVERY messages. All other messages, including FLAPPINGSTART and FLAPPINGSTOP, are ignored.
We have a guide for Customizing Notifications Sent to PagerDuty from Nagios to help you get started.
600 Townsend St., #200
San Francisco, CA 94103
260 Queen St W #300,
Toronto, ON M5V 1Z8, Canada
1416 NW 46th St., St. 301
Seattle, WA 98107
5 Martin Place
1 Fore St,
London EC2Y 9DT
© 2009 - 2018