Right...that was my point.  I don't see how you can have a Java application
running via Tomcat that takes action if Tomcat is "down".  They're mutually
exclusive, especially since "down" typically means "brick wall...cannot
process" not "I am shutting down now".  If Tomcat is "down" than nothing is
going to process.  As you pointed out, you'd have to use wget or something
similar, external to Tomcat, to test if Tomcat could render output.

I guess if you wanted to create a Java class that uses URLConnection and run
it from the command line with java in a cron job or something that would
work, but that seems like a lot of work just to do something fairly simple.

John


> -----Original Message-----
> From: Mike Jackson [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 13, 2003 2:34 PM
> To: Tomcat Users List
> Subject: RE: Checking if Tomcat is up
> 
> 
> I just use a shell script, which looks something like this:
> 
>       #!/bin/sh
>       while [ true ]
>       do
>               sleep 300
> 
>               COUNT=`ps -fdae | grep tomcat | wc -l`
>               if [ $COUNT > 0 ]; then
>                       continue;
>               else
>                       echo "Tomcat down at `date`" | mail 
> pager@somewhere -s "tomcat problem"
>               fi
> 
>               wget http://ip/app/index.jsp > /dev/null 2>&1
>               if [ $? = 0 ]; then
>                       continue;
>               else
>                       echo "Tomcat not responding at `date`" 
> | mail pager@somewhere -s
> "possible tomcat problem"
>               fi
>       done
> 
> Some of the syntax may be incorrect, you'd have to fix it if 
> you cared.  I'm
> typing this
> from memory.
> 
> --mikej
> -=-----
> mike jackson
> [EMAIL PROTECTED]
> 
> > -----Original Message-----
> > From: Scott Purcell [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, January 13, 2003 11:27 AM
> > To: Tomcat Users List
> > Subject: RE: Checking if Tomcat is up
> >
> >
> > That sounds good, you could probably create a small app with
> > threads which uses the url class to connect to your tomcat, try
> > and read a url. If that throws a error, your down, else your up.
> > I use the url class quite a bit to ensure servers are alive
> > before using xml-rpc on them.
> >
> >
> > Scott
> >
> > -----Original Message-----
> > From: Abhijat Thakur [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, January 13, 2003 1:17 PM
> > To: Tomcat Users List
> > Subject: RE: Checking if Tomcat is up
> >
> >
> > I have background threads running which keep checking if Tomcat
> > is up or not. Lets say Tomcat hangs up or something then these
> > background threads call to shutdown the application and tomcat
> > clean up all the processes. This is to Monitor if my application
> > is working properly.
> >
> > thanks
> >
> > abhijat
> >
> > -----Original Message-----
> > From: Turner, John [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, January 13, 2003 10:57 AM
> > To: 'Tomcat Users List'
> > Subject: RE: Checking if Tomcat is up
> >
> >
> >
> > Myabe I'm missing something, but if Tomcat is down how can your
> > application
> > run to be checking that Tomcat is up?  Your application 
> needs Tomcat to
> > execute.
> >
> > John
> >
> >
> > > -----Original Message-----
> > > From: Abhijat Thakur [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, January 13, 2003 1:55 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Checking if Tomcat is up
> > >
> > >
> > >
> > > Is it pssible to check intemittently through my java
> > > application if my Tomcat server is up ? What can i check for
> > > to see if my Tomcat server is up. The scenaruio is that if
> > > something happens to Tomcat where my it hangs up i should
> > > ring my application down, for that i have to check
> > > intermittently if my Tomcat is up. What is it that i can
> > > check to see if Tomcat is up ?
> > >
> > > thanks
> > >
> > > abhijat
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to