What to do if you can't use monit or similar

Hello,
I need to get monitoring and automatic restart of my mongrel instances
at Rails Playground, but they don’t let me install monit on my account
at this point.

can anyone point me to a simple shell script that could take care of
this as a cron job, til I can get better monitoring going?

thanks
Oliver

Try something like this under your script/ folder

#!/usr/local/bin/ruby

require ‘net/http’

urls = [“http://www.yoursite.com/controllertotest”]

urls.each do |url|

uri = URI.parse(url)

response = Net::HTTP.get_response(uri)

if response.response.code.to_i != 200

puts `/home/user/... choice of command to restart server`

end

end

The command to reap, restart depends of your setup (FastCGI, Mongrel,
etc)


Aníbal Rojas

http://www.hasmanydevelopers.com