Error Whoops! Error: Could not open CGI config 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Error Whoops! Error: Could not open CGI config file

Post by tmcdonald »

Posting link to same issue in another thread:

http://support.nagios.com/forum/viewtop ... 42&p=86460

Other thread has been closed so please continue all discussion here.
Former Nagios employee
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Error Whoops! Error: Could not open CGI config file

Post by slansing »

I would also like to add, please do not open double threads on the same issue, and paste the same answers between the two it is a waste of time and we would like to make the most of that time to help you get your issue resolved.
fm2ahmed
Posts: 32
Joined: Wed Oct 09, 2013 9:41 am

Re: Error Whoops! Error: Could not open CGI config file

Post by fm2ahmed »

Hi,

Sorry will post over here from now on.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Error Whoops! Error: Could not open CGI config file

Post by slansing »

Have you tried re sym-linking the directories since your install? I would think that you had not sym-linked nagios to a non existing location before installation the last time, that may have caused issues this time, doing it before you had upgraded.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Error Whoops! Error: Could not open CGI config file

Post by lmiltchev »

Also, check the permissions on the cgi.cfg if you haven't done this already.

Code: Select all

ls -la /path/to/the/cgi.cfg
Be sure to check out our Knowledgebase for helpful articles and solutions!
fm2ahmed
Posts: 32
Joined: Wed Oct 09, 2013 9:41 am

Re: Error Whoops! Error: Could not open CGI config file

Post by fm2ahmed »

Hi,

Permissions seems to be fine for cgi.cfg.

-rwxr-xr-x. 1 nagios nagcmd 12030 Jan 15 15:34 /usr/local/nagios-4.0.2/etc/cgi.cfg
fm2ahmed
Posts: 32
Joined: Wed Oct 09, 2013 9:41 am

Re: Error Whoops! Error: Could not open CGI config file

Post by fm2ahmed »

slansing wrote:Have you tried re sym-linking the directories since your install? I would think that you had not sym-linked nagios to a non existing location before installation the last time, that may have caused issues this time, doing it before you had upgraded.
Firstly i tried by removing the symlink and then the upgrade failed. Then I re sym-linked the directory and did the upgrade and that went through ok apart from that cgi.cfg error.

Should i go ahead and re-run the upgrade again?? I am thinking if i re-run the upgrade by renaming the Nagios folder to old "nagios-3.2.3" instead of "nagios-4.0.2" , that might solve the issue?? What do you say?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Error Whoops! Error: Could not open CGI config file

Post by slansing »

It could, I guess we have never seen this done before. This could be an issue stemming from how Nagios was originally set up on the system and it is just now surfacing when you have to upgrade.
fm2ahmed
Posts: 32
Joined: Wed Oct 09, 2013 9:41 am

Re: Error Whoops! Error: Could not open CGI config file

Post by fm2ahmed »

Hi,

I removed the symlink nagios-4.0.2 and the renamed back to old nagios-3.2.3. And now i get a different error for statusmap.cgi.

It says
Whoops!

Error: Could not read object configuration data!

Here are some things you should check in order to resolve this error:

Verify configuration options using the -v command-line option to check for errors.
Check the Nagios log file for messages relating to startup or status data errors.

Make sure you read the documentation on installing, configuring and running Nagios thoroughly before continuing. If all else fails, try sending a message to one of the mailing lists. More information can be found at http://www.nagios.org.
I ran this and no errors found.
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Please help!!!!!!!!!!!!!!!!!!!!!!
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Error Whoops! Error: Could not open CGI config file

Post by sreinhardt »

Well the cgis are coded to look in certain places via the ./configure options you originally listed. Are these still using the prefix with nagios-4.0.2? Probably the easiest route would be to go back to the nagios build directory and run the following commands.

Code: Select all

make distclean; make clean
./configure
make all
make install
This will use all the normal defualts that specify that everything should be based off /usr/local/nagios/
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked