Just a note.

When Tomcat crashes, is the pid still there?
Would it not be better to monitor the port?

See below
####
bibboek@ir1:/etc/monit$ sudo cat monitrc
set daemon  60
set logfile syslog facility log_daemon
set mailserver localhost
set mail-format { from: [email protected] }
set alert root@localhost
set httpd port 2812
     allow XXXXX:XXXXX

check process sshd with pidfile /var/run/sshd.pid
   start program  "/etc/init.d/ssh start"
   stop program  "/etc/init.d/ssh stop"
   if failed port 22 protocol ssh then restart

check host sunscholar with address scholar.sun.ac.za
   start program = "/etc/init.d/tomcat6 restart"
   stop program  = "/etc/init.d/tomcat6 stop"
   if failed port 80 proto http then restart
   alert [email protected]
   alert [email protected]
###

On 22 October 2012 16:10, Mark H. Wood <[email protected]> wrote:

> On Sat, Oct 20, 2012 at 03:21:34PM +0200, Hilton Gibson wrote:
> > Can you cc the list your monit configurations?
>
> Here's what I have so far.  There is much more I'd like to
> investigate, but I'm going slowly and feeling my way.
>
> savage monit.d # cat check-tomcat-7.rc
> check process tomcat-7 with pidfile /var/run/tomcat-7.pid
>         start program = "/etc/init.d/tomcat-7 restart"
>         stop program = "/etc/init.d/tomcat-7 stop"
> # below from
> http://fak3r.com/2010/10/07/howto-monitor-tomcat-with-monit-and-munin-in-debian/
>         if cpu > 60% for 2 cycles then alert
> #       if cpu > 80% for 5 cycles then restart
> #       if totalmem > 1500.0 MB for 5 cycles then restart
> #       if failed host 127.0.0.1 port 113 then alert
> #       if failed host 127.0.0.1 port 8180 then alert
> #       if 5 restarts within 5 cycles then timeout
> savage monit.d # cat notify.rc
> # notify.rc
> # monit alert recipients
>
> set alert [email protected]
> set alert [email protected]
>
> set alert [email protected]
> savage monit.d #
>
> I found that, on Gentoo Linux, you really need to use "restart" rather
> than "start", because OpenRC will have Tomcat in "crashed" state and
> "start" won't work.
>
> I have no idea why the commented-out parts above want to monitor the
> Ident port (113).
>
> Just the default process monitoring has caught several crashes in the
> last few weeks, and restarted Tomcat automatically each time.
>
> --
> Mark H. Wood, Lead System Programmer   [email protected]
> Asking whether markets are efficient is like asking whether people are
> smart.
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>
>


-- 
*Hilton Gibson*
Systems Administrator
JS Gericke Library
Room 1025D
Stellenbosch University
Private Bag X5036
Stellenbosch
7599
South Africa

Tel: +27 21 808 4100 | Cell: +27 84 646 4758
http://library.sun.ac.za
http://scholar.sun.ac.za
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to