View previous topic :: View next topic |
Author |
Message |
Ctrl+Alt+Del Guru
Joined: 04 Jul 2004 Posts: 326 Location: .de
|
Posted: Tue Nov 29, 2005 2:31 pm Post subject: Nagios: Could not open CGI config file [SOLVED] |
|
|
Hello fellow Gentoo Users
I am currently at a loss, i followed the docs on nagios.org and https://forums.gentoo.org/viewtopic-t-262408.html for the mysql instructions.
The Daemon starts alright (yes, the pre-flight check goes trough without any errors or wanrings), but i cannot get the webinterface to work.
Logging in works fine but clicking on any menulink on the left brings up:
Error: Could not open CGI config file '/etc/nagios/cgi.cfg' for reading!
Here are some things you should check in order to resolve this error:
1. Make sure you've installed a CGI config file in its proper location. See the error message about for details on where the CGI is expecting to find the configuration file. A sample CGI configuration file (named cgi.cfg) can be found in the sample-config/ subdirectory of the Nagios source code distribution.
2. Make sure the user your web server is running as has permission to read the CGI config file.
The File cgi.cfg does exist (in /etc/nagios/) , is based on /usr/share/doc/nagios-core-1.3/sample-configs/, belongs to nagios:nagios and is chmodded 644. So the user apache should be able to read the file properly. I have also added the apache user to the nagios group, but no success. I tried chmodding it to 777 as well (shouldn't be necessary, but who knows.)
I have found a few mailinglist and forum reports from fedora users having a similar problem, in their case it worked with apache authentication disabled. Even though that doesn't make any sense to me, i tried it. Disabling Auth didn't change anything.
Neither the Apache error logs nor the nagios logs show any errors when trying to access any of the Nagios Pages.
Any Ideas where to look for an error?
Last edited by Ctrl+Alt+Del on Thu Mar 30, 2006 7:25 pm; edited 1 time in total |
|
Back to top |
|
|
gondolin Apprentice
Joined: 09 Apr 2003 Posts: 158
|
Posted: Thu Jan 12, 2006 9:27 am Post subject: |
|
|
I'm having the same problem, did you got it working ? |
|
Back to top |
|
|
Ctrl+Alt+Del Guru
Joined: 04 Jul 2004 Posts: 326 Location: .de
|
Posted: Thu Jan 12, 2006 10:47 am Post subject: |
|
|
Nope i left it aside. Nagios 2.0rc1 went ~x86 a few days ago, maybe i'm gonna give that a shot |
|
Back to top |
|
|
gondolin Apprentice
Joined: 09 Apr 2003 Posts: 158
|
Posted: Thu Jan 12, 2006 11:38 am Post subject: |
|
|
I have no luck with 2.0rc1
just found it on 2.1rc1 , the permissions on /etc/nagios are wrong should be 755 |
|
Back to top |
|
|
soth Apprentice
Joined: 12 Sep 2003 Posts: 207
|
Posted: Thu Jan 26, 2006 9:47 pm Post subject: |
|
|
Same permissionsproblem for me on 2.0_rc2
chmod 755 /etc/nagios...
now I have another problem:
It appears as though you do not have permission to view information for any of the hosts you requested...
If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.
tried with asterisk as to let whoever was authenticated get access to all of nagios, but it doesn't work.
No messages in apachelog or in /var/nagios/nagios.log either.
Permissions on /usr/nagios/sbin seems right (755), and so does the files in there... _________________ - Never argue with an idiot. They just drag you down to your level and beat you with experience.
Join the adopt an unanswered post initiative today |
|
Back to top |
|
|
Ctrl+Alt+Del Guru
Joined: 04 Jul 2004 Posts: 326 Location: .de
|
Posted: Fri Jan 27, 2006 12:21 am Post subject: |
|
|
It still does not work for me with rc2 and permissions set to 755.
I do not have the faintest idea on what to do with nagios any more |
|
Back to top |
|
|
soth Apprentice
Joined: 12 Sep 2003 Posts: 207
|
Posted: Fri Jan 27, 2006 6:33 am Post subject: |
|
|
Did you check the apache conf?
you need something like this:
Code: | <IfDefine NAGIOS>
ScriptAlias /nagios/cgi-bin/ /usr/nagios/sbin/
<Directory "/usr/nagios/sbin/">
AllowOverride AuthConfig
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
Alias /nagios /usr/nagios/share/
<Directory "/usr/nagios/share">
AllowOverride AuthConfig
Order allow,deny
Allow from all
</Directory>
</IfDefine>
|
it's important that you have the AllowOverride AuthConfig and Options ExecCGI.
Furthermore, you need .htaccess in two places:
and
The contents of them are in the docs...
Have you got all that? _________________ - Never argue with an idiot. They just drag you down to your level and beat you with experience.
Join the adopt an unanswered post initiative today |
|
Back to top |
|
|
Ctrl+Alt+Del Guru
Joined: 04 Jul 2004 Posts: 326 Location: .de
|
Posted: Thu Mar 30, 2006 7:24 pm Post subject: |
|
|
Ok i finally gave it another shot and figured the problem out.
i chmodded all the files in /etc/nagios 755 but not the directory itself, pages are now loading properly
I feel soooo retarted |
|
Back to top |
|
|
neildotwilliams n00b
Joined: 02 Jan 2005 Posts: 4 Location: UK
|
Posted: Wed May 10, 2006 7:20 pm Post subject: Folder access |
|
|
I had to change the ownership of the folder.
chown apache:apache /etc/nagios
Well it worked for me! |
|
Back to top |
|
|
|