Page 2 of 3

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

Posted: Wed Jan 22, 2014 3:13 pm
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.

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

Posted: Wed Jan 22, 2014 3:16 pm
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.

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

Posted: Wed Jan 22, 2014 3:26 pm
by fm2ahmed
Hi,

Sorry will post over here from now on.

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

Posted: Thu Jan 23, 2014 12:43 pm
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.

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

Posted: Thu Jan 23, 2014 1:03 pm
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

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

Posted: Fri Jan 24, 2014 4:26 am
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

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

Posted: Fri Jan 24, 2014 4:30 am
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?

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

Posted: Fri Jan 24, 2014 2:34 pm
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.

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

Posted: Fri Jan 31, 2014 12:30 pm
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!!!!!!!!!!!!!!!!!!!!!!

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

Posted: Fri Jan 31, 2014 2:52 pm
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/