Skip to content

Instantly share code, notes, and snippets.

@codypo
codypo / monitex
Created April 6, 2011 14:21
Monit example for restarting a service on excessive memory consumption
# Relevant example from our monitrc file.
check process couchdb with pidfile /usr/local/var/run/couchdb/couchdb.pid
start program = "/etc/init.d/couchdb start"
stop program = "/etc/init.d/couchdb stop"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if memory usage > 70% MB for 5 cycles then restart