god 0.7.13 → 0.7.14

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ coverage
2
+ pkg
3
+ *.log
4
+ logs
5
+ *.rbc
6
+ *~
7
+ .*.sw?
8
+ .DS_Store
data/Announce.txt ADDED
@@ -0,0 +1,135 @@
1
+ Subject: [ANN] god 0.6.0 released (and mailing list)
2
+
3
+ !!!NEW MAILING LIST!!! We now have a mailing list at http://groups.google.com/group/god-rb
4
+
5
+ This release is primarily focused on increased stability, robustness, and code cleanliness.
6
+
7
+ The last release (0.5.0) switched from TCP sockets to Unix Domain Sockets for the CLI tools. There were some issues regarding file descriptors that would cause god to hang when restarting (the unix socket was being held open by spawned processes). These problems are all fixed in 0.6.0. You may need to kill any processes that were started under god 0.5.0 when you upgrade to 0.6.0 (you will only need to do this once during the upgrade process).
8
+
9
+ More attention is now paid to Syslogging behavior.
10
+
11
+ God will delete its own PID file when terminated via a user request.
12
+
13
+ A new command line option now allows you to check whether your installation properly handles events (sometimes the C extension will compile ok, but still not support events. Gentoo, I'm looking at you). Run `god check` to see an attempt to use the event system. It will tell you if your installation does not support events.
14
+
15
+ A watch can now be removed entirely at runtime using `god remove <watch name>`.
16
+
17
+ A new condition DiskUsage allows you to check the available disk space on a given volume.
18
+
19
+ Updated documentation is now available on the website:
20
+
21
+ http://god.rubyforge.org/
22
+
23
+
24
+ WHAT IS GOD?
25
+
26
+ God is an easy to configure, easy to extend monitoring framework written in Ruby.
27
+
28
+ 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.
29
+
30
+
31
+ DISCLAIMER
32
+
33
+ God is still beta so I do not yet recommend you use it for mission critical tasks. We are using it at Powerset, Inc. to monitor our public facing applications, but then, we're daring fellows.
34
+
35
+
36
+ INSTALL
37
+
38
+ sudo gem install god
39
+
40
+
41
+ FEATURES
42
+
43
+ * Config file is written in Ruby
44
+ * Easily write your own custom conditions in Ruby
45
+ * Supports both poll and event based conditions
46
+ * Different poll conditions can have different intervals
47
+ * Easily control non-daemonized processes
48
+
49
+
50
+ EXAMPLE
51
+
52
+ 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:
53
+
54
+ # run with: god -c /path/to/gravatar.god
55
+ #
56
+ # This is the actual config file used to keep the mongrels of
57
+ # gravatar.com running.
58
+
59
+ RAILS_ROOT = "/Users/tom/dev/gravatar2"
60
+
61
+ %w{8200 8201 8202}.each do |port|
62
+ God.watch do |w|
63
+ w.name = "gravatar2-mongrel-#{port}"
64
+ w.interval = 30.seconds # default
65
+ w.start = "mongrel_rails start -c #{RAILS_ROOT} -p #{port} \
66
+ -P #{RAILS_ROOT}/log/mongrel.#{port}.pid -d"
67
+ w.stop = "mongrel_rails stop -P #{RAILS_ROOT}/log/mongrel.#{port}.pid"
68
+ w.restart = "mongrel_rails restart -P #{RAILS_ROOT}/log/mongrel.#{port}.pid"
69
+ w.start_grace = 10.seconds
70
+ w.restart_grace = 10.seconds
71
+ w.pid_file = File.join(RAILS_ROOT, "log/mongrel.#{port}.pid")
72
+
73
+ w.behavior(:clean_pid_file)
74
+
75
+ w.start_if do |start|
76
+ start.condition(:process_running) do |c|
77
+ c.interval = 5.seconds
78
+ c.running = false
79
+ end
80
+ end
81
+
82
+ w.restart_if do |restart|
83
+ restart.condition(:memory_usage) do |c|
84
+ c.above = 150.megabytes
85
+ c.times = [3, 5] # 3 out of 5 intervals
86
+ end
87
+
88
+ restart.condition(:cpu_usage) do |c|
89
+ c.above = 50.percent
90
+ c.times = 5
91
+ end
92
+ end
93
+
94
+ # lifecycle
95
+ w.lifecycle do |on|
96
+ on.condition(:flapping) do |c|
97
+ c.to_state = [:start, :restart]
98
+ c.times = 5
99
+ c.within = 5.minute
100
+ c.transition = :unmonitored
101
+ c.retry_in = 10.minutes
102
+ c.retry_times = 5
103
+ c.retry_within = 2.hours
104
+ end
105
+ end
106
+ end
107
+ end
108
+
109
+
110
+ DOCS
111
+
112
+ Detailed documentation is available at http://god.rubyforge.org/
113
+
114
+
115
+ CHANGES
116
+
117
+ == 0.6.0 / 2007-12-4
118
+
119
+ * Minor Enhancement
120
+ * Move Syslog calls into God::Logger and clean up all calling code
121
+ * Remove god's pid file on user requested termination
122
+ * Better handling and cleanup of DRb server's unix domain socket
123
+ * Allow shorthand for requesting a god log
124
+ * Add `god check` to make it easier to diagnose event problems
125
+ * Refactor god binary into class/method structure
126
+ * Implement `god remove` to remove a Task altogether
127
+ * New Conditions
128
+ * DiskUsage < PollCondition - trigger if disk usage is above limit on mount [Rudy Desjardins]
129
+
130
+
131
+
132
+ AUTHORS
133
+
134
+ Tom Preston-Werner
135
+ Kevin Clark
data/History.txt CHANGED
@@ -1,3 +1,18 @@
1
+ ==
2
+ * Minor Enhancements
3
+ * Support SSL Campfire connections [github.com/eric]
4
+
5
+ == 0.7.14 / 2009-08-10
6
+ * Minor Enhancements
7
+ * Only store log lines when a client wishes to see them
8
+ * Add an lsb-compliant init script into god/init [Woody Peterson]
9
+ * Never require stop command; use default killer if none is specified
10
+ * Bug Fixes
11
+ * Fix redefinition error for time.h and allow it to compile on Ubuntu Edgy [github.com/tbuser]
12
+ * Fix a memory leak in jabber by adding a call to jabber_client.close [github.com/woahdae]
13
+ * Make jabber code manage one connection to make it faster, use less memory,
14
+ and not leak [github.com/woahdae]
15
+
1
16
  == 0.7.13 / 2009-05-04
2
17
  * Bug Fixes
3
18
  * Auto daemonized processes are now stopped/unmonitored correctly [github.com/jcapote]
data/Rakefile CHANGED
@@ -1,17 +1,35 @@
1
1
  require 'rubygems'
2
- require 'hoe'
3
-
4
- Hoe.new('god', '0.7.13') do |p|
5
- p.rubyforge_name = 'god'
6
- p.author = 'Tom Preston-Werner'
7
- p.email = 'tom@rubyisawesome.com'
8
- p.url = 'http://god.rubyforge.org/'
9
- p.summary = 'Like monit, only awesome'
10
- p.description = "God is an easy to configure, easy to extend monitoring framework written in Ruby."
11
- p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
12
- p.spec_extras = {:extensions => ['ext/god/extconf.rb']}
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "god"
8
+ gem.rubyforge_project = "god"
9
+ gem.summary = 'Like monit, only awesome'
10
+ gem.description = "God is an easy to configure, easy to extend monitoring framework written in Ruby."
11
+ gem.email = "tom@mojombo.com"
12
+ gem.homepage = "http://god.rubyforge.org/"
13
+ gem.authors = ["Tom Preston-Werner"]
14
+ gem.require_paths = ["lib", "ext"]
15
+ gem.files.include("ext")
16
+ gem.extensions << 'ext/god/extconf.rb'
17
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
18
+ end
19
+
20
+ rescue LoadError
21
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
22
+ end
23
+
24
+ require 'rake/testtask'
25
+ Rake::TestTask.new(:test) do |test|
26
+ test.libs << 'lib' << 'test'
27
+ test.pattern = 'test/**/test_*.rb'
28
+ test.verbose = true
13
29
  end
14
30
 
31
+ task :default => :test
32
+
15
33
  desc "Open an irb session preloaded with this library"
16
34
  task :console do
17
35
  sh "irb -rubygems -r ./lib/god.rb"
@@ -32,4 +50,19 @@ task :coverage do
32
50
  `rm -fr coverage`
33
51
  `rcov test/test_*.rb`
34
52
  `open coverage/index.html`
53
+ end
54
+
55
+ require 'rake/rdoctask'
56
+ Rake::RDocTask.new do |rdoc|
57
+ if File.exist?('VERSION.yml')
58
+ config = YAML.load(File.read('VERSION.yml'))
59
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
60
+ else
61
+ version = ""
62
+ end
63
+
64
+ rdoc.rdoc_dir = 'rdoc'
65
+ rdoc.title = "god #{version}"
66
+ rdoc.rdoc_files.include('README*')
67
+ rdoc.rdoc_files.include('lib/**/*.rb')
35
68
  end
data/VERSION.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ :minor: 7
3
+ :patch: 14
4
+ :major: 0
@@ -0,0 +1,5 @@
1
+ Makefile
2
+ kqueue_handler_ext.bundle
3
+ kqueue_handler.o
4
+ netlink_handler_ext.bundle
5
+ netlink_handler.o
@@ -6,6 +6,7 @@
6
6
  #include <sys/socket.h>
7
7
  #include <linux/netlink.h>
8
8
  #include <linux/connector.h>
9
+ #define _LINUX_TIME_H
9
10
  #include <linux/cn_proc.h>
10
11
  #include <errno.h>
11
12
 
data/god.gemspec ADDED
@@ -0,0 +1,223 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{god}
5
+ s.version = "0.7.14"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Tom Preston-Werner"]
9
+ s.date = %q{2009-08-10}
10
+ s.default_executable = %q{god}
11
+ s.description = %q{God is an easy to configure, easy to extend monitoring framework written in Ruby.}
12
+ s.email = %q{tom@mojombo.com}
13
+ s.executables = ["god"]
14
+ s.extensions = ["ext/god/extconf.rb"]
15
+ s.extra_rdoc_files = [
16
+ "README.txt"
17
+ ]
18
+ s.files = [
19
+ ".gitignore",
20
+ "Announce.txt",
21
+ "History.txt",
22
+ "README.txt",
23
+ "Rakefile",
24
+ "VERSION.yml",
25
+ "bin/god",
26
+ "examples/events.god",
27
+ "examples/gravatar.god",
28
+ "examples/single.god",
29
+ "ext/god/.gitignore",
30
+ "ext/god/extconf.rb",
31
+ "ext/god/kqueue_handler.c",
32
+ "ext/god/netlink_handler.c",
33
+ "god.gemspec",
34
+ "ideas/execve/.DS_Store",
35
+ "ideas/execve/execve.c",
36
+ "ideas/execve/extconf.rb",
37
+ "ideas/execve/go.rb",
38
+ "ideas/future.god",
39
+ "init/god",
40
+ "init/lsb_compliant_god",
41
+ "lib/god.rb",
42
+ "lib/god/behavior.rb",
43
+ "lib/god/behaviors/clean_pid_file.rb",
44
+ "lib/god/behaviors/clean_unix_socket.rb",
45
+ "lib/god/behaviors/notify_when_flapping.rb",
46
+ "lib/god/cli/command.rb",
47
+ "lib/god/cli/run.rb",
48
+ "lib/god/cli/version.rb",
49
+ "lib/god/condition.rb",
50
+ "lib/god/conditions/always.rb",
51
+ "lib/god/conditions/complex.rb",
52
+ "lib/god/conditions/cpu_usage.rb",
53
+ "lib/god/conditions/degrading_lambda.rb",
54
+ "lib/god/conditions/disk_usage.rb",
55
+ "lib/god/conditions/file_mtime.rb",
56
+ "lib/god/conditions/flapping.rb",
57
+ "lib/god/conditions/http_response_code.rb",
58
+ "lib/god/conditions/lambda.rb",
59
+ "lib/god/conditions/memory_usage.rb",
60
+ "lib/god/conditions/process_exits.rb",
61
+ "lib/god/conditions/process_running.rb",
62
+ "lib/god/conditions/tries.rb",
63
+ "lib/god/configurable.rb",
64
+ "lib/god/contact.rb",
65
+ "lib/god/contacts/campfire.rb",
66
+ "lib/god/contacts/email.rb",
67
+ "lib/god/contacts/jabber.rb",
68
+ "lib/god/contacts/twitter.rb",
69
+ "lib/god/contacts/webhook.rb",
70
+ "lib/god/dependency_graph.rb",
71
+ "lib/god/diagnostics.rb",
72
+ "lib/god/driver.rb",
73
+ "lib/god/errors.rb",
74
+ "lib/god/event_handler.rb",
75
+ "lib/god/event_handlers/dummy_handler.rb",
76
+ "lib/god/event_handlers/kqueue_handler.rb",
77
+ "lib/god/event_handlers/netlink_handler.rb",
78
+ "lib/god/logger.rb",
79
+ "lib/god/metric.rb",
80
+ "lib/god/process.rb",
81
+ "lib/god/registry.rb",
82
+ "lib/god/simple_logger.rb",
83
+ "lib/god/socket.rb",
84
+ "lib/god/sugar.rb",
85
+ "lib/god/system/portable_poller.rb",
86
+ "lib/god/system/process.rb",
87
+ "lib/god/system/slash_proc_poller.rb",
88
+ "lib/god/task.rb",
89
+ "lib/god/timeline.rb",
90
+ "lib/god/trigger.rb",
91
+ "lib/god/watch.rb",
92
+ "site/images/banner.jpg",
93
+ "site/images/bg.gif",
94
+ "site/images/bg_grey.gif",
95
+ "site/images/bullet.jpg",
96
+ "site/images/corner_green.gif",
97
+ "site/images/corner_green.psd",
98
+ "site/images/corner_pink.gif",
99
+ "site/images/god_logo1.gif",
100
+ "site/images/header_bg.gif",
101
+ "site/images/header_bg.jpg",
102
+ "site/images/red_dot.gif",
103
+ "site/images/top_bg.gif",
104
+ "site/index.html",
105
+ "site/install.html",
106
+ "site/javascripts/code_highlighter.js",
107
+ "site/javascripts/ruby.js",
108
+ "site/stylesheets/layout.css",
109
+ "test/configs/child_events/child_events.god",
110
+ "test/configs/child_events/simple_server.rb",
111
+ "test/configs/child_polls/child_polls.god",
112
+ "test/configs/child_polls/simple_server.rb",
113
+ "test/configs/complex/complex.god",
114
+ "test/configs/complex/simple_server.rb",
115
+ "test/configs/contact/contact.god",
116
+ "test/configs/contact/simple_server.rb",
117
+ "test/configs/daemon_events/daemon_events.god",
118
+ "test/configs/daemon_events/simple_server.rb",
119
+ "test/configs/daemon_events/simple_server_stop.rb",
120
+ "test/configs/daemon_polls/daemon_polls.god",
121
+ "test/configs/daemon_polls/simple_server.rb",
122
+ "test/configs/degrading_lambda/degrading_lambda.god",
123
+ "test/configs/degrading_lambda/tcp_server.rb",
124
+ "test/configs/lifecycle/lifecycle.god",
125
+ "test/configs/matias/matias.god",
126
+ "test/configs/real.rb",
127
+ "test/configs/running_load/running_load.god",
128
+ "test/configs/stress/simple_server.rb",
129
+ "test/configs/stress/stress.god",
130
+ "test/configs/task/logs/.placeholder",
131
+ "test/configs/task/task.god",
132
+ "test/configs/test.rb",
133
+ "test/helper.rb",
134
+ "test/suite.rb",
135
+ "test/test_behavior.rb",
136
+ "test/test_campfire.rb",
137
+ "test/test_condition.rb",
138
+ "test/test_conditions_disk_usage.rb",
139
+ "test/test_conditions_http_response_code.rb",
140
+ "test/test_conditions_process_running.rb",
141
+ "test/test_conditions_tries.rb",
142
+ "test/test_contact.rb",
143
+ "test/test_dependency_graph.rb",
144
+ "test/test_driver.rb",
145
+ "test/test_email.rb",
146
+ "test/test_event_handler.rb",
147
+ "test/test_god.rb",
148
+ "test/test_handlers_kqueue_handler.rb",
149
+ "test/test_jabber.rb",
150
+ "test/test_logger.rb",
151
+ "test/test_metric.rb",
152
+ "test/test_process.rb",
153
+ "test/test_registry.rb",
154
+ "test/test_socket.rb",
155
+ "test/test_sugar.rb",
156
+ "test/test_system_portable_poller.rb",
157
+ "test/test_system_process.rb",
158
+ "test/test_task.rb",
159
+ "test/test_timeline.rb",
160
+ "test/test_trigger.rb",
161
+ "test/test_watch.rb",
162
+ "test/test_webhook.rb"
163
+ ]
164
+ s.homepage = %q{http://god.rubyforge.org/}
165
+ s.rdoc_options = ["--charset=UTF-8"]
166
+ s.require_paths = ["lib", "ext"]
167
+ s.rubyforge_project = %q{god}
168
+ s.rubygems_version = %q{1.3.5}
169
+ s.summary = %q{Like monit, only awesome}
170
+ s.test_files = [
171
+ "test/configs/child_events/simple_server.rb",
172
+ "test/configs/child_polls/simple_server.rb",
173
+ "test/configs/complex/simple_server.rb",
174
+ "test/configs/contact/simple_server.rb",
175
+ "test/configs/daemon_events/simple_server.rb",
176
+ "test/configs/daemon_events/simple_server_stop.rb",
177
+ "test/configs/daemon_polls/simple_server.rb",
178
+ "test/configs/degrading_lambda/tcp_server.rb",
179
+ "test/configs/real.rb",
180
+ "test/configs/stress/simple_server.rb",
181
+ "test/configs/test.rb",
182
+ "test/helper.rb",
183
+ "test/suite.rb",
184
+ "test/test_behavior.rb",
185
+ "test/test_campfire.rb",
186
+ "test/test_condition.rb",
187
+ "test/test_conditions_disk_usage.rb",
188
+ "test/test_conditions_http_response_code.rb",
189
+ "test/test_conditions_process_running.rb",
190
+ "test/test_conditions_tries.rb",
191
+ "test/test_contact.rb",
192
+ "test/test_dependency_graph.rb",
193
+ "test/test_driver.rb",
194
+ "test/test_email.rb",
195
+ "test/test_event_handler.rb",
196
+ "test/test_god.rb",
197
+ "test/test_handlers_kqueue_handler.rb",
198
+ "test/test_jabber.rb",
199
+ "test/test_logger.rb",
200
+ "test/test_metric.rb",
201
+ "test/test_process.rb",
202
+ "test/test_registry.rb",
203
+ "test/test_socket.rb",
204
+ "test/test_sugar.rb",
205
+ "test/test_system_portable_poller.rb",
206
+ "test/test_system_process.rb",
207
+ "test/test_task.rb",
208
+ "test/test_timeline.rb",
209
+ "test/test_trigger.rb",
210
+ "test/test_watch.rb",
211
+ "test/test_webhook.rb"
212
+ ]
213
+
214
+ if s.respond_to? :specification_version then
215
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
216
+ s.specification_version = 3
217
+
218
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
219
+ else
220
+ end
221
+ else
222
+ end
223
+ end