I need to monitor several processes running on my webserver. For some reason, varnish currently crashes once every day or two. I'm using monit to supposedly restart varnish automatically, but it doesn't work. Here's my monit.conf entry for Varnish.
check process varnish with pidfile /var/run/varnish.pid
start program = "/etc/init.d/varnish start" with timeout 60 seconds
stop program = "/etc/init.d/varnish stop"
if failed host <my server ip> port 80 protocol http
and request "/blank.html" then restart
if 3 restarts within 5 cycles then timeout
group server
The log file shows that after varnish stops running, the attempted restarts afterwards all fail. Then eventually monit stops monitoring varnish.
Anyone have suggestions for how I can fix this? Or better yet, can you suggest other simple ways of automatically monitoring and restarting crashed processes? Thanks!