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
Could not open CGI config file /usr/local/nagios/etc/cgi.cfg
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Could not open CGI config file /usr/local/nagios/etc/cgi
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
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.
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
Let's see if you have anything weird with the symlinks you have:
Code: Select all
ls -lR /usr/local | grep ^lBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: Could not open CGI config file /usr/local/nagios/etc/cgi
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.
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
Closing this thread as it is the same issue as http://support.nagios.com/forum/viewtopic.php?t=25064. Please continue the discussion there.
Former Nagios employee