• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

check whether the Tomcat server is up and running

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since you've mentioned crontab, I assume you want to do this on a Unix/Linux based system.
Are you familiar with wget and the mail program?
 
Chethan Sharma
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ben,

Thanks for the reply.

test.sh
======
1) ps -ef | grep java

root 3231 1 0 04:57:06 pts/13 1: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.
[ December 20, 2006: Message edited by: Chethan Sharma ]
 
Chethan Sharma
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ben,

Thanks for the reply.

test.sh
======
1) ps -ef | grep java

root 3231 1 0 04:57:06 pts/13 1: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,
[ December 20, 2006: Message edited by: Chethan Sharma ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was picturing using wget (tool for pulling web content from the command line) to hit a servlet or JSP running under tomcat, capturing stderr, and piping it into the mail command.... or something like that.

This would tell you, not only if there is a java process but that Tomcat is running properly and that the app in question is running.... at least well enough to respond.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic