What is the best way to configure pagerduty with Nagios XI?
Thanks
Joe
How to use pagerduty
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: How to use pagerduty
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:
Download 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:
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.
Make sure the file is executable by Nagios
Enable environment variable macros in /usr/local/nagios/etc/nagios.cfg (if not enabled already)
Edit the nagios user’s crontab
Add the following line to the crontab
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-SSLeayCode: Select all
cd /usr/local/nagios/etc
wget http://www.pagerduty.com/configs/pagerduty_nagios.cfgOpen 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.cfgCreate 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.plCode: Select all
chmod 755 /usr/local/nagiosxi/cron/pagerduty_nagios.plCode: Select all
enable_environment_macros=1Code: Select all
crontab -u nagios -eCode: Select all
* * * * * /usr/local/nagiosxi/cron/pagerduty_nagios.pl flushRe: How to use pagerduty
Thanks - I will give it a shot.
Re: How to use pagerduty
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!
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!