Skip to content

Instantly share code, notes, and snippets.

@kirk
Created November 12, 2010 05:14
Show Gist options
  • Save kirk/673752 to your computer and use it in GitHub Desktop.
Save kirk/673752 to your computer and use it in GitHub Desktop.
check process mongodb with pidfile /data/db/mongodb/mongod.lock
start program "/etc/init.d/mongodb start"
stop program "/etc/init.d/mongodb stop"
if failed port 27017 then restart
if 5 restarts within 5 cycles then timeout
check process nginx with pidfile /opt/nginx/logs/nginx.pid
start program = "/etc/init.d/nginx start"
stop program = "/etc/init.d/nginx stop"
if failed port 80 protocol HTTP request / then restart
if 5 restarts with 5 cycles then timeout
check process sshd with pidfile /var/run/sshd.pid
start program "/etc/init.d/ssh start"
stop program "/etc/init.d/ssh stop"
if failed port 22 protocol ssh then restart
if 5 restarts within 5 cycles then timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment