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

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.
Locked
fm2ahmed
Posts: 32
Joined: Wed Oct 09, 2013 9:41 am

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

Post 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
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

Post 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!
fm2ahmed
Posts: 32
Joined: Wed Oct 09, 2013 9:41 am

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

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post by lmiltchev »

Let's see if you have anything weird with the symlinks you have:

Code: Select all

ls -lR /usr/local | grep ^l
Be sure to check out our Knowledgebase for helpful articles and solutions!
fm2ahmed
Posts: 32
Joined: Wed Oct 09, 2013 9:41 am

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

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post 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.
Former Nagios employee
Locked