Nagios cgis not working in fedora core 3?
When I try and use nagios in FC3 I get the following error message in my browser when I try and access the cgi's.
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. -------------------------------------------------------------------------------- Apache/2.0.52 (Fedora) Server at 192.168.0.5 Port 80 My Server Log reads the following (Last two lines) [Sun Mar 20 21:16:02 2005] [error] [client 192.168.0.219] (13)Permission denied: exec of '/usr/local/nagios/sbin/tac.cgi' failed, referer: http:/192.168.0.5/nagios/side.html [Sun Mar 20 21:16:02 2005] [error] [client 192.168.0.219] Premature end of script headers: tac.cgi, referer: http:/192.168.0.5/nagios/side.html *note - i had to remove the extra slash from http:/ because it wouldnt let me post otherwise* I've got the dir /usr/local/nagios/sbin (where the cgi's are located) set to permissions of 777 and I've checked over the ScriptAlias in my httpd.conf many times. I had it working in Fedora Core 2, but when running nagios, the files/folders in my www root dir wouldnt show up so I moved to FC3. As far as I know, i dont need to have nagios actually running for it to access the cgi's - on FC2 I was able to access them and get an error message saying that nagios might not be running or there were errors in the configuration - now i just get the error message above! |
I am having the same problem but with a Access Forbidden (403 Error) in Novell's SuSE Enterprise Linux 9
|
I actually fixed my problem - somthing to do with SE Linux that was accompanied with apache in FC3. I now get an error telling me it cant access cgi.cfg.... I never thought FC3 would be such a problem to get nagios working on!
|
dude, here is the fix.
http://issues.apache.org/bugzilla/show_bug.cgi?id=33504 See comment #3 for the fix. Modify the path to nagios cgi accordingly. |
thanks SO much for helpin me with this.. its worked, and i'm once again a happy nagios user!! :)
Thanks a bunch! I'll pass the word on to other people having the same problem. |
i still cant get nagios to work! :-(
Hi
I am facing the exact same problem...as you managed to solve yours i was wondering if you guys could please help me solve mine!! I have read the link at: http://issues.apache.org/bugzilla/show_bug.cgi?id=33504 But still no joy! - Could you please help me fix this problem...where should i start to debug the problem? I must point out that i have just recently installed nagios and as a result still getting used to it...i still dont understand the config (.cfg) files properly sooooo please try and help in any way you can. Thanks Sanj |
dude,
i dont believe that the problem lies with apache or its set up. the problem is with SELinux which is enabled by default in FC3. Either you disable the SELinux by running system-config-securitylevel and then rebooting the machine or enable Nagios to run under SELinux. I did the former. There is extensive documentation on Nagios on their website to configure it. At the very least configure hosts, services config. Dont forget to install nagios plugins from sourceforge.net Go through the steps and if you still have a problem, post the config files. good luck. |
I ran #system-config-securitylevel - The firewall setting is disabled.
At the moment the main difficulty i am facing is simply reading the cgi files....lets just forget about any monitoring for a sec and try to view cgi pages. Here's a new error message im gettin: Whoops! Error: Could not open CGI config file '/usr/local/nagios/etc/cgi.cfg' for reading! Here are some things you should check in order to resolve this error: 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. Make sure the user your web server is running as has permission to read the CGI config file. Make sure you read the documentation on installing and configuring Nagios thoroughly before continuing. If all else fails, try sending a message to one of the mailing lists. More information can be found at http://www.nagios.org. My webserver is running as apache which is part of the nagcmd group. Cgi files are in sbin After doing: #ls -l /usr/local/nagios i get: drwxrwxr-x 2 nagios nagcmd 4096 Apr 25 14:57 bin drwxr-xr-x 4 nagios nagcmd 4096 Apr 27 16:27 etc drwxr-xr-x 2 nagios nagcmd 4096 Apr 26 16:35 libexec drwxrwxr-x 2 nagios nagcmd 4096 Apr 27 13:33 sbin drwxrwxr-x 9 nagios nagcmd 4096 Apr 27 12:35 share drwxrwxr-x 3 nagios nagcmd 4096 Apr 27 16:50 var Any ideas??? - SORRY FOR THE HASSLE!!! P.S When i do: #su - apache /usr/local/nagios/sbin/status.cgi :- i get a message saying "This account is currently not available" and when i look in /etc/passwd i see: apache:x:48:48:Apache:/var/www:/sbin/nologin Could this be the reason for the account not being available and also the nagios cgi files not being read? |
1. you have disable selinux, dont worry about the firewall.
2. add "apache" user to "nagcmd" group 3. in the script you use to start nagios, make sure you point to correct configs and dirs. 4. test if apache is serving up the a page ( an html page, not cgi ) from nagios directory. 5. when you start nagios you will get error messages that are quite specific and make corrections as you go along. 6. one more thing, i used rpm to install nagios, this took care of most of the basic settings including adding entries for nagios. let me know how it goes. |
Hi
OK i have disabled the selinux option and it seems to be working now.... However i now face a different problem: I can't seem to monitor a windows machine. Could someone please show me/give me an example of what paramters i need in my services.cfg file inorder to view: Uptime, Disk Space C, CPU Load, Memuse and a service??? Its the check_command parameter i am having troble with. FYI here's one service which i tried but it dont seem to work: define service{ use generic-service ; Name of service template to use hostgroup_name windows-server service_description C: Drive is_volatile 0 check_period 24x7 max_check_attempts 4 normal_check_interval 5 retry_check_interval 1 contact_groups windows-admin notification_interval 960 notification_period 24x7 check_command check_local_disk!20%!10%!C } PLEASE NOTE: this is a remote windows 2003 machine which i want to monitor (i has got nsclient install and the nagios service is register and running). I have tried both 'check_local_disk' and 'check_disk' (as i thought you can't use check_local_disk command for remote machines?? BUT they dont work |
All times are GMT -5. The time now is 10:54 PM. |