Skip to content

Instantly share code, notes, and snippets.

View monodeep12's full-sized avatar

Monodeep Bhattacharjee monodeep12

View GitHub Profile
@monodeep12
monodeep12 / monit_mongo.conf
Last active February 11, 2016 04:22
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
@monodeep12
monodeep12 / monitor_go_server.conf
Last active February 11, 2016 04:20
monit config file for monitoring a go app server
check process hulk_server
with pidfile /opt/go/src/github.com/xxxx/yyyy/hulk.pid
start program = "/home/hulk/media_planner/run_hulk_server.sh" as uid hulk and gid hulk
stop program = "/bin/bash -c 'fuser -k 5000/tcp'"
if failed host x.x.x.x port 5000 then alert
if failed host x.x.x.x port 5000 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