Page 1 of 1

Could not open CGI config file /usr/local/nagios/etc/cgi.cfg

Posted: Mon Jan 20, 2014 11:37 am
by fm2ahmed
I recently upgraded from Nagios Core 3.2.3 to v 4.0.2. After the upgrade when i browse to WEBGUI of Nagios i get this error when i click on Maps.Other things run fine.

Error is Could not open CGI config file '/usr/local/nagios-3.2.3/etc/cgi.cfg' for reading

Note: nagios-3.2.3 was my old file location and now I changed it to nagios-4.0.2 and now it doesn't work. Is there a way i can point cgi.cfg to new location i.e. /usr/local/nagios-4.0.2

Re: Could not open CGI config file /usr/local/nagios/etc/cgi

Posted: Mon Jan 20, 2014 11:51 am
by slansing
You will likely need to alter "physical_html_path=" and "main_config_file=" in the cgi.cfg file, then attempt a restart of nagios. Let us know!

Re: Could not open CGI config file /usr/local/nagios/etc/cgi

Posted: Wed Jan 22, 2014 5:11 am
by fm2ahmed
Re: Error Whoops! Error: Could not open CGI config file

Postby fm2ahmed ยป Tue Jan 21, 2014 2:14 pm
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: Could not open CGI config file /usr/local/nagios/etc/cgi

Posted: Wed Jan 22, 2014 2:59 pm
by lmiltchev
Let's see if you have anything weird with the symlinks you have:

Code: Select all

ls -lR /usr/local | grep ^l

Re: Could not open CGI config file /usr/local/nagios/etc/cgi

Posted: Wed Jan 22, 2014 3:02 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/

Awaiting reply.

Re: Could not open CGI config file /usr/local/nagios/etc/cgi

Posted: Wed Jan 22, 2014 3:12 pm
by tmcdonald
Closing this thread as it is the same issue as http://support.nagios.com/forum/viewtopic.php?t=25064. Please continue the discussion there.