Page 1 of 1

getting error can't open main configurations file

Posted: Wed May 16, 2018 8:54 am
by Ravikimt
Hi I am getting this error. Can you please help me here.?

Error: Cannot open main configuration file '/etc/nagios/nagios.cfg' for reading!

Re: getting error can't open main configurations file

Posted: Wed May 16, 2018 9:07 am
by Ravikimt
I am using Nagios core 4.3.4 in ubuntu 16.04 LTS

Re: getting error can't open main configurations file

Posted: Wed May 16, 2018 9:26 am
by scottwilkerson
does the file exist?

Code: Select all

ls -al /etc/nagios/nagios.cfg
If so can you attach it?

Re: getting error can't open main configurations file

Posted: Wed May 16, 2018 9:53 am
by Ravikimt
rwxrwxr-x 3 nagios nagios 4096 May 16 19:34 .
drwxr-xr-x 8 root root 4096 May 10 17:51 ..
-rw-r----- 1 www-data nagios 12999 May 10 17:51 cgi.cfg
-rw-r--r-- 1 root root 50 May 10 17:54 htpasswd.users
-rw-r----- 1 nagios nagios 44816 May 10 17:51 nagios.cfg
drwxrwxr-x 2 nagios nagios 4096 May 16 15:07 objects
-rw-rw---- 1 nagios nagios 1312 May 10 17:51 resource.cfg

Re: getting error can't open main configurations file

Posted: Wed May 16, 2018 10:05 am
by Ravikimt
Sorry this is the correct one please ignore my previous post.

-rw-rw-r-- 1 nagios nagios 44818 May 16 19:21 /usr/local/nagios/etc/nagios.cfg

Re: getting error can't open main configurations file

Posted: Wed May 16, 2018 12:44 pm
by scottwilkerson
Ravikimt wrote:Sorry this is the correct one please ignore my previous post.

-rw-rw-r-- 1 nagios nagios 44818 May 16 19:21 /usr/local/nagios/etc/nagios.cfg
Ok. Where are you getting this error? What are you doing when that happens?
Ravikimt wrote:Hi I am getting the error below. Can you please help me here.?

Error: Cannot open main configuration file '/etc/nagios/nagios.cfg' for reading!

Re: getting error can't open main configurations file

Posted: Wed May 16, 2018 12:51 pm
by Ravikimt
When I am doing Pre flight check for checking Nagios configuration then I am getting this error on my treminal

Re: getting error can't open main configurations file

Posted: Wed May 16, 2018 1:15 pm
by scottwilkerson
you should use

Code: Select all

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

Re: getting error can't open main configurations file

Posted: Fri Jun 01, 2018 5:49 am
by Ravikimt
I have resolved my problem so you can close this topic.
Thanks for the help.

Re: getting error can't open main configurations file

Posted: Fri Jun 01, 2018 7:01 am
by scottwilkerson
Great! Locking