GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of mojombo/god
Description: Ruby process monitor
Homepage: http://god.rubyforge.org
Clone URL: git://github.com/Bertg/god.git
mojombo (author)
Mon Sep 10 12:31:18 -0700 2007
commit  3b90139e3d24236751c86e3623fb5c812038cb1c
tree    b07c596e8d866f266018ef920cacb820630c18dc
parent  4dd171d92d0e0d16192c563c73df4c6dfca0d6a3
god / Announce.txt
100644 134 lines (92 sloc) 4.961 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
Subject: [ANN] 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 instance
  * `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 = <log file path>' 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:
 
  http://god.rubyforge.org/
 
 
WHAT IS GOD?
 
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.
 
 
DISCLAIMER
 
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.
 
 
INSTALL
 
sudo gem install god
 
 
FEATURES
 
* 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
 
 
EXAMPLE
 
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.behavior(:clean_pid_file)
 
    w.start_if do |start|
      start.condition(:process_running) do |c|
        c.interval = 5.seconds
        c.running = false
      end
    end
    
    w.restart_if do |restart|
      restart.condition(:memory_usage) do |c|
        c.above = 150.megabytes
        c.times = [3, 5] # 3 out of 5 intervals
      end
    
      restart.condition(:cpu_usage) do |c|
        c.above = 50.percent
        c.times = 5
      end
    end
  end
end
 
 
DOCS
 
Detailed documentation is available at http://god.rubyforge.org/
 
 
CHANGES
 
== 0.4.0 / 2007-09-13
 
* 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 <filename>)
  * 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 [kevinclark]
  * 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
 
 
AUTHORS
 
Tom Preston-Werner
Kevin Clark