Confused. Error regarding cgi.cfg and permission.

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
ajnagiosadmin
Posts: 5
Joined: Fri Jan 27, 2012 9:07 am

Confused. Error regarding cgi.cfg and permission.

Post by ajnagiosadmin »

This one seems simple.. but I've been hacking away at it for a few days and no resolution.

Logging in to nagios web page is fine but when clicking on anything in the "Current Status" brings up a page with an error:"Error: Could not open CGI config file '/etc/nagios/cgi.cfg' for reading!"

I had found some corruption of the file (lots of "@"'s added to the file) but replaced it with a clean backup, same message. Changed the permissions to 777, fooled with changing the owner of the file (currently at nagios:nagios) and that didn't make a difference.

Kind of at my wits end so any help would be appreciated.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Confused. Error regarding cgi.cfg and permission.

Post by mguthrie »

Can you verify the correct location of the cgi.cfg in the main nagios.cfg file?
ajnagiosadmin
Posts: 5
Joined: Fri Jan 27, 2012 9:07 am

Re: Confused. Error regarding cgi.cfg and permission.

Post by ajnagiosadmin »

Yep.. the error shows it is expecting it to be:
Error: Could not open CGI config file '/etc/nagios/cgi.cfg' for reading!

And the location is:
pwd; ls -al cgi.cfg
/etc/nagios
-rwxrwxrwx 1 nagios nagios 163840 Jan 27 14:00 cgi.cfg
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Confused. Error regarding cgi.cfg and permission.

Post by nscott »

Do you have SELinux disabled?
Nicholas Scott
Former Nagios employee
ajnagiosadmin
Posts: 5
Joined: Fri Jan 27, 2012 9:07 am

Re: Confused. Error regarding cgi.cfg and permission.

Post by ajnagiosadmin »

Nope.. no SE Linux.
(From SELinux's config)
SELINUX=disabled

And.. this did work prior to trying to switch to using LDAP. Once I backed the changes out for that, this started happening.
ajnagiosadmin
Posts: 5
Joined: Fri Jan 27, 2012 9:07 am

Re: Confused. Error regarding cgi.cfg and permission.

Post by ajnagiosadmin »

Thanks all for you help but I needed to get this operational again so I re-installed nagios and restored my configs, all is working again. Sorry I couldn't find/give a conclusive resolution.
Locked