check whether the Tomcat server is up and running

Hi,

Availability to check whether the Tomcat server is up and running all the time. Please let me know how to know the server availability: listening to Tomcat server port periodically (configured in crontab) and send out notification when there is no response on the port.

Thanks,

Sarayu.

[314 byte] By [Sarayu_Geethajalia] at [2007-11-26 13:07:59]
# 1
What is an algorithm?
prometheuzza at 2007-7-7 17:18:51 > top of Java-index,Other Topics,Algorithms...
# 2

Hi,

test.sh

======

1) ps -ef | grep java

root 32311 0 04:57:06 pts/131:41 /usr/jdk/j2sdk1.4.2_09/bin/java -Xms256m -Xmx512m -Djava.endorsed.dirs=/space/n

2) If server is running the above line will be displayed. So I will check whether the above line is displaying or not otherwise I will send mail

using

Mail login-name@hostname

Crontab

=======

Here i will call test.sh for every second.

I am not sure whether this is the right way or not.

So only I Posted this question to the forum.

Is there any other way to find whether the tomcat server is running or

not on Linux .

Thanks,

Sarayu

Message was edited by:

Sarayu_Geethajali

Sarayu_Geethajalia at 2007-7-7 17:18:51 > top of Java-index,Other Topics,Algorithms...
# 3

Ideas:

1) check whether a process is listening on the given port, o.e. you can connect to it

2)

a)

include a diagnostic servlet into your application which ckecks the infrastructure which is need by the application, like checking all database, LDAP connetions etc. whatever is needed

b) periodically peruse that diagnostics servlet for the health of your application

BIJ001a at 2007-7-7 17:18:51 > top of Java-index,Other Topics,Algorithms...