God 0.4.0 released

Progress on god is moving along as quick as ever. This release adds a
bunch of new features and bug fixes. Most interestingly you’ll find
several useful new command line functions:

  • god status prints out the status of each Watch
  • god log shows realtime logs for a specific Watch (even if you
    don’t have god logging to file)
  • god load loads or reloads a config file into a running god
  • god terminate stops all Watches and then stops god (useful when
    testing your setup)

The logging system has been beefed up with proper timestamps and
criticality levels. Log messages are more complete overall. You can also
get the STDOUT/STDERR of a god-daemonized process written to a log file
by specify 'w.log = ’ in your Watch config.

If you let god daemonize your process for you, there’s no need to
provide a stop command. A default killing lambda will take care of
gracefully (or not so gracefully if necessary) stopping your
god-daemonized process.

The validity of your config file is checked better than previous
versions to point you to the problem area of your config.

The bug that prevented group control from working has been fixed so you
can now start/stop/etc groups of Watches.

Updated documentation is now available on the website:



God is an easy to configure, easy to extend monitoring framework written
in Ruby.

Keeping your server processes and tasks running should be a simple part
of your deployment process. God aims to be the simplest, most powerful
monitoring application available.


God is still very young, I’d love to get feedback and bug reports, but I
do not yet recommend you use it for mission critical tasks. I personally
use it in production but then I’m a daring fellow.


sudo gem install god


  • Config file is written in Ruby
  • Easily write your own custom conditions in Ruby
  • Supports both poll and event based conditions
  • Different poll conditions can have different intervals
  • Easily control non-daemonized processes


The easiest way to understand how god will make your life better is by
looking at a sample config file. The following configuration file is
what I use at gravatar.com to keep the mongrels running:

file: gravatar.god

run with: god -c /path/to/gravatar.god

This is the actual config file used to keep the mongrels of

gravatar.com running.

RAILS_ROOT = “/var/www/gravatar2/current”

%w{8200 8201 8202}.each do |port|
God.watch do |w|
w.name = “gravatar2-mongrel-#{port}”
w.interval = 30.seconds # default
w.start = “mongrel_rails cluster::start --only #{port}
-C #{RAILS_ROOT}/config/mongrel_cluster.yml”
w.stop = “mongrel_rails cluster::stop --only #{port}
-C #{RAILS_ROOT}/config/mongrel_cluster.yml”
w.grace = 10.seconds
w.pid_file = File.join(RAILS_ROOT, “log/mongrel.#{port}.pid”)


w.start_if do |start|
  start.condition(:process_running) do |c|
    c.interval = 5.seconds
    c.running = false

w.restart_if do |restart|
  restart.condition(:memory_usage) do |c|
    c.above = 150.megabytes
    c.times = [3, 5] # 3 out of 5 intervals

  restart.condition(:cpu_usage) do |c|
    c.above = 50.percent
    c.times = 5



Detailed documentation is available at http://god.rubyforge.org/


== 0.4.0 / 2007-09-10

  • Major Enhancements
    • Add the ability for conditions to override transition state (for
      exceptional cases)
    • Implement dynamic load of config files while god is running (god
      load )
    • Add ability to save auto-daemonized process output to a log file
    • Add robust default stop lambda command for auto-daemonized processes
      (inspired by _eric)
    • Add status command for god binary (shows status of each watch)
    • Create proper logger with timestamps
    • Add log command to god binary to get real time logs for a specific
      watch from a running god instance
    • Add terminate command for god binary (stop god and all watches)
  • Minor Enhancements
    • Enforce validity of Watches
    • Enforce that God.init is not called after a Watch
    • Move pid_file_directory creation and validation to God.start
    • Remove check for at least one Watch during startup (now that dynamic
      loading exists)
  • New Conditions
    • Tries < PollCondition - triggers after the specified number of tries
    • Add :notify_when_flapping behavior to check for oscillation
    • Add :degrading_lambda condition. [kevinclark]
      It uses a decaying interval (1/2 rate) for 3 cycles before failing.
  • Bug Fixes
    • Use exit!(0) instead of exit! in god binary to exit with code 0
      (instead of default -1)
    • Command line group control fixed
    • Fix cross-thread return problem


Tom Preston-Werner
Kevin C.

Tom Preston-Werner