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 am migrating from Nagios 3.2.3 to 4.02 and I am stuck with a non-specific error message: Is there a way to coax some more detail out of Nagios Core? I get no clue from the attached error output what might be wrong, or even which .cfg file is the culprit.

/usr/local/nagios/bin/nagios -vvvvvv /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.0.2
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 11-25-2013
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/etc/nagios/objects/contacts.cfg'...
Processing object config file '/etc/nagios/objects/escalations.cfg'...
Processing object config file '/etc/nagios/objects/timeperiods.cfg'...
Processing object config file '/etc/nagios/objects/templates.cfg'...
Processing object config file '/etc/nagios/objects/signal-hosts.cfg'...
Processing object config file '/etc/nagios/objects/servicechecks.cfg'...
Processing object config file '/etc/nagios/objects/passivechecks.cfg'...
Processing object config file '/etc/nagios/objects/websites/aws1-checkwebservices.cfg'...
Processing object config file '/etc/nagios/objects/websites/aws2-checkwebservices.cfg'...
Processing object config file '/etc/nagios/objects/websites/awscabot-checkwebservices.cfg'...
Processing object config file '/etc/nagios/objects/others.cfg'...

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.
share|improve this question

1 Answer 1

Enable debug output and set the level to 2 or 3 (DEBUGL_FUNCTIONS and DEBUGL_CONFIG).

(Upon looking at the source, my original thought about it being a permissions problem was wrong; There's a specific error message for "can't read object file" problems.)

If there's nothing helpful in the debug output, you can try running it through strace. If that isn't an option, or isn't helpful, you'll have to hack on the source a bit to get more info.

In case you actually want to do this:

Your error is the very-generic one caused by (base/nagios.c lines 435-438):

/* read object config files */
result = read_all_object_data(config_file);
if(result != OK) {
        printf("   Error processing object config files!\n\n");

This function (in base/config.c) just sets an option flag and then calls read_object_config_data(), which returns the generic ERROR.

That function (in common/objects.c) really just calls xodtemplate_read_config_data.

The real work is done in xodtemplate_read_config_data (in xdata/xodtemplate.x). So if you wanted to add some additional debug output, that's probably where you should do it.

share|improve this answer
    
The files shown all have world read for permissions, plus I am running the command as root –  iewebguy Feb 25 at 16:54
    
Ah, don't do it as root! Run it as the nagios user –  Keith Feb 25 at 17:04
    
I get the same results running as nagios –  iewebguy Feb 25 at 17:11
    
Interesting. Can you add nagios.cfg to the question? –  Keith Feb 25 at 21:03
    
I am asking how to debug any configuration that is giving this error sort of error, not just the particular problem I have now. Is there a way to compile Nagios with more verbosity? –  iewebguy Feb 26 at 1:05

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.