Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm moving Nagios 3 over from Ubuntu 8 server to RHEL 5.4. One nice feature Ubuntu had is the ability to tell you where the configuration errors are. For example if I had something incorrect in my commands.cfg file, I was informed where the error was. This does not seem to be the case with RHEL. I just get a generic message.

Running configuration check... CONFIG ERROR! Check your Nagios configuration.

Is there any kind of flag or something you can add to a config file to give more of a verbose error message?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

I think the following is what you want, you may have to change the paths to match your installation of course.

After you have made the change or changes, you can use /etc/init.d/nagios reload. The following command doesn't always show all of the errors it sees, so after you correct an error, run it again.

sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

share|improve this answer
    
That was it, I knew it was something simple. Thanks! –  Matt Chavez Dec 11 '09 at 13:16

I had to do this so often, I wrote a tiny shell script which lives in my nagios /etc/ directory:

#!/bin/bash
/opt/csw/nagios/bin/nagios -v /opt/csw/nagios/etc/nagios.cfg | egrep -i 'Warning|Error|okay'

...adjust your paths to suit.

Now when I make changes, my fingers know to go

# ./check
Warning: Contact group 'alladmin' is not used in any host/service definitions or host/service escalations!
Total Warnings: 1
Total Errors:   0
Things look okay - No serious problems were detected during the pre-flight check

...and based on that, I can ./reload (or not).

share|improve this answer
    
I got everything working, thanks for the shell script! it's an uphill battle with Nagios ;) –  Matt Chavez Dec 11 '09 at 15:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.