sensu 0.12.6 → 0.13.0.alpha

Sign up to get free protection for your applications and to get access to all the features.
data/lib/sensu/socket.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Sensu
2
2
  class Socket < EM::Connection
3
- attr_accessor :logger, :settings, :amq, :reply
3
+ attr_accessor :logger, :settings, :transport, :reply
4
4
 
5
5
  def respond(data)
6
6
  unless @reply == false
@@ -20,7 +20,7 @@ module Sensu
20
20
  :data => data
21
21
  })
22
22
  begin
23
- check = Oj.load(data)
23
+ check = MultiJson.load(data)
24
24
  check[:issued] = Time.now.to_i
25
25
  check[:status] ||= 0
26
26
  validates = [
@@ -36,7 +36,7 @@ module Sensu
36
36
  @logger.info('publishing check result', {
37
37
  :payload => payload
38
38
  })
39
- @amq.direct('results').publish(Oj.dump(payload))
39
+ @transport.publish(:direct, 'results', MultiJson.dump(payload))
40
40
  respond('ok')
41
41
  else
42
42
  @logger.warn('invalid check result', {
@@ -44,7 +44,7 @@ module Sensu
44
44
  })
45
45
  respond('invalid')
46
46
  end
47
- rescue Oj::ParseError => error
47
+ rescue MultiJson::ParseError => error
48
48
  @logger.warn('check result must be valid json', {
49
49
  :data => data,
50
50
  :error => error.to_s
@@ -1,3 +1,7 @@
1
+ gem 'uuidtools', '2.1.4'
2
+
3
+ require 'uuidtools'
4
+
1
5
  module Sensu
2
6
  module Utilities
3
7
  def testing?
@@ -12,23 +16,6 @@ module Sensu
12
16
  end
13
17
  end
14
18
 
15
- def indifferent_hash
16
- Hash.new do |hash, key|
17
- if key.is_a?(String)
18
- hash[key.to_sym]
19
- end
20
- end
21
- end
22
-
23
- def with_indifferent_access(hash)
24
- hash = indifferent_hash.merge(hash)
25
- hash.each do |key, value|
26
- if value.is_a?(Hash)
27
- hash[key] = with_indifferent_access(value)
28
- end
29
- end
30
- end
31
-
32
19
  def deep_merge(hash_one, hash_two)
33
20
  merged = hash_one.dup
34
21
  hash_two.each do |key, value|
@@ -44,18 +31,8 @@ module Sensu
44
31
  merged
45
32
  end
46
33
 
47
- def deep_diff(hash_one, hash_two)
48
- keys = hash_one.keys.concat(hash_two.keys).uniq
49
- keys.inject(Hash.new) do |diff, key|
50
- unless hash_one[key] == hash_two[key]
51
- if hash_one[key].is_a?(Hash) && hash_two[key].is_a?(Hash)
52
- diff[key] = deep_diff(hash_one[key], hash_two[key])
53
- else
54
- diff[key] = [hash_one[key], hash_two[key]]
55
- end
56
- end
57
- diff
58
- end
34
+ def random_uuid
35
+ UUIDTools::UUID.random_create.to_s
59
36
  end
60
37
 
61
38
  def redact_sensitive(hash, keys=nil)
data/sensu.gemspec CHANGED
@@ -13,16 +13,20 @@ Gem::Specification.new do |s|
13
13
  s.license = 'MIT'
14
14
  s.has_rdoc = false
15
15
 
16
- s.add_dependency('oj', '2.0.9')
17
- s.add_dependency('eventmachine', '1.0.3')
18
- s.add_dependency('amq-protocol', '1.2.0')
19
- s.add_dependency('amq-client', '1.0.2')
20
- s.add_dependency('amqp', '1.0.0')
16
+ s.add_dependency('json') if RUBY_VERSION < "1.9"
17
+ s.add_dependency('multi_json', '1.10.1')
18
+ s.add_dependency('uuidtools', '2.1.4')
19
+ s.add_dependency('sensu-em', '2.0.0')
20
+ s.add_dependency('sensu-logger', '0.0.1')
21
+ s.add_dependency('sensu-settings', '0.0.4')
22
+ s.add_dependency('sensu-extension', '0.0.3')
23
+ s.add_dependency('sensu-extensions', '0.0.4')
24
+ s.add_dependency('sensu-transport', '0.0.2')
25
+ s.add_dependency('sensu-spawn', '0.0.3')
21
26
  s.add_dependency('em-redis-unified', '0.4.2')
22
27
  s.add_dependency('thin', '1.5.0')
23
28
  s.add_dependency('sinatra', '1.3.5')
24
29
  s.add_dependency('async_sinatra', '1.0.0')
25
- s.add_dependency('em-worker', '0.0.2')
26
30
 
27
31
  s.add_development_dependency('rake')
28
32
  s.add_development_dependency('rspec')
metadata CHANGED
@@ -1,298 +1,293 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sensu
3
- version: !ruby/object:Gem::Version
4
- hash: 35
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 12
9
- - 6
10
- version: 0.12.6
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.13.0.alpha
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Sean Porter
14
8
  - Justin Kolberg
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2014-02-19 00:00:00 -08:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
23
- name: oj
12
+ date: 2014-05-26 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: multi_json
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '='
19
+ - !ruby/object:Gem::Version
20
+ version: 1.10.1
21
+ type: :runtime
24
22
  prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
28
- - - "="
29
- - !ruby/object:Gem::Version
30
- hash: 29
31
- segments:
32
- - 2
33
- - 0
34
- - 9
35
- version: 2.0.9
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '='
26
+ - !ruby/object:Gem::Version
27
+ version: 1.10.1
28
+ - !ruby/object:Gem::Dependency
29
+ name: uuidtools
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '='
33
+ - !ruby/object:Gem::Version
34
+ version: 2.1.4
36
35
  type: :runtime
37
- version_requirements: *id001
38
- - !ruby/object:Gem::Dependency
39
- name: eventmachine
40
36
  prerelease: false
41
- requirement: &id002 !ruby/object:Gem::Requirement
42
- none: false
43
- requirements:
44
- - - "="
45
- - !ruby/object:Gem::Version
46
- hash: 17
47
- segments:
48
- - 1
49
- - 0
50
- - 3
51
- version: 1.0.3
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '='
40
+ - !ruby/object:Gem::Version
41
+ version: 2.1.4
42
+ - !ruby/object:Gem::Dependency
43
+ name: sensu-em
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '='
47
+ - !ruby/object:Gem::Version
48
+ version: 2.0.0
52
49
  type: :runtime
53
- version_requirements: *id002
54
- - !ruby/object:Gem::Dependency
55
- name: amq-protocol
56
50
  prerelease: false
57
- requirement: &id003 !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
60
- - - "="
61
- - !ruby/object:Gem::Version
62
- hash: 31
63
- segments:
64
- - 1
65
- - 2
66
- - 0
67
- version: 1.2.0
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '='
54
+ - !ruby/object:Gem::Version
55
+ version: 2.0.0
56
+ - !ruby/object:Gem::Dependency
57
+ name: sensu-logger
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '='
61
+ - !ruby/object:Gem::Version
62
+ version: 0.0.1
68
63
  type: :runtime
69
- version_requirements: *id003
70
- - !ruby/object:Gem::Dependency
71
- name: amq-client
72
64
  prerelease: false
73
- requirement: &id004 !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - "="
77
- - !ruby/object:Gem::Version
78
- hash: 19
79
- segments:
80
- - 1
81
- - 0
82
- - 2
83
- version: 1.0.2
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '='
68
+ - !ruby/object:Gem::Version
69
+ version: 0.0.1
70
+ - !ruby/object:Gem::Dependency
71
+ name: sensu-settings
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - '='
75
+ - !ruby/object:Gem::Version
76
+ version: 0.0.4
84
77
  type: :runtime
85
- version_requirements: *id004
86
- - !ruby/object:Gem::Dependency
87
- name: amqp
88
78
  prerelease: false
89
- requirement: &id005 !ruby/object:Gem::Requirement
90
- none: false
91
- requirements:
92
- - - "="
93
- - !ruby/object:Gem::Version
94
- hash: 23
95
- segments:
96
- - 1
97
- - 0
98
- - 0
99
- version: 1.0.0
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - '='
82
+ - !ruby/object:Gem::Version
83
+ version: 0.0.4
84
+ - !ruby/object:Gem::Dependency
85
+ name: sensu-extension
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '='
89
+ - !ruby/object:Gem::Version
90
+ version: 0.0.3
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '='
96
+ - !ruby/object:Gem::Version
97
+ version: 0.0.3
98
+ - !ruby/object:Gem::Dependency
99
+ name: sensu-extensions
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - '='
103
+ - !ruby/object:Gem::Version
104
+ version: 0.0.4
105
+ type: :runtime
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - '='
110
+ - !ruby/object:Gem::Version
111
+ version: 0.0.4
112
+ - !ruby/object:Gem::Dependency
113
+ name: sensu-transport
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - '='
117
+ - !ruby/object:Gem::Version
118
+ version: 0.0.2
119
+ type: :runtime
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - '='
124
+ - !ruby/object:Gem::Version
125
+ version: 0.0.2
126
+ - !ruby/object:Gem::Dependency
127
+ name: sensu-spawn
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - '='
131
+ - !ruby/object:Gem::Version
132
+ version: 0.0.3
100
133
  type: :runtime
101
- version_requirements: *id005
102
- - !ruby/object:Gem::Dependency
103
- name: em-redis-unified
104
134
  prerelease: false
105
- requirement: &id006 !ruby/object:Gem::Requirement
106
- none: false
107
- requirements:
108
- - - "="
109
- - !ruby/object:Gem::Version
110
- hash: 11
111
- segments:
112
- - 0
113
- - 4
114
- - 2
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - '='
138
+ - !ruby/object:Gem::Version
139
+ version: 0.0.3
140
+ - !ruby/object:Gem::Dependency
141
+ name: em-redis-unified
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - '='
145
+ - !ruby/object:Gem::Version
115
146
  version: 0.4.2
116
147
  type: :runtime
117
- version_requirements: *id006
118
- - !ruby/object:Gem::Dependency
119
- name: thin
120
148
  prerelease: false
121
- requirement: &id007 !ruby/object:Gem::Requirement
122
- none: false
123
- requirements:
124
- - - "="
125
- - !ruby/object:Gem::Version
126
- hash: 3
127
- segments:
128
- - 1
129
- - 5
130
- - 0
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - '='
152
+ - !ruby/object:Gem::Version
153
+ version: 0.4.2
154
+ - !ruby/object:Gem::Dependency
155
+ name: thin
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - '='
159
+ - !ruby/object:Gem::Version
131
160
  version: 1.5.0
132
161
  type: :runtime
133
- version_requirements: *id007
134
- - !ruby/object:Gem::Dependency
135
- name: sinatra
136
162
  prerelease: false
137
- requirement: &id008 !ruby/object:Gem::Requirement
138
- none: false
139
- requirements:
140
- - - "="
141
- - !ruby/object:Gem::Version
142
- hash: 17
143
- segments:
144
- - 1
145
- - 3
146
- - 5
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - '='
166
+ - !ruby/object:Gem::Version
167
+ version: 1.5.0
168
+ - !ruby/object:Gem::Dependency
169
+ name: sinatra
170
+ requirement: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - '='
173
+ - !ruby/object:Gem::Version
147
174
  version: 1.3.5
148
175
  type: :runtime
149
- version_requirements: *id008
150
- - !ruby/object:Gem::Dependency
151
- name: async_sinatra
152
176
  prerelease: false
153
- requirement: &id009 !ruby/object:Gem::Requirement
154
- none: false
155
- requirements:
156
- - - "="
157
- - !ruby/object:Gem::Version
158
- hash: 23
159
- segments:
160
- - 1
161
- - 0
162
- - 0
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - '='
180
+ - !ruby/object:Gem::Version
181
+ version: 1.3.5
182
+ - !ruby/object:Gem::Dependency
183
+ name: async_sinatra
184
+ requirement: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - '='
187
+ - !ruby/object:Gem::Version
163
188
  version: 1.0.0
164
189
  type: :runtime
165
- version_requirements: *id009
166
- - !ruby/object:Gem::Dependency
167
- name: em-worker
168
190
  prerelease: false
169
- requirement: &id010 !ruby/object:Gem::Requirement
170
- none: false
171
- requirements:
172
- - - "="
173
- - !ruby/object:Gem::Version
174
- hash: 27
175
- segments:
176
- - 0
177
- - 0
178
- - 2
179
- version: 0.0.2
180
- type: :runtime
181
- version_requirements: *id010
182
- - !ruby/object:Gem::Dependency
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - '='
194
+ - !ruby/object:Gem::Version
195
+ version: 1.0.0
196
+ - !ruby/object:Gem::Dependency
183
197
  name: rake
184
- prerelease: false
185
- requirement: &id011 !ruby/object:Gem::Requirement
186
- none: false
187
- requirements:
198
+ requirement: !ruby/object:Gem::Requirement
199
+ requirements:
188
200
  - - ">="
189
- - !ruby/object:Gem::Version
190
- hash: 3
191
- segments:
192
- - 0
193
- version: "0"
201
+ - !ruby/object:Gem::Version
202
+ version: '0'
194
203
  type: :development
195
- version_requirements: *id011
196
- - !ruby/object:Gem::Dependency
197
- name: rspec
198
204
  prerelease: false
199
- requirement: &id012 !ruby/object:Gem::Requirement
200
- none: false
201
- requirements:
205
+ version_requirements: !ruby/object:Gem::Requirement
206
+ requirements:
202
207
  - - ">="
203
- - !ruby/object:Gem::Version
204
- hash: 3
205
- segments:
206
- - 0
207
- version: "0"
208
+ - !ruby/object:Gem::Version
209
+ version: '0'
210
+ - !ruby/object:Gem::Dependency
211
+ name: rspec
212
+ requirement: !ruby/object:Gem::Requirement
213
+ requirements:
214
+ - - ">="
215
+ - !ruby/object:Gem::Version
216
+ version: '0'
208
217
  type: :development
209
- version_requirements: *id012
210
- - !ruby/object:Gem::Dependency
211
- name: em-http-request
212
218
  prerelease: false
213
- requirement: &id013 !ruby/object:Gem::Requirement
214
- none: false
215
- requirements:
219
+ version_requirements: !ruby/object:Gem::Requirement
220
+ requirements:
216
221
  - - ">="
217
- - !ruby/object:Gem::Version
218
- hash: 3
219
- segments:
220
- - 0
221
- version: "0"
222
+ - !ruby/object:Gem::Version
223
+ version: '0'
224
+ - !ruby/object:Gem::Dependency
225
+ name: em-http-request
226
+ requirement: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ version: '0'
222
231
  type: :development
223
- version_requirements: *id013
224
- description: A monitoring framework that aims to be simple, malleable, and scalable. Uses the publish/subscribe model.
225
- email:
232
+ prerelease: false
233
+ version_requirements: !ruby/object:Gem::Requirement
234
+ requirements:
235
+ - - ">="
236
+ - !ruby/object:Gem::Version
237
+ version: '0'
238
+ description: A monitoring framework that aims to be simple, malleable, and scalable.
239
+ Uses the publish/subscribe model.
240
+ email:
226
241
  - portertech@gmail.com
227
242
  - justin.kolberg@sonian.net
228
- executables:
243
+ executables:
229
244
  - sensu-api
230
245
  - sensu-client
231
246
  - sensu-server
232
247
  extensions: []
233
-
234
248
  extra_rdoc_files: []
235
-
236
- files:
249
+ files:
250
+ - CHANGELOG.md
251
+ - MIT-LICENSE.txt
252
+ - README.md
237
253
  - bin/sensu-api
238
254
  - bin/sensu-client
239
255
  - bin/sensu-server
256
+ - lib/sensu.rb
240
257
  - lib/sensu/api.rb
241
- - lib/sensu/base.rb
242
258
  - lib/sensu/cli.rb
243
259
  - lib/sensu/client.rb
244
260
  - lib/sensu/constants.rb
245
- - lib/sensu/extensions/handlers/debug.rb
246
- - lib/sensu/extensions/mutators/only_check_output.rb
247
- - lib/sensu/extensions.rb
248
- - lib/sensu/io.rb
249
- - lib/sensu/logstream.rb
250
- - lib/sensu/process.rb
251
- - lib/sensu/rabbitmq.rb
261
+ - lib/sensu/daemon.rb
252
262
  - lib/sensu/redis.rb
253
263
  - lib/sensu/sandbox.rb
254
264
  - lib/sensu/server.rb
255
- - lib/sensu/settings.rb
256
265
  - lib/sensu/socket.rb
257
266
  - lib/sensu/utilities.rb
258
- - lib/sensu.rb
259
267
  - sensu.gemspec
260
- - README.md
261
- - CHANGELOG.md
262
- - MIT-LICENSE.txt
263
- has_rdoc: true
264
268
  homepage: https://github.com/sensu/sensu
265
- licenses:
269
+ licenses:
266
270
  - MIT
271
+ metadata: {}
267
272
  post_install_message:
268
273
  rdoc_options: []
269
-
270
- require_paths:
274
+ require_paths:
271
275
  - lib
272
- required_ruby_version: !ruby/object:Gem::Requirement
273
- none: false
274
- requirements:
275
- - - ">="
276
- - !ruby/object:Gem::Version
277
- hash: 3
278
- segments:
279
- - 0
280
- version: "0"
281
- required_rubygems_version: !ruby/object:Gem::Requirement
282
- none: false
283
- requirements:
276
+ required_ruby_version: !ruby/object:Gem::Requirement
277
+ requirements:
284
278
  - - ">="
285
- - !ruby/object:Gem::Version
286
- hash: 3
287
- segments:
288
- - 0
289
- version: "0"
279
+ - !ruby/object:Gem::Version
280
+ version: '0'
281
+ required_rubygems_version: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - ">"
284
+ - !ruby/object:Gem::Version
285
+ version: 1.3.1
290
286
  requirements: []
291
-
292
287
  rubyforge_project:
293
- rubygems_version: 1.3.7
288
+ rubygems_version: 2.2.0
294
289
  signing_key:
295
- specification_version: 3
290
+ specification_version: 4
296
291
  summary: A monitoring framework
297
292
  test_files: []
298
-
293
+ has_rdoc: false