<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008>Hi Rajeev,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008>&nbsp;&nbsp;&nbsp; Monit its simple and yet 
powerful.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008>&nbsp;&nbsp;&nbsp; This is how the monitrc file looks 
like to monitor a squeak image:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008>###############################################################################<BR>## 
Monitoring DEVELOPMENT Service 
OJ7WRE<BR>###############################################################################</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008>&nbsp;check process OJ7WRE with pidfile 
/var/run/services/OJ7WRE.pid<BR>&nbsp;group server<BR>&nbsp;start program = 
"/etc/init.d/OJ7WRE start"<BR>&nbsp;stop program = "/etc/init.d/OJ7WRE 
stop"</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008>&nbsp;if cpu &gt; 60% for 2 cycles then 
alert<BR>&nbsp;if cpu &gt; 80% for 5 cycles then restart<BR>&nbsp;if totalmem 
&gt; 200.0 MB for 2 cycles then restart</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008>&nbsp;if loadavg(5min) greater than 10 for 8 cycles 
then restart<BR>&nbsp;if 5 restarts within 5 cycles then 
timeout</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008>###############################################################################</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008>&nbsp;&nbsp;&nbsp;&nbsp;the start and stop script is 
doing more or less what you are doing manually. I send a kill -15 to close image 
gently. Also I needed to make the pid file when the image starts and remove 
before image quits. I have an object in the image dedicated to startup and 
shutdown production stuff inside the image.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008>&nbsp;&nbsp;&nbsp; For a "more monitored" services you 
can make monit to send you an email to your cell phone if it reach some point 
(like a service restart or fail to start or CPU 100% for more than 5 min&nbsp;or 
apache is down or whatever).</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=671444220-06022008>&nbsp;&nbsp;&nbsp; cheers,</SPAN></FONT></DIV>
<DIV><FONT face="Trebuchet MS" color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV align=left><SPAN class=250542422-20122006>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt" align=left><?xml:namespace prefix 
= st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:PersonName 
ProductID="Sebastian Sastre&#13;" w:st="on"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'">Sebastian 
Sastre<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" 
/><o:p></o:p></SPAN></st1:PersonName></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN 
lang=ES-AR 
style="FONT-SIZE: 7.5pt; FONT-FAMILY: Verdana; mso-ansi-language: ES-AR"></SPAN><SPAN 
lang=ES-AR style="mso-ansi-language: ES-AR"><o:p><FONT 
face=Verdana></FONT></o:p></SPAN></P></SPAN></P></DIV><BR>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=es dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>De:</B> seaside-bounces@lists.squeakfoundation.org 
  [mailto:seaside-bounces@lists.squeakfoundation.org] <B>En nombre de </B>Rajeev 
  Lochan<BR><B>Enviado el:</B> Miércoles, 06 de Febrero de 2008 
  17:36<BR><B>Para:</B> Seaside - general discussion<BR><B>Asunto:</B> [Seaside] 
  Monit on Ubuntu / Debian to monitor Seaside images<BR></FONT><BR></DIV>
  <DIV></DIV>Hi,<BR>I have been working towards setting up a dedicated server 
  (Ubuntu) to host my Seaside app as per Ramon's Blog <A 
  href="http://onsmalltalk.com/programming/smalltalk/scaling-seaside-redux-enter-the-penguin/">http://onsmalltalk.com/programming/smalltalk/scaling-seaside-redux-enter-the-penguin/</A><BR><BR>Till 
  now, I have been successful in having Apache serve static content and Load 
  balance between 3 images of my Seaside App. Sticky sessions are working and 
  everything is going well so far. But I had a problem when installing 
  Daemontools (which Ramon has written in his blog and also Lukas has written in 
  Mailing lists), the recent versions of Ubuntu, dont support Daemontools out of 
  the box. <BR><BR>In one of the comments to Ramon's post, I could learn that 
  some of the seasiders have used Monit to do much more than want Daemontools 
  does. Could you please guide me how to go about.<BR><BR>I came across a blog 
  on Rails using Monit&nbsp; <A 
  href="http://www.igvita.com/2006/11/07/monit-makes-mongrel-play-nice/">http://www.igvita.com/2006/11/07/monit-makes-mongrel-play-nice/</A><BR>In 
  that, what is the equivalent code to Seaside of the following code ?<BR><BR><PRE class=ruby><FONT size=4>start program = <SPAN style="COLOR: rgb(153,102,0)">"/usr/local/bin/ruby /usr/local/bin/mongrel_rails start -d -e production -p 8010 -a <A href="http://127.0.0.1">127.0.0.1</A> -P /home/user/current/log/mongrel.8010.pid -c /home/user/rails/current"</SPAN><BR>
    stop program  = <SPAN style="COLOR: rgb(153,102,0)">"/usr/local/bin/ruby /usr/local/bin/mongrel_rails stop -P /home/user/current/log/mongrel.8010.pid"</SPAN></FONT></PRE>Till 
  now, I have been starting the images manually by <BR>/seaside$ squeakvm&nbsp; 
  -nodisplay seasidedemo "" port 9090 &amp;<BR><BR>and to kill it, i use $ pkill 
  squeakvm&nbsp;&nbsp;&nbsp; or $ kill [PID of SqueakVM]<BR><BR>I suppose, we 
  will also have to change the following code<BR><PRE class=ruby><FONT size=4><SPAN style="FONT-WEIGHT: bold; COLOR: rgb(153,102,204)">if</SPAN> totalmem is greater than <SPAN style="COLOR: rgb(0,102,102)">60.0</SPAN> MB <SPAN style="FONT-WEIGHT: bold; COLOR: rgb(153,102,204)">for</SPAN> <SPAN style="COLOR: rgb(0,102,102)">5</SPAN> cycles <SPAN style="FONT-WEIGHT: bold; COLOR: rgb(153,102,204)">then</SPAN> restart<BR>
<BR></FONT></PRE>When an image is running on my server (Pentium Dual Core 2.8 
  GHz with 1 GB RAM), it shows almost 3-4% CPU and 3-4% RAM , should we shift 
  the memory cap from 60 MB to 100 MB / image ?<BR><BR><BR>Is there any other 
  options we have ? <BR><BR>Thanks for the help,<BR>&nbsp;<BR>Rajeev 
  <BR><BR>Co-founder, AR-CAD.com<BR><BR><A 
  href="http://www.ar-cad.com">http://www.ar-cad.com</A><BR>+91 9243468076 
  (Bangalore)<BR>080 65355873 </BLOCKQUOTE></BODY></HTML>