LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 04-11-2008, 09:00 AM   #1
shankarLe
Member
 
Registered: Apr 2006
Location: Hyderabad,India
Distribution: RedHat EL 4
Posts: 31

Rep: Reputation: Disabled
Nagios to monitor apache


Hi,

I did set up nagios for my organization by reading the documentation. i was able to add hosts to it and they seems to be up and running fine. I also define service (apache ) for all hosts and they reported as Critical though the apache for all hosts was working fine. here is the service state information

Current Status: CRITICAL (for 0d 0h 52m 13s)
Status Information: Connection refused
HTTP CRITICAL - Unable to open TCP socket

I tried to restart apache service many times, but it won't work.

Can any one please suggest me what or where could be the wrong ?

Thanks
shankar
 
Old 04-11-2008, 11:16 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,277
Blog Entries: 54

Rep: Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852
Quote:
Originally Posted by shankarLe View Post
Status Information: Connection refused
HTTP CRITICAL - Unable to open TCP socket
Endpoint has port firewalled?
 
Old 04-12-2008, 11:36 AM   #3
shankarLe
Member
 
Registered: Apr 2006
Location: Hyderabad,India
Distribution: RedHat EL 4
Posts: 31

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
Endpoint has port firewalled?
Thank you for quick reply

Do you mean we should open port for apache where it's listening in the firewall?

let me explain more,

lnxtest1 - is the linux box where nagios installed

web1
web2 - are the linux boxes that has apache up and running on port 996 (not standard 80 port)

can you please tell me where we need to open port or what should we do to correct the problem

Thanks in advance

-shankar
 
Old 04-12-2008, 07:58 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,277
Blog Entries: 54

Rep: Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852
Quote:
Originally Posted by shankarLe View Post
linux boxes that has apache up and running on port 996 (not standard 80 port)
How would your commandline look like if you're using Nagios 'check_http' manually to poll "web1" on port 996?
If that works, does that command differ from the one used in checkcommands.cfg?
 
Old 04-14-2008, 05:37 AM   #5
shankarLe
Member
 
Registered: Apr 2006
Location: Hyderabad,India
Distribution: RedHat EL 4
Posts: 31

Original Poster
Rep: Reputation: Disabled
Hello,

Here is what I found after reviewing your solution.

[nagios@lnxtestsrv1 libexec]$./check_http -I ipofserverwhereapacheinstalled -p 999
HTTP OK HTTP/1.1 200 OK - 297 bytes in 0.001 seconds |time=0.000904s;;;0.000000 size=297B;;;0

The above command seems ok. This is what I have in commands.cfg

[nagios@lnxtestsrv1 objects]$ pwd
/home/nagios/nagios/etc/objects

# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}
one more interesting thing, if I change port from 999 to default 80. The nagios interface works for apache. I mean, there will be no critical error for apache. All looks in Green color. So there must be some problem if I use port 999 for apache than 80. But I have multiple apache instance running on different ports for different users on the system. Please advice any solution..

let me know if you need any info..

Thanks
 
1 members found this post helpful.
Old 04-14-2008, 12:46 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,277
Blog Entries: 54

Rep: Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852
You see the 'check_http' command definition allows for one arg ($ARG1$), so if that one is not taken where you defined the service, then you could use something like check_command check_http!"-p 999". If the arg is taken then you could clone the command definition, either with a static "-p 999" or something like "-p $ARG2$" (which implies arg1 is *always* taken though).
 
1 members found this post helpful.
Old 04-22-2008, 12:06 AM   #7
shankarLe
Member
 
Registered: Apr 2006
Location: Hyderabad,India
Distribution: RedHat EL 4
Posts: 31

Original Poster
Rep: Reputation: Disabled
Thanks

Thank you unSpawn

Sorry for the delay in response. It seems to be working fine now. But I have apache instanaces (multiple instances on different ports) on the single server. How can I define that in the services.cfg file.

One more thing, this is what I defined in the contact.cfg,

define contact{
contact_name shankar
alias Shankar
host_notifications_enabled 1
service_notifications_enabled 1
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,u,r
service_notification_commands check_http,check_ftp,check_ping
host_notification_commands check-host-alive
email shankar@myemaildomain.net, root@localhost.localdomain
can_submit_commands 1
}

and the contact groups,

define contactgroup{
contactgroup_name admins
alias System Administrators
members shankar,nagiosadmin
}
But when the service failure, I happened to receive alters to my email addresses defined in the contact. I did not receive any of those emails to me. Do I need to set up sendmail service on the localhost (i.e lnxtestsrv1) where I set up nagios?

I will be able to see the emails which are sent to nagios@lnxtestsrv1 just fine, but not to shankar@myemaildomain.net and root@localhost.localdomain.

Please help me..

Thanks
shankar
 
Old 04-25-2008, 05:11 AM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,277
Blog Entries: 54

Rep: Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852Reputation: 2852
Quote:
Originally Posted by shankarLe View Post
I have apache instanaces (multiple instances on different ports) on the single server. How can I define that in the services.cfg file.
The same way like the example I already gave.


Quote:
Originally Posted by shankarLe View Post
Do I need to set up sendmail service on the localhost (i.e lnxtestsrv1) where I set up nagios?
Yes.
 
Old 04-29-2008, 01:58 AM   #9
shankarLe
Member
 
Registered: Apr 2006
Location: Hyderabad,India
Distribution: RedHat EL 4
Posts: 31

Original Poster
Rep: Reputation: Disabled
Thanks

Quote:
Originally Posted by unSpawn View Post
The same way like the example I already gave.



Yes.
That helps, thank you
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
nagios plug-in to monitor apache velvel Linux - Newbie 3 05-23-2008 12:47 PM
Apache, nagios and 403 forbidden gfem Fedora 1 10-04-2007 02:43 PM
Nagios Daemon, PID not found but rc.nagios runs agentc0re Slackware 1 07-03-2007 02:47 PM
LXer: Nagios 2.5 and Oreon 1.3 (Nagios web front end) installation with screenshots LXer Syndicated Linux News 0 08-11-2006 05:33 PM
LXer: Nagios and Oreon (Nagios web front end) installation and Configuration LXer Syndicated Linux News 0 07-18-2006 08:33 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration