getting error can't open main configurations file

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Ravikimt
Posts: 77
Joined: Tue Apr 03, 2018 12:02 pm

getting error can't open main configurations file

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

Re: getting error can't open main configurations file

Post by Ravikimt »

I am using Nagios core 4.3.4 in ubuntu 16.04 LTS
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: getting error can't open main configurations file

Post by scottwilkerson »

does the file exist?

Code: Select all

ls -al /etc/nagios/nagios.cfg
If so can you attach it?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Ravikimt
Posts: 77
Joined: Tue Apr 03, 2018 12:02 pm

Re: getting error can't open main configurations file

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

Re: getting error can't open main configurations file

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: getting error can't open main configurations file

Post 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!
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Ravikimt
Posts: 77
Joined: Tue Apr 03, 2018 12:02 pm

Re: getting error can't open main configurations file

Post by Ravikimt »

When I am doing Pre flight check for checking Nagios configuration then I am getting this error on my treminal
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: getting error can't open main configurations file

Post by scottwilkerson »

you should use

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Ravikimt
Posts: 77
Joined: Tue Apr 03, 2018 12:02 pm

Re: getting error can't open main configurations file

Post by Ravikimt »

I have resolved my problem so you can close this topic.
Thanks for the help.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: getting error can't open main configurations file

Post by scottwilkerson »

Great! Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked