Skip to content

Instantly share code, notes, and snippets.

@monodeep12
Last active February 11, 2016 04:22
Show Gist options
  • Save monodeep12/dd8ac311fbc1205ccb5e to your computer and use it in GitHub Desktop.
Save monodeep12/dd8ac311fbc1205ccb5e to your computer and use it in GitHub Desktop.
monit script for monitoring mongodb
check process mongodb
with pidfile "/var/run/mongodb.pid"
start program = "/sbin/start mongod"
stop program = "/sbin/stop mongod"
if failed host 127.0.0.1 port 27017 protocol http
and request "/" with timeout 10 seconds then restart
if 5 restarts within 5 cycles then timeout
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
if totalmem > 400.0 MB for 5 cycles then restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment