Nagios cannot be started, and the syntax check is disabled.
[root@mode objects]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgNagios Core 3.4.3Copyright (c) 2009-2011 Nagios Core Development Team and Community ContributorsCopyright (c) 1999-2009 Ethan GalstadLast Modified: 11-30-2012License: GPLWebsite: http://www.nagios.orgReading configuration data... Read main config file okay...Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...Processing object config file '/usr/local/nagios/etc/objects/hosts.cfg'...Processing object config file '/usr/local/nagios/etc/objects/services.cfg'...Processing object config directory '/usr/local/nagios/etc/objects/services'...Error: Could not open config directory '/usr/local/nagios/etc/objects/services' for reading. 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.
The solution to this problem is as follows:
First, make sure that
You mustCommands. cfgAdd the check_nrpe plug-in configuration
# Vi commands. cfg after entering, press shift + g to cut to the end and add the following content. # 'Check _ nrpe 'command definitiondefine command {command_name check_nrpecommand_line $ USER1 $/check_nrpe-H $ HOSTADDRESS $-c $ ARG1 $}
Next, check vi nagios. cfg.
Export _file =/usr/local/nagios/etc/objects/hosts. cfg
Export _file =/usr/local/nagios/etc/objects/services. cfg
Export _dir =/usr/local/nagios/etc/objects/services
I have made the following changes to this configuration file:
No services directory is created.
After I create the service directory, I find that it can run normally.