[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 |
User-agent: |
Mailshell.com |
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/mongrel.8201.pid
start program = "/usr/local/bin/ruby /usr/bin/mongrel_rails start -d -e
production -p 8201 -a 127.0.0.1 -l /app/my_app/log -P
/app/my_app/log/mongrel.8201.pid -c /app/my_app -B --user mongrel --group
mongrel"
stop program = "/usr/local/bin/ruby /usr/bin/mongrel_rails stop -P
/app/my_app/log/mongrel.8201.pid"
if totalmem > 100.0 MB for 5 cycles then restart
if failed port 8201 protocol http
with timeout 10 seconds
then restart
group mongrel
Questions:
- 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 http://www.mailshell.com
- Control File Questions,
monit <=