Page 1 of 1

Could not open config directory

Posted: Wed Oct 28, 2015 9:20 am
by ranjitw
Hi ,

I am using Nagios XI 5.2.0 .

I have created a custom command and added the entry in nagios.cfg file as below :

cfg_dir=/usr/local/nagios/etc/misccommands.cfg

When i try restarting the nagios service I am getting below error :

service nagios restart
Running configuration check...

Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Could not open config directory '/usr/local/nagios/etc/misccommands.cfg' 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 file is present in the directory below is the output:

ll /usr/local/nagios/etc/misccommands.cfg
-rwxr-xr-x 1 apache nagios 0 Oct 28 14:55 /usr/local/nagios/etc/misccommands.cfg

Please help me in getting this problem resolved .

Please note this is working fine earlier . When I am working on Nagios XI 2014R2.6

Re: Could not open config directory

Posted: Wed Oct 28, 2015 10:04 am
by rkennedy
Change cfg_dir to cfg_file so the final result will be -

Code: Select all

cfg_file=/usr/local/nagios/etc/misccommands.cfg
Currently, you're telling it that the file is a directory, and it won't process it properly.

Re: Could not open config directory

Posted: Wed Oct 28, 2015 10:31 am
by ranjitw
Thank you . This helped.

Please close the post.

Re: Could not open config directory

Posted: Wed Oct 28, 2015 10:33 am
by rkennedy
Nice to see it fixed. I will now close this out, feel free to open another thread if you need more assistance.