god 0.7.19 → 0.7.20
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/VERSION.yml +1 -1
- data/god.gemspec +2 -2
- data/lib/god/cli/command.rb +28 -27
- data/test/configs/child_polls/child_polls.god +1 -1
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
== 0.7.20 / 2009-09-24
|
2
|
+
* Minor Enhancements
|
3
|
+
* Rewrite `god status` command to be not as horrible. Add ability to get
|
4
|
+
status for individual tasks.
|
5
|
+
|
1
6
|
== 0.7.19 / 2009-09-21
|
2
7
|
* Minor Enhancements
|
3
8
|
* Teach `god status` to take a task name as a param and return
|
data/VERSION.yml
CHANGED
data/god.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{god}
|
5
|
-
s.version = "0.7.
|
5
|
+
s.version = "0.7.20"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Tom Preston-Werner"]
|
9
|
-
s.date = %q{2009-09-
|
9
|
+
s.date = %q{2009-09-24}
|
10
10
|
s.default_executable = %q{god}
|
11
11
|
s.description = %q{God is an easy to configure, easy to extend monitoring framework written in Ruby.}
|
12
12
|
s.email = %q{tom@mojombo.com}
|
data/lib/god/cli/command.rb
CHANGED
@@ -66,46 +66,47 @@ module God
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def status_command
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
69
|
+
exitcode = 0
|
70
|
+
statuses = @server.status
|
71
|
+
groups = {}
|
72
|
+
statuses.each do |name, status|
|
73
73
|
g = status[:group] || ''
|
74
|
-
|
75
|
-
|
76
|
-
end
|
77
|
-
watches[g][name] = status
|
74
|
+
groups[g] ||= {}
|
75
|
+
groups[g][name] = status
|
78
76
|
end
|
79
|
-
|
80
|
-
|
81
|
-
if
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
failcount += 1 if state != :up
|
77
|
+
|
78
|
+
if item = @args[1]
|
79
|
+
if single = statuses[item]
|
80
|
+
# specified task (0 -> up, 1 -> unmonitored, 2 -> other)
|
81
|
+
state = single[:state]
|
82
|
+
puts "#{item}: #{state}"
|
83
|
+
exitcode = state == :up ? 0 : (state == :unmonitored ? 1 : 2)
|
84
|
+
elsif groups[item]
|
85
|
+
# specified group (0 -> up, N -> other)
|
86
|
+
puts "#{item}:"
|
87
|
+
groups[item].keys.sort.each do |name|
|
88
|
+
state = groups[item][name][:state]
|
89
|
+
print " "
|
93
90
|
puts "#{name}: #{state}"
|
91
|
+
exitcode += 1 unless state == :up
|
94
92
|
end
|
95
93
|
else
|
96
|
-
|
94
|
+
puts "Task or Group '#{item}' not found."
|
95
|
+
exit(1)
|
97
96
|
end
|
98
|
-
exit!(failcount)
|
99
97
|
else
|
100
|
-
|
98
|
+
# show all groups and watches
|
99
|
+
groups.keys.sort.each do |group|
|
101
100
|
puts "#{group}:" unless group.empty?
|
102
|
-
|
103
|
-
state =
|
101
|
+
groups[group].keys.sort.each do |name|
|
102
|
+
state = groups[group][name][:state]
|
104
103
|
print " " unless group.empty?
|
105
104
|
puts "#{name}: #{state}"
|
106
105
|
end
|
107
106
|
end
|
108
107
|
end
|
108
|
+
|
109
|
+
exit(exitcode)
|
109
110
|
end
|
110
111
|
|
111
112
|
def signal_command
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: god
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Preston-Werner
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-24 00:00:00 -07:00
|
13
13
|
default_executable: god
|
14
14
|
dependencies: []
|
15
15
|
|