I need to create a heartbeat program to periodicly check if a web server and a servlet engine ( Apache & tomcat) is running properly . The two way I thought is 1. to send HTTPRequest through command line and check if it can be handled properly. ( but how to issue this command and how to delete the sessions created by this kind of process ? ) 2. to check pid contends to see if those two processes are running ( is it possible that a stale process could be detected and reported ? ) Any advice would be great appreciated. Lily
Put a test servlet somewhere on the site. Write a stand alone application that connects to the servlet using a URLConnection (i.e. checks to see if the server is listening on port 80, for instance) and see it the servlet responds. The various statuses, 500 errors, etc that you'll get back should tell you what you need to know. Checking to see if the server process is running doesn't tell you if actual requests are getting processed (which is the bottom line really).
Joined: Jan 15, 2002
Thank you very much,Sean. By the way, I am wondering if a process died, its process id would be gone. Is it correct ? Is there any possiblity that a process id hangs around even after the process it represents has died ? Thanks again. Lily