sensu 0.9.4.beta → 0.9.4.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.org +6 -1
  2. data/lib/sensu.rb +1 -1
  3. data/lib/sensu/api.rb +18 -16
  4. data/sensu.gemspec +1 -2
  5. metadata +15 -28
data/README.org CHANGED
@@ -6,8 +6,13 @@
6
6
  [[http://portertech.ca/2011/11/01/sensu-a-monitoring-framework][Blog post]]
7
7
 
8
8
  [[http://www.sonian.com/cloud-tools/cloud-monitoring-sensu/][Homepage]]
9
+
9
10
  * Documentation
10
- Find it [[https://github.com/sonian/sensu/wiki][HERE]].
11
+ - [[https://github.com/sonian/sensu/wiki][Sensu Wiki]].
12
+ - [[http://joemiller.me/2012/01/19/getting-started-with-the-sensu-monitoring-framework/][Getting Started]]
13
+ - [[http://joemiller.me/2012/01/24/re-use-nagios-plugins-in-sensu-for-quick-profit/][How to reuse your existing Nagios plugins]]
14
+ - [[http://joemiller.me/2012/02/02/sensu-and-graphite/][Sensu and Graphite]]
15
+
11
16
  * Other Projects
12
17
  - [[https://github.com/sonian/sensu-community-plugins][Sensu Community Plugins]]
13
18
  - [[https://github.com/sonian/sensu-dashboard][Sensu Dashboard]]
data/lib/sensu.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sensu
2
- VERSION = "0.9.4.beta"
2
+ VERSION = "0.9.4.beta.1"
3
3
  end
data/lib/sensu/api.rb CHANGED
@@ -68,10 +68,12 @@ module Sensu
68
68
  aget '/client/:name' do |client|
69
69
  $logger.debug('[client] -- ' + request.ip + ' -- GET -- request for client -- ' + client)
70
70
  $redis.get('client:' + client).callback do |client_json|
71
- if client_json.nil?
71
+ unless client_json.nil?
72
+ body client_json
73
+ else
72
74
  status 404
75
+ body ''
73
76
  end
74
- body client_json
75
77
  end
76
78
  end
77
79
 
@@ -102,11 +104,11 @@ module Sensu
102
104
  end
103
105
  end
104
106
  status 204
105
- body nil
107
+ body ''
106
108
  end
107
109
  else
108
110
  status 404
109
- body nil
111
+ body ''
110
112
  end
111
113
  end
112
114
  end
@@ -122,7 +124,7 @@ module Sensu
122
124
  body $settings.checks[check].to_json
123
125
  else
124
126
  status 404
125
- body nil
127
+ body ''
126
128
  end
127
129
  end
128
130
 
@@ -132,7 +134,7 @@ module Sensu
132
134
  post_body = Hashie::Mash.new(JSON.parse(request.body.read))
133
135
  rescue JSON::ParserError
134
136
  status 400
135
- body nil
137
+ body ''
136
138
  end
137
139
  if post_body.check.is_a?(String) && post_body.subscribers.is_a?(Array)
138
140
  post_body.subscribers.each do |exchange|
@@ -143,7 +145,7 @@ module Sensu
143
145
  else
144
146
  status 400
145
147
  end
146
- body nil
148
+ body ''
147
149
  end
148
150
 
149
151
  aget '/events' do
@@ -187,7 +189,7 @@ module Sensu
187
189
  post_body = Hashie::Mash.new(JSON.parse(request.body.read))
188
190
  rescue JSON::ParserError
189
191
  status 400
190
- body nil
192
+ body ''
191
193
  end
192
194
  if post_body.client.is_a?(String) && post_body.check.is_a?(String)
193
195
  $redis.hgetall('events:' + post_body.client).callback do |events|
@@ -205,11 +207,11 @@ module Sensu
205
207
  else
206
208
  status 404
207
209
  end
208
- body nil
210
+ body ''
209
211
  end
210
212
  else
211
213
  status 400
212
- body nil
214
+ body ''
213
215
  end
214
216
  end
215
217
 
@@ -219,12 +221,12 @@ module Sensu
219
221
  post_body = JSON.parse(request.body.read)
220
222
  rescue JSON::ParserError
221
223
  status 400
222
- body nil
224
+ body ''
223
225
  end
224
226
  $redis.set('stash:' + path, post_body.to_json).callback do
225
227
  $redis.sadd('stashes', path).callback do
226
228
  status 201
227
- body nil
229
+ body ''
228
230
  end
229
231
  end
230
232
  end
@@ -246,12 +248,12 @@ module Sensu
246
248
  $redis.srem('stashes', path).callback do
247
249
  $redis.del('stash:' + path).callback do
248
250
  status 204
249
- body nil
251
+ body ''
250
252
  end
251
253
  end
252
254
  else
253
255
  status 404
254
- body nil
256
+ body ''
255
257
  end
256
258
  end
257
259
  end
@@ -269,7 +271,7 @@ module Sensu
269
271
  post_body = JSON.parse(request.body.read)
270
272
  rescue JSON::ParserError
271
273
  status 400
272
- body nil
274
+ body ''
273
275
  end
274
276
  response = Hash.new
275
277
  if post_body.is_a?(Array) && post_body.size > 0
@@ -285,7 +287,7 @@ module Sensu
285
287
  end
286
288
  else
287
289
  status 400
288
- body nil
290
+ body ''
289
291
  end
290
292
  end
291
293
 
data/sensu.gemspec CHANGED
@@ -19,8 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.add_dependency("hashie")
20
20
  s.add_dependency("cabin", "0.1.8")
21
21
  s.add_dependency("ruby-redis")
22
- s.add_dependency("rack", "~> 1.3.4")
23
- s.add_dependency("async_sinatra")
22
+ s.add_dependency("async_sinatra", "1.0.0")
24
23
  s.add_dependency("thin")
25
24
 
26
25
  s.add_development_dependency("rake")
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31098137
4
+ hash: 62196241
5
5
  prerelease: true
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
9
  - 4
10
10
  - beta
11
- version: 0.9.4.beta
11
+ - 1
12
+ version: 0.9.4.beta.1
12
13
  platform: ruby
13
14
  authors:
14
15
  - Sean Porter
@@ -17,7 +18,7 @@ autorequire:
17
18
  bindir: bin
18
19
  cert_chain: []
19
20
 
20
- date: 2012-02-13 00:00:00 -08:00
21
+ date: 2012-02-22 00:00:00 -08:00
21
22
  default_executable:
22
23
  dependencies:
23
24
  - !ruby/object:Gem::Dependency
@@ -127,23 +128,23 @@ dependencies:
127
128
  type: :runtime
128
129
  version_requirements: *id007
129
130
  - !ruby/object:Gem::Dependency
130
- name: rack
131
+ name: async_sinatra
131
132
  prerelease: false
132
133
  requirement: &id008 !ruby/object:Gem::Requirement
133
134
  none: false
134
135
  requirements:
135
- - - ~>
136
+ - - "="
136
137
  - !ruby/object:Gem::Version
137
- hash: 19
138
+ hash: 23
138
139
  segments:
139
140
  - 1
140
- - 3
141
- - 4
142
- version: 1.3.4
141
+ - 0
142
+ - 0
143
+ version: 1.0.0
143
144
  type: :runtime
144
145
  version_requirements: *id008
145
146
  - !ruby/object:Gem::Dependency
146
- name: async_sinatra
147
+ name: thin
147
148
  prerelease: false
148
149
  requirement: &id009 !ruby/object:Gem::Requirement
149
150
  none: false
@@ -157,7 +158,7 @@ dependencies:
157
158
  type: :runtime
158
159
  version_requirements: *id009
159
160
  - !ruby/object:Gem::Dependency
160
- name: thin
161
+ name: rake
161
162
  prerelease: false
162
163
  requirement: &id010 !ruby/object:Gem::Requirement
163
164
  none: false
@@ -168,10 +169,10 @@ dependencies:
168
169
  segments:
169
170
  - 0
170
171
  version: "0"
171
- type: :runtime
172
+ type: :development
172
173
  version_requirements: *id010
173
174
  - !ruby/object:Gem::Dependency
174
- name: rake
175
+ name: em-spec
175
176
  prerelease: false
176
177
  requirement: &id011 !ruby/object:Gem::Requirement
177
178
  none: false
@@ -185,7 +186,7 @@ dependencies:
185
186
  type: :development
186
187
  version_requirements: *id011
187
188
  - !ruby/object:Gem::Dependency
188
- name: em-spec
189
+ name: em-http-request
189
190
  prerelease: false
190
191
  requirement: &id012 !ruby/object:Gem::Requirement
191
192
  none: false
@@ -198,20 +199,6 @@ dependencies:
198
199
  version: "0"
199
200
  type: :development
200
201
  version_requirements: *id012
201
- - !ruby/object:Gem::Dependency
202
- name: em-http-request
203
- prerelease: false
204
- requirement: &id013 !ruby/object:Gem::Requirement
205
- none: false
206
- requirements:
207
- - - ">="
208
- - !ruby/object:Gem::Version
209
- hash: 3
210
- segments:
211
- - 0
212
- version: "0"
213
- type: :development
214
- version_requirements: *id013
215
202
  description: A monitoring framework that aims to be simple, malleable, and scalable. Uses the publish/subscribe model.
216
203
  email:
217
204
  - sean.porter@sonian.net