LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-20-2005, 11:40 PM   #1
Jamesk5
LQ Newbie
 
Registered: Feb 2005
Location: Australia
Distribution: Debian, CentOS
Posts: 25

Rep: Reputation: 15
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!
 
Old 03-31-2005, 06:03 PM   #2
cuiguy
LQ Newbie
 
Registered: Mar 2005
Posts: 2

Rep: Reputation: 0
I am having the same problem but with a Access Forbidden (403 Error) in Novell's SuSE Enterprise Linux 9
 
Old 04-01-2005, 04:11 AM   #3
Jamesk5
LQ Newbie
 
Registered: Feb 2005
Location: Australia
Distribution: Debian, CentOS
Posts: 25

Original Poster
Rep: Reputation: 15
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!
 
Old 04-04-2005, 03:28 PM   #4
laltopi
Member
 
Registered: Jan 2004
Location: Silicon Valley
Distribution: Fedora[2-3]
Posts: 44

Rep: Reputation: 15
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.
 
Old 04-05-2005, 09:15 AM   #5
Jamesk5
LQ Newbie
 
Registered: Feb 2005
Location: Australia
Distribution: Debian, CentOS
Posts: 25

Original Poster
Rep: Reputation: 15
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.
 
Old 04-27-2005, 09:31 AM   #6
nagiosnewbie
LQ Newbie
 
Registered: Apr 2005
Posts: 3

Rep: Reputation: 0
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
 
Old 04-27-2005, 10:44 AM   #7
laltopi
Member
 
Registered: Jan 2004
Location: Silicon Valley
Distribution: Fedora[2-3]
Posts: 44

Rep: Reputation: 15
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.
 
Old 04-27-2005, 11:00 AM   #8
nagiosnewbie
LQ Newbie
 
Registered: Apr 2005
Posts: 3

Rep: Reputation: 0
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?
 
Old 04-27-2005, 10:03 PM   #9
laltopi
Member
 
Registered: Jan 2004
Location: Silicon Valley
Distribution: Fedora[2-3]
Posts: 44

Rep: Reputation: 15
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.
 
Old 04-29-2005, 06:26 AM   #10
nagiosnewbie
LQ Newbie
 
Registered: Apr 2005
Posts: 3

Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora Core 3 Up and working, but..... TCP/IP Linux - Distributions 2 05-19-2005 03:08 PM
Nagios GD related CGIs not working! masterJ Linux - Software 3 01-05-2005 11:39 AM
WEP not working with Fedora Core v1.0 fanson Linux - Wireless Networking 3 06-19-2004 02:21 AM
Getting RhythmBox working with Fedora Core djauger Linux - Newbie 0 03-09-2004 03:13 AM
nagios cgis on redhat 8 aetengoku Linux - Software 1 01-23-2004 10:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration