Skip to content

Instantly share code, notes, and snippets.

@gjnoonan
Created January 14, 2011 21:49
Show Gist options
  • Save gjnoonan/780324 to your computer and use it in GitHub Desktop.
Save gjnoonan/780324 to your computer and use it in GitHub Desktop.
A monit script for memcached
check process memcached with pidfile /var/pids/memcached.pid
start program = "/usr/local/bin/memcached -d -P /var/pids/memcached.pid -u root -m 512 -l 127.0.0.1 -p 11211"
stop program = "/bin/kill -9 `cat /var/pids/memcached.pid`; rm /var/pids/memcached.pid"
if failed host 127.0.0.1 port 11211 then restart
if cpu > 60% for 2 cycles then alert
if cpu > 98% for 5 cycles then restart
if 2 restarts within 3 cycles then timeout
group cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment