Page 1 of 3
Error Whoops! Error: Could not open CGI config file
Posted: Wed Jan 15, 2014 8:15 am
by fm2ahmed
Hi,
I updated Nagios Core from 3.2.3 to 4.0.1. We previously had it installed in a directory called /usr/local/nagios-3.2.3. But then the upgraded version is now installed in /usr/local/nagios-4.0.2. The upgrade went fine but one of the links on the left "MAP" when i click on it gives this error.
------------------------
Whoops!
Error: Could not open CGI config file '/usr/local/nagios-3.2.3/etc/cgi.cfg' for reading!
-------------------------
Why is it still taking the old location and where is it taking it from ?? We have got Apache linked to it.
Awaiting quick reply.
Regards,
Farooq Ahmed
Re: Error Whoops! Error: Could not open CGI config file
Posted: Wed Jan 15, 2014 11:57 am
by abrist
Maybe your init script is still pointing to the old config location?
Re: Error Whoops! Error: Could not open CGI config file
Posted: Mon Jan 20, 2014 11:40 am
by fm2ahmed
Hi,
Just checked that and it looks OK.
prefix=/usr/local/nagios-4.0.2
exec_prefix=/usr/local/nagios-4.0.2
What can be the problem??? Please help.
Re: Error Whoops! Error: Could not open CGI config file
Posted: Mon Jan 20, 2014 11:42 am
by fm2ahmed
Hi,
Is it that there is a symlink to the old config in Apache??
Re: Error Whoops! Error: Could not open CGI config file
Posted: Mon Jan 20, 2014 11:44 am
by fm2ahmed
Hi,
This is how the entries are in /etc/init.d/nagios
prefix=/usr/local/nagios-4.0.2
exec_prefix=/usr/local/nagios-4.0.2
NagiosBin=${exec_prefix}/bin/nagios
NagiosCfgFile=/usr/local/nagios-4.0.2/etc/nagios.cfg
NagiosStatusFile=${prefix}/var/status.dat
NagiosRetentionFile=${prefix}/var/retention.dat
NagiosCommandFile=${prefix}/var/rw/nagios.cmd
NagiosVarDir=${prefix}/var
NagiosRunFile=${prefix}/var/nagios.lock
NagiosLockDir=/var/lock/subsys
NagiosLockFile=nagios
NagiosCGIDir=${exec_prefix}/sbin
NagiosUser=nagios
NagiosGroup=nagcmd
Anything wrong???
Re: Error Whoops! Error: Could not open CGI config file
Posted: Mon Jan 20, 2014 12:05 pm
by fm2ahmed
Hi,
I am going crazy now !!!!!!!!!!!!
There is one more error i get when i click on Service Groups Summary.
It appears as though you do not have permission to view information for any of the hosts you requested...
If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.
I assume that its related to the aboce cgi.cfg error.
Re: Error Whoops! Error: Could not open CGI config file
Posted: Tue Jan 21, 2014 10:23 am
by slansing
Yes, this is attributed to the CGI issues you are having, you will need to change the required paths to point to the correct one of the current CGI.cfg file. Do you have notes on what you changed last time? There are quite a lot of custom paths here.
Re: Error Whoops! Error: Could not open CGI config file
Posted: Tue Jan 21, 2014 2:14 pm
by fm2ahmed
Hi,
These are the steps i followed for upgrading from 3.2.3 to 4.0.2 Core.
-->wget
http://osdn.dl.sourceforge.net/sourcefo ... 4.x.tar.gz
-->tar xzf nagios-4.x.tar.gz
-->cd nagios-4.x
-->./configure --with-command-group=nagcmd
-->make all
-->make install
--> /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
0 Errors found.
--> Lastly, service nagios reload
All these commands were run being a root user.
Note: Prior to upgrade i had a folder /usr/local/nagios-3.2.3 which had a symlink to nagios.
nagios -> /usr/local/nagios-3.2.3
I changed that to nagios -> /usr/local/nagios-4.0.2 before the upgrade so that the upgrade runs successfully.
Upgrade was successful apart from the error "Error: Could not open CGI config file '/usr/local/nagios-3.2.3/etc/cgi.cfg' for reading!" when you click on Map or Trends
Please help as i need to sort it ASAP.
Re: Error Whoops! Error: Could not open CGI config file
Posted: Wed Jan 22, 2014 12:54 pm
by lmiltchev
Run the following command and show us the output:
Re: Error Whoops! Error: Could not open CGI config file
Posted: Wed Jan 22, 2014 2:57 pm
by fm2ahmed
Hi,
This is the output.
lrwxrwxrwx. 1 root root 23 Jan 14 09:22 nagios -> /usr/local/nagios-4.0.2
lrwxrwxrwx. 1 root root 21 Sep 22 2011 nrpe -> /usr/local/nrpe-2.12/
Regards,
Farooq Ahmed