Page 1 of 1

Confused. Error regarding cgi.cfg and permission.

Posted: Fri Jan 27, 2012 9:42 am
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.

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

Posted: Fri Jan 27, 2012 4:22 pm
by mguthrie
Can you verify the correct location of the cgi.cfg in the main nagios.cfg file?

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

Posted: Mon Jan 30, 2012 8:34 am
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

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

Posted: Mon Jan 30, 2012 2:28 pm
by nscott
Do you have SELinux disabled?

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

Posted: Mon Jan 30, 2012 3:18 pm
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.

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

Posted: Tue Jan 31, 2012 10:07 am
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.