Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 39530 invoked from network); 20 Mar 2011 11:21:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Mar 2011 11:21:25 -0000 Received: (qmail 10889 invoked by uid 500); 20 Mar 2011 11:21:22 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 10715 invoked by uid 500); 20 Mar 2011 11:21:22 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 10706 invoked by uid 99); 20 Mar 2011 11:21:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Mar 2011 11:21:22 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of darryl.lewis@unsw.edu.au designates 149.171.97.16 as permitted sender) Received: from [149.171.97.16] (HELO smtp-dist.unsw.edu.au) (149.171.97.16) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Mar 2011 11:21:15 +0000 Received: from INFPACM003.services.comms.unsw.edu.au (INFPACM003.services.comms.unsw.edu.au [149.171.193.26]) by smtp-dist.unsw.edu.au (8.13.6/8.13.6) with ESMTP id p2KBKZlM002296; Sun, 20 Mar 2011 22:20:35 +1100 (EST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuAAAPt/hU2VqzgmgWdsb2JhbACCYJVdjToUAQEWJiW3FIhrhWMEjGc X-IronPort-AV: E=Sophos;i="4.63,214,1299416400"; d="scan'208,217";a="103194978" Received: from infpwex005.ad.unsw.edu.au ([149.171.56.38]) by INFPACM003.services.comms.unsw.edu.au with ESMTP; 20 Mar 2011 22:00:48 +1100 Received: from INFPWEC004.ad.unsw.edu.au ([149.171.135.36]) by infpwex005.ad.unsw.edu.au ([149.171.56.38]) with mapi; Sun, 20 Mar 2011 22:20:34 +1100 From: Darryl Lewis To: Tomcat Users List , Tomcat Users List Date: Sun, 20 Mar 2011 22:20:33 +1100 Subject: Re: How to detect down of tomcat. Thread-Topic: How to detect down of tomcat. Thread-Index: Acvm76KclLBpTdQeQoaUCrE05cSOZwAATEs3 Message-ID: In-Reply-To: <4D85E0C6.800@ice-sa.com> Accept-Language: en-US, en-AU Content-Language: en X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-AU Content-Type: multipart/alternative; boundary="_000_C9AC2E31E330darryllewisunsweduau_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_C9AC2E31E330darryllewisunsweduau_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable The other problem will be that tomcat is running, but the application is no= t responding. There may be nothing in the logs for this, and this is one of= my most common issues. In this case, I use some custom scripts to simulate a log in and check for = an expected string in the return. On 20/03/11 10:11 PM, "Andr=E9 Warnier" wrote: The basic problem with "abnormal termination", is that whatever you may thi= nk of, may not be called, if the termination is really abnormal. And also : define "abnormal". Hide wrote: > Hi, Darryl. > > Thanks for your advice. > > My explanation seems to have been bad. > I explain it a little more. > > It is a method to output the information of the abnormal termination in > "catalina.log" that I want to know. > Would you teach it if you know some method? > > Thank you. > > ----- Original Message ----- From: "Darryl Lewis" > > To: "Tomcat Users List" > Sent: Sunday, March 20, 2011 12:17 PM > Subject: Re: How to detect down of tomcat. > > > You could write something similar using windows powershell. Do you have > that installed on your server? > > > On 20/03/11 2:14 PM, "Hide" wrote: > > Hi, Darryl. > > Thanks for your advice. > > Your script looks like very useful. > But in my case, tomcat is running on Microsoft Windows. > I am looking for a method to detect the down of tomcat by log file. > > > ----- Original Message ----- > From: "Darryl Lewis" > To: "Tomcat Users List" > Sent: Sunday, March 20, 2011 12:00 PM > 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=3D`tomcat down; date` > address=3D"me@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" 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-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org --_000_C9AC2E31E330darryllewisunsweduau_--