getting error can't open main configurations file

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

getting error can't open main configurations file

Postby Ravikimt » Wed May 16, 2018 8:54 am

Hi I am getting this error. Can you please help me here.?

Error: Cannot open main configuration file '/etc/nagios/nagios.cfg' for reading!
Ravikimt
 
Posts: 71
Joined: Tue Apr 03, 2018 12:02 pm

Re: getting error can't open main configurations file

Postby Ravikimt » Wed May 16, 2018 9:07 am

I am using Nagios core 4.3.4 in ubuntu 16.04 LTS
Ravikimt
 
Posts: 71
Joined: Tue Apr 03, 2018 12:02 pm

Re: getting error can't open main configurations file

Postby scottwilkerson » Wed May 16, 2018 9:26 am

does the file exist?

Code: Select all
ls -al /etc/nagios/nagios.cfg


If so can you attach it?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12656
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: getting error can't open main configurations file

Postby Ravikimt » Wed May 16, 2018 9:53 am

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
Ravikimt
 
Posts: 71
Joined: Tue Apr 03, 2018 12:02 pm

Re: getting error can't open main configurations file

Postby Ravikimt » Wed May 16, 2018 10:05 am

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
Ravikimt
 
Posts: 71
Joined: Tue Apr 03, 2018 12:02 pm

Re: getting error can't open main configurations file

Postby scottwilkerson » Wed May 16, 2018 12:44 pm

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!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12656
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: getting error can't open main configurations file

Postby Ravikimt » Wed May 16, 2018 12:51 pm

When I am doing Pre flight check for checking Nagios configuration then I am getting this error on my treminal
Ravikimt
 
Posts: 71
Joined: Tue Apr 03, 2018 12:02 pm

Re: getting error can't open main configurations file

Postby scottwilkerson » Wed May 16, 2018 1:15 pm

you should use
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12656
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: getting error can't open main configurations file

Postby Ravikimt » Fri Jun 01, 2018 5:49 am

I have resolved my problem so you can close this topic.
Thanks for the help.
Ravikimt
 
Posts: 71
Joined: Tue Apr 03, 2018 12:02 pm

Re: getting error can't open main configurations file

Postby scottwilkerson » Fri Jun 01, 2018 7:01 am

Great! Locking
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12656
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios Core

Who is online

Users browsing this forum: jay_barbour and 34 guests