How to use pagerduty

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jcamillo
Posts: 29
Joined: Wed Jan 04, 2012 8:52 am

How to use pagerduty

Post by jcamillo »

What is the best way to configure pagerduty with Nagios XI?

Thanks
Joe
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to use pagerduty

Post by scottwilkerson »

I haven't used their service but they have a guide for adding it to core here
http://www.pagerduty.com/docs/guides/na ... tion-guide

With that, it looks like the steps should be something like this (not tested):

Install the necessary Perl dependencies:

Code: Select all

yum install perl-libwww-perl perl-Crypt-SSLeay
Download pagerduty_nagios.cfg

Code: Select all

cd /usr/local/nagios/etc
 wget http://www.pagerduty.com/configs/pagerduty_nagios.cfg

Open the file in your favorite editor.
Enter the service key corresponding to your Nagios service into the pager field. The service key is a 32 character string that can be found on the service’s detail page.
Copy the Nagios configuration file into place:


Edit the Nagios config to load the PagerDuty config. To do this, open /usr/local/nagios/etc/nagios.cfg and add this line to the file:

Code: Select all

cfg_file=/usr/local/nagios/etc/pagerduty_nagios.cfg
Add the contact “pagerduty” to your Nagios configuration’s main contact group.

Create User pagerduty and add them to the admins contactgroup

Download pagerduty_nagios.pl to /usr/local/nagiosxi/cron.

Code: Select all

cd /usr/local/nagios/libexec
wget http://www.pagerduty.com/configs/pagerduty_nagios.pl
Make sure the file is executable by Nagios

Code: Select all

chmod 755 /usr/local/nagiosxi/cron/pagerduty_nagios.pl
Enable environment variable macros in /usr/local/nagios/etc/nagios.cfg (if not enabled already)

Code: Select all

enable_environment_macros=1
Edit the nagios user’s crontab

Code: Select all

crontab -u nagios -e
Add the following line to the crontab

Code: Select all

* * * * * /usr/local/nagiosxi/cron/pagerduty_nagios.pl flush
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jcamillo
Posts: 29
Joined: Wed Jan 04, 2012 8:52 am

Re: How to use pagerduty

Post by jcamillo »

Thanks - I will give it a shot.
jparker
Posts: 10
Joined: Fri Mar 16, 2012 12:37 pm

Re: How to use pagerduty

Post by jparker »

I am trying to follow the instructions you had here and I am getting an error applying the configuration once adding "pagerduty" to the nagios configurations as a contact.

this is the error I am getting from the log:


Processing object config file '/usr/local/nagios/etc/pagerduty_nagios.cfg'...
Warning: Duplicate definition found for contact 'pagerduty' (config file '/usr/local/nagios/etc/pagerduty_nagios.cfg', starting on line 1)
Error: Could not add object property in file '/usr/local/nagios/etc/pagerduty_nagios.cfg' on line 2.
Error processing object config files!
Locked