We've been using God to monitor our Thin processes on Freebootr and set it up to notify us through our Google Apps account. Thought our God config file might be useful to anyone trying to use God with Thin and Google Apps.
Thin configuration
# == God config file# http://god.rubyforge.org/# Authors: Gump and michael@glauche.de## Config file for god that configures watches for each instance of a thin server for# each thin configuration file found in /etc/thin.# In order to get it working on Ubuntu, I had to make a change to god as noted at# the following blog:# http://blog.alexgirard.com/2007/10/25/ruby-one-line-to-save-god/#require'yaml'config_path="/etc/thin"Dir[config_path+"/*.yml"].eachdo|file|config=YAML.load_file(file)num_servers=config["servers"]||=1(0...num_servers).eachdo|i|# UNIX socket cluster use number 0 to 2 (for 3 servers)# and tcp cluster use port number 3000 to 3002.number=config['socket']?i:(config['port']+i)God.watchdo|w|w.group="thin-"+File.basename(file,".yml")w.name=w.group+"-#{number}"w.interval=30.secondsw.uid=config["user"]w.gid=config["group"]w.start="thin start -C #{file} -o #{number}"w.start_grace=10.secondsw.stop="thin stop -C #{file} -o #{number}"w.stop_grace=10.secondsw.restart="thin restart -C #{file} -o #{number}"pid_path=config["pid"]ext=File.extname(pid_path)w.pid_file=pid_path.gsub(/#{ext}$/,".#{number}#{ext}")w.behavior(:clean_pid_file)w.start_ifdo|start|start.condition(:process_running)do|c|c.interval=5.secondsc.running=falsec.notify='developers'endendw.restart_ifdo|restart|restart.condition(:memory_usage)do|c|c.above=150.megabytesc.times=[3,5]# 3 out of 5 intervalsc.notify='developers'endrestart.condition(:cpu_usage)do|c|c.above=50.percentc.times=5c.notify='developers'endendw.lifecycledo|on|on.condition(:flapping)do|c|c.to_state=[:start,:restart]c.times=5c.within=5.minutesc.transition=:unmonitoredc.retry_in=10.minutesc.retry_times=5c.retry_within=2.hoursc.notify='developers'endendw.transition(:up,:start)do|on|on.condition(:process_exits)do|c|c.notify='developers'endendendendend