with windoze under cygwin you may want to sub ps -ef with netstat assuming TC
port is 8080
if [ `netstat -ab|grep 8080|grep -v grep|wc -l` -lt 1 ]
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung.
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est
interdite. Ce message sert à l'information seulement et n'aura pas n'importe
quel effet légalement obligatoire. Étant donné que les email peuvent facilement
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité
pour le contenu fourni.
> From: darryl.le...@unsw.edu.au
> To: users@tomcat.apache.org
> Date: Sun, 20 Mar 2011 14:00:49 +1100
> Subject: Re: How to detect down of tomcat.
>
> Put this in a cronjob to fire every minute
>
> #!/bin/sh
> if [ `ps -ef|grep tomcat|grep -v grep|wc -l` -lt 1 ]
> then
> subject=`tomcat down; date`
> address="m...@domain.com"
> ps -ef>att.txt
> mail -s "$subject" "$addr" -- -fno-reply@yourdomain< att.txt
> fi
>
>
> Fill in the address with your email address, and you can also pipe an
> attachment
>
> For myself, I have scripts that detects when the service is down, sends me an
> email, then tries to restart it, then will email if it has managed to recover
> it. If it can't restart it after 5 minutes, then I get an SMS.
> In the morning, I can quickly see if it failed overnight, and my beauty rest
> only gets disturbed in the really bad cases.
>
> On 20/03/11 1:38 PM, "Hide" <hide3...@ob4.aitai.ne.jp> wrote:
>
> How to detect down of tomcat.
>
> Helo.
>
> My environment is tomcat7, java1.6, windows.
>
> When process of tomcat terminated abnormally,
> is there any method or setting that output the abnormal termination to a log
> file?
>
> If there is it, please let me know.
>
> tomcat is the premise that is not service of windows, but even service is
> good.
>
> The motive that wants to know such a thing is because I want to detect down
> of tomcat in automatically without human operation.
> I set a file and keyword in a log monitor tool, and it detects down of
> tomcat automatically.
>
> Thanks for your advice.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>