Could not open config directory

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ranjitw
Posts: 175
Joined: Tue Sep 01, 2015 1:52 am

Could not open config directory

Post 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
Regards,
Ranjit W
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Could not open config directory

Post 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.
Former Nagios Employee
ranjitw
Posts: 175
Joined: Tue Sep 01, 2015 1:52 am

Re: Could not open config directory

Post by ranjitw »

Thank you . This helped.

Please close the post.
Regards,
Ranjit W
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Could not open config directory

Post by rkennedy »

Nice to see it fixed. I will now close this out, feel free to open another thread if you need more assistance.
Former Nagios Employee
Locked