[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Control File Questions

From: monit
Subject: Control File Questions
Date: Mon, 23 Oct 2006 05:07:38 -0700

I'm a monit newbie.  I have a Ruby on Rails app and use mongrel clustering.  I 
decided to try Monit to monitor my mongrel instances since they would fail from 
time to time.

I have 20 mongrel instances running and for each instance I had to add a block 
to the monit rc similar to this:

check process mongrel-8201 with pidfile /app/my_app/log/
     start program = "/usr/local/bin/ruby /usr/bin/mongrel_rails start -d -e 
production -p 8201 -a -l /app/my_app/log -P 
/app/my_app/log/ -c /app/my_app -B --user mongrel --group 
     stop program  = "/usr/local/bin/ruby /usr/bin/mongrel_rails stop -P 
     if totalmem > 100.0 MB for 5 cycles then restart
     if failed port 8201 protocol http
         with timeout 10 seconds
         then restart
     group mongrel  

- Is there any way to have a "local variable" in the monit.rc to set and reuse 
in the script.  For example I'd like to set the APP_LOCATION=/app/my_app.

- Is there any way to have a loop so that I don't have to copy/paste this code 
19 more times changing just the port number on each copy?  Its a real pain if I 
set this up and then decide I want to change the totalmem monitor for example.

Thanks in advance


The FREE service that prevents junk email

reply via email to

[Prev in Thread] Current Thread [Next in Thread]