mojombo-god 0.7.13 → 0.7.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,8 @@
1
+ coverage
2
+ pkg
3
+ *.log
4
+ logs
5
+ *.rbc
6
+ *~
7
+ .*.sw?
8
+ .DS_Store
@@ -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
@@ -1,3 +1,14 @@
1
+ == 0.7.14 / 2009-08-10
2
+ * Minor Enhancements
3
+ * Only store log lines when a client wishes to see them
4
+ * Add an lsb-compliant init script into god/init [Woody Peterson]
5
+ * Never require stop command; use default killer if none is specified
6
+ * Bug Fixes
7
+ * Fix redefinition error for time.h and allow it to compile on Ubuntu Edgy [github.com/tbuser]
8
+ * Fix a memory leak in jabber by adding a call to jabber_client.close [github.com/woahdae]
9
+ * Make jabber code manage one connection to make it faster, use less memory,
10
+ and not leak [github.com/woahdae]
11
+
1
12
  == 0.7.13 / 2009-05-04
2
13
  * Bug Fixes
3
14
  * Auto daemonized processes are now stopped/unmonitored correctly [github.com/jcapote]
data/Rakefile CHANGED
@@ -1,17 +1,34 @@
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.summary = 'Like monit, only awesome'
9
+ gem.description = "God is an easy to configure, easy to extend monitoring framework written in Ruby."
10
+ gem.email = "tom@mojombo.com"
11
+ gem.homepage = "http://god.rubyforge.org/"
12
+ gem.authors = ["Tom Preston-Werner"]
13
+ gem.require_paths = ["lib", "ext"]
14
+ gem.files.include("ext")
15
+ gem.extensions << 'ext/god/extconf.rb'
16
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
17
+ end
18
+
19
+ rescue LoadError
20
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
21
+ end
22
+
23
+ require 'rake/testtask'
24
+ Rake::TestTask.new(:test) do |test|
25
+ test.libs << 'lib' << 'test'
26
+ test.pattern = 'test/**/test_*.rb'
27
+ test.verbose = true
13
28
  end
14
29
 
30
+ task :default => :test
31
+
15
32
  desc "Open an irb session preloaded with this library"
16
33
  task :console do
17
34
  sh "irb -rubygems -r ./lib/god.rb"
@@ -32,4 +49,19 @@ task :coverage do
32
49
  `rm -fr coverage`
33
50
  `rcov test/test_*.rb`
34
51
  `open coverage/index.html`
52
+ end
53
+
54
+ require 'rake/rdoctask'
55
+ Rake::RDocTask.new do |rdoc|
56
+ if File.exist?('VERSION.yml')
57
+ config = YAML.load(File.read('VERSION.yml'))
58
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
59
+ else
60
+ version = ""
61
+ end
62
+
63
+ rdoc.rdoc_dir = 'rdoc'
64
+ rdoc.title = "god #{version}"
65
+ rdoc.rdoc_files.include('README*')
66
+ rdoc.rdoc_files.include('lib/**/*.rb')
35
67
  end
@@ -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
 
@@ -0,0 +1,222 @@
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.rubygems_version = %q{1.3.5}
168
+ s.summary = %q{Like monit, only awesome}
169
+ s.test_files = [
170
+ "test/configs/child_events/simple_server.rb",
171
+ "test/configs/child_polls/simple_server.rb",
172
+ "test/configs/complex/simple_server.rb",
173
+ "test/configs/contact/simple_server.rb",
174
+ "test/configs/daemon_events/simple_server.rb",
175
+ "test/configs/daemon_events/simple_server_stop.rb",
176
+ "test/configs/daemon_polls/simple_server.rb",
177
+ "test/configs/degrading_lambda/tcp_server.rb",
178
+ "test/configs/real.rb",
179
+ "test/configs/stress/simple_server.rb",
180
+ "test/configs/test.rb",
181
+ "test/helper.rb",
182
+ "test/suite.rb",
183
+ "test/test_behavior.rb",
184
+ "test/test_campfire.rb",
185
+ "test/test_condition.rb",
186
+ "test/test_conditions_disk_usage.rb",
187
+ "test/test_conditions_http_response_code.rb",
188
+ "test/test_conditions_process_running.rb",
189
+ "test/test_conditions_tries.rb",
190
+ "test/test_contact.rb",
191
+ "test/test_dependency_graph.rb",
192
+ "test/test_driver.rb",
193
+ "test/test_email.rb",
194
+ "test/test_event_handler.rb",
195
+ "test/test_god.rb",
196
+ "test/test_handlers_kqueue_handler.rb",
197
+ "test/test_jabber.rb",
198
+ "test/test_logger.rb",
199
+ "test/test_metric.rb",
200
+ "test/test_process.rb",
201
+ "test/test_registry.rb",
202
+ "test/test_socket.rb",
203
+ "test/test_sugar.rb",
204
+ "test/test_system_portable_poller.rb",
205
+ "test/test_system_process.rb",
206
+ "test/test_task.rb",
207
+ "test/test_timeline.rb",
208
+ "test/test_trigger.rb",
209
+ "test/test_watch.rb",
210
+ "test/test_webhook.rb"
211
+ ]
212
+
213
+ if s.respond_to? :specification_version then
214
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
215
+ s.specification_version = 3
216
+
217
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
218
+ else
219
+ end
220
+ else
221
+ end
222
+ end