Page 1 of 2

NagiosXI and Pagerduty

Posted: Mon Jun 18, 2012 4:23 pm
by jparker
I am trying to setup pagerduty with its nagios integration listed in this guide here.
http://www.pagerduty.com/docs/guides/na ... tion-guide

I noticed this thread and commented in it about the issues I am having with the guided steps that Scott Wilkerson kinda revised to reflect the differences in NagiosXI http://support.nagios.com/forum/viewtop ... t=5537&e=0

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!

Re: NagiosXI and Pagerduty

Posted: Tue Jun 19, 2012 9:52 am
by scottwilkerson
If you add the file to your nagios.cfg like this

Code: Select all

cfg_file=/usr/local/nagios/etc/pagerduty_nagios.cfg
You need to make sure you do not have a contact in the CCM with the same contact name

Re: NagiosXI and Pagerduty

Posted: Tue Jun 19, 2012 10:04 am
by jparker
Yes I added that line to the nagios.cfg.

Your next steps after adding that line to nagios.cfg is to:

"Add the contact “pagerduty” to your Nagios configuration’s main contact group.

Create User pagerduty and add them to the admins contactgroup"

Do I not put down pagerduty? Do I make up a new name?

Re: NagiosXI and Pagerduty

Posted: Tue Jun 19, 2012 11:25 am
by mguthrie
I'm guessing this contact is also in the Core Config Manager. Can you access the Core Config Manager->Contacts page, then click the "Download" button and send us that config (private data removed). I'm guessing the contact may have ended up in there as well.

Re: NagiosXI and Pagerduty

Posted: Tue Jun 19, 2012 11:57 am
by jparker
Well right now I removed pagerduty contact because I was getting that error when I applied the configuration. I re-added it and placed it here. Also I included the configuration error log.

Re: NagiosXI and Pagerduty

Posted: Tue Jun 19, 2012 1:14 pm
by lmiltchev
I believe you are getting a config error, because you need to have "pagerduty_notification_times" in your config, so instead of this:

Code: Select all

host_notification_period      		nagiosadmin_notification_times
service_notification_period   		nagiosadmin_notification_times
you should have this:

Code: Select all

host_notification_period      		pagerduty_notification_times
service_notification_period   		pagerduty_notification_times
Note: You should modify this through the Core Config Manager.

Hope this helps.

Re: NagiosXI and Pagerduty

Posted: Tue Jun 19, 2012 1:33 pm
by jparker
I just made the changes but are getting the same results

Re: NagiosXI and Pagerduty

Posted: Tue Jun 19, 2012 2:45 pm
by lmiltchev
Can you apply configuration? Do you get any config errors when you run the Write Config Tool?

http://assets.nagios.com/downloads/nagi ... tabase.pdf

Re: NagiosXI and Pagerduty

Posted: Tue Jun 19, 2012 3:11 pm
by jparker
When I click the Write additional data I get this error:

Warning, always check the configuration files before restarting Nagios!


Write timeperiods.cfg ...
Configuration file successfully written!
Write commands.cfg ...
Configuration file successfully written!
Write contacts.cfg ...
Configuration file successfully written!
Write contactgroups.cfg ...
Configuration file successfully written!
Write contacttemplates.cfg ...
Configuration file successfully written!
Write servicedependencies.cfg ...
Configuration file successfully written!
Write hostdependencies.cfg ...
Configuration file successfully written!
Write serviceescalations.cfg ...
Configuration file successfully written!
Write hostescalations.cfg ...
Configuration file successfully written!
Write serviceextinfo.cfg ...
Configuration file successfully written!
Write hostextinfo.cfg ...
Configuration file successfully written!

When I click the Check configuration files I get this error:

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!


Nagios Core 3.4.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 05-11-2012
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config directory '/usr/local/nagios/etc/static'...
Processing object config file '/usr/local/nagios/etc/static/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.cfg'...
Processing object config file '/usr/local/nagios/etc/contacttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/contactgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/hostgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/servicegroups.cfg'...
Processing object config file '/usr/local/nagios/etc/hosttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicetemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicedependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostdependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/hostescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostextinfo.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceextinfo.cfg'...
Processing object config directory '/usr/local/nagios/etc/hosts'...
Processing object config file '/usr/local/nagios/etc/hosts/xxxxxxxx.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/xxxxxx.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/xxxxxxx.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/xxxxxxx.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/xxxxxx.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/xxxxxxx.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/xxxxxx.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/localhost.cfg'...
Processing object config directory '/usr/local/nagios/etc/services'...
Processing object config file '/usr/local/nagios/etc/services/xxxxxx.cfg'...
Processing object config file '/usr/local/nagios/etc/services/xxxxxx.cfg'...
Processing object config file '/usr/local/nagios/etc/services/xxxxxx.cfg'...
Processing object config file '/usr/local/nagios/etc/services/xxxxxx.cfg'...
Processing object config file '/usr/local/nagios/etc/services/xxxxxx.cfg'...
Processing object config file '/usr/local/nagios/etc/services/xxxxxx.cfg'...
Processing object config file '/usr/local/nagios/etc/services/xxxxxx.cfg'...
Processing object config file '/usr/local/nagios/etc/services/localhost.cfg'...
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!


***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.

Re: NagiosXI and Pagerduty

Posted: Tue Jun 19, 2012 3:12 pm
by jparker
Oh wait that first one isnt a error, its just my lack of reading it thoroughly.