nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Tomcat status monitoring with Nagios

This is a discussion on Tomcat status monitoring with Nagios within the Web servers forums, part of the Mastering Servers category; Hi, I am using tomcat version 5.5.9 and nagios for monitoring services and harware resources in my office environment. Can ...

Register free or login to your existing account and remove all advertisements.


Go Back   nixCraft Linux Forum > Mastering Servers > Web servers

Linux answers from nixCraft.


Web servers Discussion on Apache, Nginx and Lighttpd HTTP/web server and configuration issues.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-22-2009, 10:06 PM
Junior Member
User
 
Join Date: Sep 2008
OS: RHEL
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
samengr is on a distinguished road
Default Tomcat status monitoring with Nagios

Hi,

I am using tomcat version 5.5.9 and nagios for monitoring services and harware resources in my office environment. Can someone help me to monitor tomcat status remotely from nagios server? Is tomcat up or down and throw email if tomcat is down? I know there isnt any builtin pluggin so probably it would be like to write a script and then get its out put.

we can check the status of tomcat in many ways like

1. $ ps fax | grep tomcat | grep Djav

or

2. netstat -ltn | grep 8085
note: my tomcat is listening on 8085.

So any suggestion how to integrate it with nagios?

Many thanks in advance.

Sam.
Reply With Quote
  #2 (permalink)  
Old 10-22-2009, 11:02 PM
jaysunn's Avatar
Powered By Linux
User
 
Join Date: Apr 2009
Location: 41.332032,-73.089775
OS: RHEL - OSX
Posts: 594
Thanks: 61
Thanked 78 Times in 70 Posts
Rep Power: 10
jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold
Default

Hello,

You can easily achieve this with the default nagios check_http plugin. This plugin ships with the nagios install.

What you need to do is define a check like this. Below is the usage:


Code:
check_http -H hostname -p 8085 -w 4 -c 10

Here is the actual command defined for you:

Code:
define command{
command_name    Check_Http_Tomcat
command_line    $USER1$/check_http -H hostname -p 8085  -w 4 -c 10
}

Code:
[root@radio5 nagios]# ./check_http -H hostname -w 4 -c 10
OK - HTTP/1.1 302 Found - 0.003 second response time |time=0.002857s;4.000000;10.000000;0.000000 size=563B;;;0
[root@radio5 nagios]#


Code:
Usage: check_http -H <vhost> | -I <IP-address> [-u <uri>] [-p <port>]
       [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]
       [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]
       [-s string] [-l] [-r <regex> | -R <case-insensitive regex>] [-P string]
       [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>] [-A string]
       [-k string] [-S] [-C <age>] [-T <content-type>]
NOTE: One or both of -H and -I must be specified
__________________
Have a look at what I have been working on
http://www.shellasaurus.com

Last edited by jaysunn; 10-22-2009 at 11:09 PM. Reason: added hostname - added warnings
Reply With Quote
  #3 (permalink)  
Old 10-23-2009, 04:24 PM
Junior Member
User
 
Join Date: Sep 2008
OS: RHEL
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
samengr is on a distinguished road
Default

Quote:
Originally Posted by jaysunn View Post
Hello,

You can easily achieve this with the default nagios check_http plugin. This plugin ships with the nagios install.

What you need to do is define a check like this. Below is the usage:


Code:
check_http -H hostname -p 8085 -w 4 -c 10
Here is the actual command defined for you:

Code:
define command{
command_name    Check_Http_Tomcat
command_line    $USER1$/check_http -H hostname -p 8085  -w 4 -c 10
}
Code:
[root@radio5 nagios]# ./check_http -H hostname -w 4 -c 10
OK - HTTP/1.1 302 Found - 0.003 second response time |time=0.002857s;4.000000;10.000000;0.000000 size=563B;;;0
[root@radio5 nagios]#
Code:
Usage: check_http -H <vhost> | -I <IP-address> [-u <uri>] [-p <port>]
       [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]
       [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]
       [-s string] [-l] [-r <regex> | -R <case-insensitive regex>] [-P string]
       [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>] [-A string]
       [-k string] [-S] [-C <age>] [-T <content-type>]
NOTE: One or both of -H and -I must be specified




Thanks forr your reple mate. I had configured it before checking this email spent my more than 1 hour to do this wich i could check it before . Just a quick check what does it mean by "-w 4 -c 10" here? I know w is for warning and c is for critical but 4 and 10 couldnt understand it.

Thanks anyway.
Reply With Quote
  #4 (permalink)  
Old 10-23-2009, 05:16 PM
jaysunn's Avatar
Powered By Linux
User
 
Join Date: Apr 2009
Location: 41.332032,-73.089775
OS: RHEL - OSX
Posts: 594
Thanks: 61
Thanked 78 Times in 70 Posts
Rep Power: 10
jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold jaysunn is a splendid one to behold
Default

Hello My Friend,


Quote:
Just a quick check what does it mean by "-w 4 -c 10" here? I know w is for warning and c is for critical but 4 and 10 couldnt understand it.
Please see below:

Code:
[root@radio5 nagios]# ./check_http -H hostname -w 4 -c 10
OK - HTTP/1.1 302 Found - 0.003 second response time |time=0.002857s;4.000000;10.000000;0.000000 size=563B;;;0
[root@radio5 nagios]#
Please note the red font change. This is where you will get your answer. This is the time that the plugin took to get a response / ping reply from the host. As you said, if the threshold is above 4.000000 it throughs a warning. If above 10,000000 it throughs critical.

My test gave a time=0.002857s Which gave the OK flag.

HTH,

Jaysunn
__________________
Have a look at what I have been working on
http://www.shellasaurus.com
Reply With Quote
Reply

Tags
java , java server , linux , monitor tomcat server , monitoring , nagios , networking , tomcat


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
how do i configure nagios-1.2-2.0.rh9.rf.i386.rpm & nagios-plugins-1.3.1-10.rh to RH9 fadu Linux software 1 08-31-2009 06:53 AM
mrtg apache tomcat blackj CentOS / RHEL / Fedora 1 08-08-2008 01:14 AM
Nagios on tomcat? Vince-0 Linux software 0 04-22-2008 02:30 PM
hda: status timeout: status=0xd0 { Busy } surmandal Linux hardware 3 03-24-2008 09:16 PM
Monitoring FreeBSD Jails for Updates with Nagios? igno2k All about FreeBSD/OpenBSD/NetBSD 0 11-12-2007 09:05 PM


All times are GMT +5.5. The time now is 01:03 PM.


Powered by vBulletin® Version 3.8.4 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38