Home » Categories » Products » Nagios Core » Troubleshooting » Common Problems

Nagios Core - Nagios service does not start - Error processing object config files!

Nagios service does not start - Error processing object config files!

This article describes how to troubleshoot why the Nagios service will not start due to object configuration errors in Nagios Core. Nagios Core uses plain text files for defining the objects that will be monitored. It can be very easy to make a typing mistake which prevents the Nagios service from starting.

 

Steps To Reproduce

An example of the issue is as follows:

Type:

service nagios start

 

The follow error message is produced:

Running configuration check...

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Error: Could not find any host matching 'winserver3' (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 74)
Error: Failed to expand host list 'winserver1' for service 'NSClient++ Version' (/usr/local/nagios/etc/objects/windows.cfg:74)
   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.

 

Identifying The Problem

The following two lines explain the cause of the problem:

Error: Could not find any host matching 'winserver3' (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 74)
Error: Failed to expand host list 'winserver1' for service 'NSClient++ Version' (/usr/local/nagios/etc/objects/windows.cfg:74)


Nagios is telling us that the definition for the service called NSCient++ Version has the host winserver3 defined however it cannot find the host object definition in any of the defined configuration files.

Nagios also points you to the exact line in the config file. In this example, line 74 will take you to the beginning of the service definition in /usr/local/nagios/etc/objects/windows.cfg

define service{
        use                     generic-service
        host_name               winserver1,winserver2,winserver3
        service_description     NSClient++ Version
        check_command           check_nt!CLIENTVERSION
        check_interval          1
        max_check_attempts      1
        retry_interval          1
        }

 

Resolving The Problem

You need to correct the object definition error that nagios is complaining about. In the example above, there are two possible solutions:

  1. Add a host object called winserver3
  2. Remove winserver3 from the service definition

 

Why Is The Problem Occurring - I Didn't Make Any Changes

When object configuration files are updated, Nagios will not use these changes until the next time the Nagios service starts.

It is not uncommon for a change to be made in the past and Nagios was not restarted at that point.

You are experiencing the issue because this is the first time Nagios has been restarted since the change.

 

Preventing The Problem

It is good practice to verify the config whenever changes have been made. Nagios has a verify command you can run which will do just that.

Type:

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

 

The following information is produced:

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Error: Could not find any host matching 'winserver3' (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 74)
Error: Failed to expand host list 'winserver1' for service 'NSClient++ Version' (/usr/local/nagios/etc/objects/windows.cfg:74)
   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.

If there are no problems then the output will be like this:

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
    Checked 23 services.
    Checked 9 hosts.
    Checked 6 host groups.
    Checked 0 service groups.
    Checked 1 contacts.
    Checked 1 contact groups.
    Checked 29 commands.
    Checked 5 time periods.
    Checked 0 host escalations.
    Checked 0 service escalations.
Checking for circular paths...
    Checked 9 hosts
    Checked 2 service dependencies
    Checked 0 host dependencies
    Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
 
More information

You can also use -vv instead of -v and the command will output a lot more detailed information which you may find useful.

 

Summary

At this point you should have an understanding of how to troubleshoot configuration issues that prevent the Nagios service from starting.

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/

0 (0)
Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
Nagios Core - How to Think with Nagios to Solve Monitoring Problems - NWC14
Viewed 1846 times since Mon, Feb 8, 2016
Web Browser Reports 330 Error Content Encoding
Viewed 1401 times since Tue, Mar 7, 2017
How To Clear Solaris Service Maintenance Status
Viewed 9853 times since Mon, Mar 6, 2017
Nagios XI - Defining Global Environment Variables
Viewed 3098 times since Thu, Mar 17, 2016
Nagios Core - nagios.lock Changes In 4.3.3 Onwards
Viewed 2994 times since Tue, Jan 30, 2018
Nagios XI - Uploaded plugin returns "/bin/bash^M: bad interpreter: No such file or directory"
Viewed 1962 times since Thu, Feb 25, 2016
SNMP Trap - How To Send A Test Trap
Viewed 51268 times since Fri, Apr 1, 2016
Nagios XI - How To Use CA Certificates With check_ldaps Plugin
Viewed 2596 times since Tue, Jul 26, 2016
Nagios XI - MK Livestatus Problems With Mod-Gearman
Viewed 1575 times since Thu, Feb 25, 2016
Nagios XI - Last Check Time Not Updating
Viewed 6112 times since Tue, Jan 6, 2015