Monitoring mongrel with monit

Posted by matnagel on Server Fault See other posts from Server Fault or by matnagel
Published on 2010-04-29T12:35:45Z Indexed on 2010/04/29 12:37 UTC
Read the original article Hit count: 455

Filed under:
|
|
|

I wrote a monit.d file for mongrels which works in this version:

check process redmine with pidfile /home/redmine/service/redmine.pid
group webservice

start program = "/usr/bin/mongrel_rails start -p 41328 -e production -d --pid /home/redmine/service/redmine.pid --user redmine --group redmine -a 127.0.0.1 -c /home/redmine/app"
stop program  = "/usr/bin/mongrel_rails stop --pid /home/redmine/service/redmine.pid  -c /home/redmine/app && rm /home/redmine/service/redmine.pid > /dev/null 2>&1

if cpu greater 50% for 2 cycles then alert
if cpu greater 80% for 3 cycles then restart


if totalmem greater 60.0 MB for 5 cycles then restart
if loadavg (5min) greater 4 for 8 cycles then restart

if 3 restarts within 5 cycles then timeout


$ Checking monit control file syntax...
$ Control file syntax OK

I want to also monitor the http response, so I add this line at the end:

if failed port 41328 protocol http with timeout 10 seconds then restart

Now monit complains:

$ Checking monit control file syntax...
$ /etc/monit.d/redmine:16: Error: exceeded maximum number of program arguments 'http'
$ ERROR: CHECK MONIT CONFIG FILE SYNTAX

How do I correctly monitor the port?

© Server Fault or respective owner

Related posts about monit

Related posts about monitoring