sensu-dashboard-sonian 0.9.5 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,448 +1,464 @@
1
- require 'eventmachine'
2
- require 'sinatra/async'
1
+ require 'sensu/config'
3
2
  require 'em-http-request'
4
3
  require 'em-websocket'
4
+ require 'sinatra/async'
5
5
  require 'sass'
6
- require 'json'
7
- require 'sensu/config'
8
-
9
- options = Sensu::Config.read_arguments(ARGV)
10
- config = Sensu::Config.new(options)
11
- SETTINGS = config.settings
12
6
 
13
- EventMachine.run do
7
+ class Dashboard < Sinatra::Base
8
+ register Sinatra::Async
14
9
 
15
- class DashboardServer < Sinatra::Base
10
+ def self.run(options={})
11
+ EM::run do
12
+ self.setup(options)
13
+ self.websocket_server
14
+ self.run!(:port => $settings.dashboard.port)
16
15
 
17
- register Sinatra::Async
18
- set :root, File.dirname(__FILE__)
19
- set :static, true
20
- set :public_folder, Proc.new { File.join(root, "public") }
21
-
22
- api_server = 'http://' + SETTINGS['api']['host'] + ':' + SETTINGS['api']['port'].to_s
23
-
24
- use Rack::Auth::Basic do |user, password|
25
- user == SETTINGS['dashboard']['user'] && password == SETTINGS['dashboard']['password']
16
+ %w[INT TERM].each do |signal|
17
+ Signal.trap(signal) do
18
+ self.stop(signal)
19
+ end
20
+ end
26
21
  end
22
+ end
27
23
 
28
- before do
29
- content_type 'application/json'
24
+ def self.setup(options={})
25
+ config = Sensu::Config.new(options)
26
+ $settings = config.settings
27
+ $logger = config.logger || config.open_log
28
+ unless $settings.key?('dashboard')
29
+ raise config.invalid_config('missing the following key: dashboard')
30
30
  end
31
-
32
- aget '/' do
33
- content_type 'text/html'
34
- @js = erb :event_templates, :layout => false
35
- body erb :index
31
+ unless $settings.dashboard.port.is_a?(Integer)
32
+ raise config.invalid_config('dashboard must have a port')
36
33
  end
37
-
38
- aget '/clients' do
39
- content_type 'text/html'
40
- @js = erb :client_templates, :layout => false
41
- body erb :clients
34
+ unless $settings.dashboard.user.is_a?(String) && $settings.dashboard.password.is_a?(String)
35
+ raise config.invalid_config('dashboard must have a user and password')
42
36
  end
43
-
44
- aget '/stashes' do
45
- content_type 'text/html'
46
- @js = erb :stash_templates, :layout => false
47
- body erb :stashes
37
+ if options[:daemonize]
38
+ Process.daemonize
48
39
  end
49
-
50
- aget '/css/sonian.css' do
51
- content_type 'text/css'
52
- body sass :sonian
40
+ if options[:pid_file]
41
+ Process.write_pid(options[:pid_file])
53
42
  end
43
+ $api_server = 'http://' + $settings.api.host + ':' + $settings.api.port.to_s
44
+ end
54
45
 
55
- # api proxy
56
- aget '/events.json' do
57
- begin
58
- http = EventMachine::HttpRequest.new("#{api_server}/events").get
59
- rescue => e
60
- puts e
61
- status 404
62
- body '{"error":"could not retrieve events from the sensu api"}'
63
- end
64
-
65
- http.errback do
66
- status 404
67
- body '{"error":"could not retrieve events from the sensu api"}'
46
+ def self.websocket_server
47
+ $websocket_connections = []
48
+ EM::WebSocket.start(:host => '0.0.0.0', :port => 9000) do |websocket|
49
+ websocket.onopen do
50
+ $logger.info('[websocket] -- client connected to websocket')
51
+ $websocket_connections.push(websocket)
68
52
  end
69
-
70
- http.callback do
71
- status http.response_header.status
72
- body http.response
53
+ websocket.onclose do
54
+ $logger.info('[websocket] -- client disconnected from websocket')
55
+ $websocket_connections.delete(websocket)
73
56
  end
74
57
  end
58
+ end
75
59
 
76
- # api proxy
77
- aget '/autocomplete.json' do
78
- multi = EventMachine::MultiRequest.new
79
-
80
- requests = [
81
- "#{api_server}/events",
82
- "#{api_server}/clients"
83
- ]
60
+ set :root, File.dirname(__FILE__)
61
+ set :static, true
62
+ set :public_folder, Proc.new { File.join(root, 'public') }
84
63
 
85
- requests.each do |url|
86
- multi.add EventMachine::HttpRequest.new(url).get
87
- end
64
+ use Rack::Auth::Basic do |user, password|
65
+ user == $settings.dashboard.user && password == $settings.dashboard.password
66
+ end
88
67
 
89
- multi.callback do
90
- events = {}
91
- clients = []
92
-
93
- multi.responses[:succeeded].each do |request|
94
- body = JSON.parse(request.response)
95
- case body
96
- when Hash
97
- events = body
98
- when Array
99
- clients = body
100
- end
101
- end
68
+ before do
69
+ content_type 'application/json'
70
+ end
102
71
 
103
- if events && clients
104
- autocomplete = []
105
- statuses = {:warning => [], :critical => [], :unknown => []}
106
- subscriptions = {}
107
- checks = []
108
-
109
- # searching by client
110
- clients.each do |client|
111
- client_name = client['name']
112
- if events.include?(client_name)
113
- autocomplete.push({:value => [client_name], :type => 'client', :name => client_name})
114
- client['subscriptions'].each do |subscription|
115
- subscriptions[subscription] ||= []
116
- subscriptions[subscription].push(client_name)
117
- end
118
- events[client_name].each do |check, event|
119
-
120
- case event['status']
121
- when 1
122
- statuses[:warning].push(event['status'])
123
- when 2
124
- statuses[:critical].push(event['status'])
125
- else
126
- statuses[:unknown].push(event['status'])
127
- end
128
- checks.push(check)
129
- end
130
- end
131
- end
72
+ aget '/' do
73
+ content_type 'text/html'
74
+ @js = erb :event_templates, :layout => false
75
+ body erb :index
76
+ end
132
77
 
133
- # searching by subscription
134
- subscriptions.each do |k, v|
135
- autocomplete.push({:value => v.uniq, :type => 'subscription', :name => k})
136
- end
78
+ aget '/clients' do
79
+ content_type 'text/html'
80
+ @js = erb :client_templates, :layout => false
81
+ body erb :clients
82
+ end
137
83
 
138
- # searching by status
139
- statuses.each do |k, v|
140
- autocomplete.push({:value => v.uniq, :type => 'status', :name => k})
141
- end
84
+ aget '/stashes' do
85
+ content_type 'text/html'
86
+ @js = erb :stash_templates, :layout => false
87
+ body erb :stashes
88
+ end
142
89
 
143
- # searching by check
144
- checks.uniq.each do |v|
145
- autocomplete.push({:value => [v], :type => 'check', :name => v})
146
- end
90
+ aget '/css/sonian.css' do
91
+ content_type 'text/css'
92
+ body sass :sonian
93
+ end
147
94
 
148
- body autocomplete.to_json
149
- else
150
- status 404
151
- body '{"error":"could not retrieve events and/or clients from the sensu api"}'
152
- end
95
+ apost '/events.json' do
96
+ $logger.debug('[events] -- ' + request.ip + ' -- POST -- triggering dashboard refresh')
97
+ unless $websocket_connections.empty?
98
+ $websocket_connections.each do |websocket|
99
+ websocket.send '{"update":"true"}'
153
100
  end
154
101
  end
102
+ body '{"success":"triggered dashboard refresh"}'
103
+ end
155
104
 
156
- aget '/clients.json' do
157
- begin
158
- http = EventMachine::HttpRequest.new("#{api_server}/clients").get
159
- rescue => e
160
- puts e
161
- status 404
162
- body '{"error":"could not retrieve clients from the sensu api"}'
163
- end
105
+ aget '/autocomplete.json' do
106
+ multi = EM::MultiRequest.new
164
107
 
165
- http.errback do
166
- status 404
167
- body '{"error":"could not retrieve clients from the sensu api"}'
168
- end
108
+ requests = [
109
+ $api_server + '/events',
110
+ $api_server + '/clients'
111
+ ]
169
112
 
170
- http.callback do
171
- status http.response_header.status
172
- body http.response
173
- end
113
+ requests.each do |url|
114
+ multi.add EM::HttpRequest.new(url).get
174
115
  end
175
116
 
176
- # api proxy
177
- aget '/clients/autocomplete.json' do
178
- multi = EventMachine::MultiRequest.new
179
-
180
- requests = [
181
- "#{api_server}/clients"
182
- ]
183
-
184
- requests.each do |url|
185
- multi.add EventMachine::HttpRequest.new(url).get
186
- end
187
-
188
- multi.callback do
189
- events = {}
190
- clients = []
191
-
192
- multi.responses[:succeeded].each do |request|
193
- body = JSON.parse(request.response)
194
- case body
195
- when Array
196
- clients = body
197
- end
117
+ multi.callback do
118
+ events = {}
119
+ clients = []
120
+
121
+ multi.responses[:succeeded].each do |request|
122
+ body = JSON.parse(request.response)
123
+ case body
124
+ when Hash
125
+ events = body
126
+ when Array
127
+ clients = body
198
128
  end
129
+ end
199
130
 
200
- if clients
201
- autocomplete = []
202
- subscriptions = {}
131
+ if events && clients
132
+ autocomplete = []
133
+ statuses = {:warning => [], :critical => [], :unknown => []}
134
+ subscriptions = {}
135
+ checks = []
203
136
 
204
- # searching by client
205
- clients.each do |client|
206
- client_name = client['name']
137
+ # searching by client
138
+ clients.each do |client|
139
+ client_name = client['name']
140
+ if events.include?(client_name)
207
141
  autocomplete.push({:value => [client_name], :type => 'client', :name => client_name})
208
142
  client['subscriptions'].each do |subscription|
209
143
  subscriptions[subscription] ||= []
210
144
  subscriptions[subscription].push(client_name)
211
145
  end
146
+ events[client_name].each do |check, event|
147
+ case event['status']
148
+ when 1
149
+ statuses[:warning].push(event['status'])
150
+ when 2
151
+ statuses[:critical].push(event['status'])
152
+ else
153
+ statuses[:unknown].push(event['status'])
154
+ end
155
+ checks.push(check)
156
+ end
212
157
  end
158
+ end
213
159
 
214
- # searching by subscription
215
- subscriptions.each do |k, v|
216
- autocomplete.push({:value => v.uniq, :type => 'subscription', :name => k})
217
- end
160
+ # searching by subscription
161
+ subscriptions.each do |k, v|
162
+ autocomplete.push({:value => v.uniq, :type => 'subscription', :name => k})
163
+ end
218
164
 
219
- body autocomplete.to_json
220
- else
221
- status 404
222
- body '{"error":"could not retrieve clients from the sensu api"}'
165
+ # searching by status
166
+ statuses.each do |k, v|
167
+ autocomplete.push({:value => v.uniq, :type => 'status', :name => k})
223
168
  end
224
- end
225
- end
226
169
 
227
- aget '/client/:id.json' do |id|
228
- begin
229
- http = EventMachine::HttpRequest.new("#{api_server}/client/#{id}").get
230
- rescue => e
231
- puts e
232
- status 404
233
- body '{"error":"could not retrieve client from the sensu api"}'
234
- end
170
+ # searching by check
171
+ checks.uniq.each do |v|
172
+ autocomplete.push({:value => [v], :type => 'check', :name => v})
173
+ end
235
174
 
236
- http.errback do
175
+ body autocomplete.to_json
176
+ else
237
177
  status 404
238
- body '{"error":"could not retrieve client from the sensu api"}'
178
+ body '{"error":"could not retrieve events and/or clients from the sensu api"}'
239
179
  end
180
+ end
181
+ end
240
182
 
241
- http.callback do
242
- status http.response_header.status
243
- body http.response
244
- end
183
+ aget '/clients/autocomplete.json' do
184
+ multi = EM::MultiRequest.new
185
+
186
+ requests = [
187
+ $api_server + '/clients'
188
+ ]
189
+
190
+ requests.each do |url|
191
+ multi.add EM::HttpRequest.new(url).get
245
192
  end
246
193
 
247
- adelete '/client/:id.json' do |id|
248
- begin
249
- http = EventMachine::HttpRequest.new("#{api_server}/client/#{id}").delete
250
- rescue => e
251
- puts e
252
- status 404
253
- body '{"error":"could not delete client from the sensu api"}'
194
+ multi.callback do
195
+ events = {}
196
+ clients = []
197
+
198
+ multi.responses[:succeeded].each do |request|
199
+ body = JSON.parse(request.response)
200
+ case body
201
+ when Array
202
+ clients = body
203
+ end
254
204
  end
255
205
 
256
- http.errback do
206
+ if clients
207
+ autocomplete = []
208
+ subscriptions = {}
209
+
210
+ # searching by client
211
+ clients.each do |client|
212
+ client_name = client['name']
213
+ autocomplete.push({:value => [client_name], :type => 'client', :name => client_name})
214
+ client['subscriptions'].each do |subscription|
215
+ subscriptions[subscription] ||= []
216
+ subscriptions[subscription].push(client_name)
217
+ end
218
+ end
219
+
220
+ # searching by subscription
221
+ subscriptions.each do |k, v|
222
+ autocomplete.push({:value => v.uniq, :type => 'subscription', :name => k})
223
+ end
224
+
225
+ body autocomplete.to_json
226
+ else
257
227
  status 404
258
- body '{"error":"could not delete client from the sensu api"}'
228
+ body '{"error":"could not retrieve clients from the sensu api"}'
259
229
  end
230
+ end
231
+ end
260
232
 
261
- http.callback do
262
- status http.response_header.status
263
- body http.response
264
- end
233
+ #
234
+ # API Proxy
235
+ #
236
+
237
+ aget '/events.json' do
238
+ begin
239
+ http = EM::HttpRequest.new($api_server + '/events').get
240
+ rescue => e
241
+ $logger.warning(e)
242
+ status 404
243
+ body '{"error":"could not retrieve events from the sensu api"}'
265
244
  end
266
245
 
267
- aget '/stash/*.json' do |path|
268
- begin
269
- http = EventMachine::HttpRequest.new("#{api_server}/stash/#{path}").get
270
- rescue => e
271
- puts e
272
- status 404
273
- body '{"error":"could not retrieve a stash from the sensu api"}'
274
- end
246
+ http.errback do
247
+ status 404
248
+ body '{"error":"could not retrieve events from the sensu api"}'
249
+ end
275
250
 
276
- http.errback do
277
- status 404
278
- body '{"error":"could not retrieve a stash from the sensu api"}'
279
- end
251
+ http.callback do
252
+ status http.response_header.status
253
+ body http.response
254
+ end
255
+ end
280
256
 
281
- http.callback do
282
- status http.response_header.status
283
- body http.response
284
- end
257
+ aget '/clients.json' do
258
+ begin
259
+ http = EM::HttpRequest.new($api_server + '/clients').get
260
+ rescue => e
261
+ $logger.warning(e)
262
+ status 404
263
+ body '{"error":"could not retrieve clients from the sensu api"}'
285
264
  end
286
265
 
287
- apost '/stash/*.json' do |path|
288
- begin
289
- request_options = {
290
- :body => {'timestamp' => Time.now.to_i}.to_json,
291
- :head => {
292
- 'content-type' => 'application/json'
293
- }
294
- }
295
- http = EventMachine::HttpRequest.new("#{api_server}/stash/#{path}").post request_options
296
- rescue => e
297
- puts e
298
- status 404
299
- body '{"error":"could not create a stash with the sensu api"}'
300
- end
266
+ http.errback do
267
+ status 404
268
+ body '{"error":"could not retrieve clients from the sensu api"}'
269
+ end
301
270
 
302
- http.errback do
303
- status 404
304
- body '{"error":"could not create a stash with the sensu api"}'
305
- end
271
+ http.callback do
272
+ status http.response_header.status
273
+ body http.response
274
+ end
275
+ end
306
276
 
307
- http.callback do
308
- status http.response_header.status
309
- body http.response
310
- end
277
+ aget '/client/:id.json' do |id|
278
+ begin
279
+ http = EM::HttpRequest.new($api_server + '/client/' + id).get
280
+ rescue => e
281
+ $logger.warning(e)
282
+ status 404
283
+ body '{"error":"could not retrieve client from the sensu api"}'
311
284
  end
312
285
 
313
- adelete '/stash/*.json' do |path|
314
- begin
315
- http = EventMachine::HttpRequest.new("#{api_server}/stash/#{path}").delete
316
- rescue => e
317
- puts e
318
- status 404
319
- body '{"error":"could not delete a stash with the sensu api"}'
320
- end
286
+ http.errback do
287
+ status 404
288
+ body '{"error":"could not retrieve client from the sensu api"}'
289
+ end
321
290
 
322
- http.errback do
323
- status 404
324
- body '{"error":"could not delete a stash with the sensu api"}'
325
- end
291
+ http.callback do
292
+ status http.response_header.status
293
+ body http.response
294
+ end
295
+ end
326
296
 
327
- http.callback do
328
- status http.response_header.status
329
- body http.response
330
- end
297
+ adelete '/client/:id.json' do |id|
298
+ begin
299
+ http = EventMachine::HttpRequest.new($api_server + '/client/' + id).delete
300
+ rescue => e
301
+ $logger.warning(e)
302
+ status 404
303
+ body '{"error":"could not delete client from the sensu api"}'
331
304
  end
332
305
 
333
- apost '/event/resolve.json' do
334
- begin
335
- request_options = {
336
- :body => request.body.read,
337
- :head => {
338
- 'content-type' => 'application/json'
339
- }
340
- }
341
- http = EventMachine::HttpRequest.new("#{api_server}/event/resolve").post request_options
342
- rescue => e
343
- puts e
344
- status 404
345
- body '{"error":"could not resolve an event with the sensu api"}'
346
- end
306
+ http.errback do
307
+ status 404
308
+ body '{"error":"could not delete client from the sensu api"}'
309
+ end
347
310
 
348
- http.errback do
349
- status 404
350
- body '{"error":"could not resolve an event with the sensu api"}'
351
- end
311
+ http.callback do
312
+ status http.response_header.status
313
+ body http.response
314
+ end
315
+ end
352
316
 
353
- http.callback do
354
- status http.response_header.status
355
- body http.response
356
- end
317
+ aget '/stash/*.json' do |path|
318
+ begin
319
+ http = EM::HttpRequest.new($api_server + '/stash/' + path).get
320
+ rescue => e
321
+ $logger.warning(e)
322
+ status 404
323
+ body '{"error":"could not retrieve a stash from the sensu api"}'
324
+ end
325
+
326
+ http.errback do
327
+ status 404
328
+ body '{"error":"could not retrieve a stash from the sensu api"}'
357
329
  end
358
330
 
359
- aget '/stashes.json' do
360
- begin
361
- request_options = {
362
- # :body => request.body.read,
363
- :head => {
364
- 'content-type' => 'application/json'
365
- }
331
+ http.callback do
332
+ status http.response_header.status
333
+ body http.response
334
+ end
335
+ end
336
+
337
+ apost '/stash/*.json' do |path|
338
+ begin
339
+ request_options = {
340
+ :body => {'timestamp' => Time.now.to_i}.to_json,
341
+ :head => {
342
+ 'content-type' => 'application/json'
366
343
  }
367
- http = EventMachine::HttpRequest.new("#{api_server}/stashes").get request_options
368
- rescue => e
369
- puts e
370
- status 404
371
- body '{"error":"could not retrieve a list of stashes from the sensu api"}'
372
- end
344
+ }
345
+ http = EM::HttpRequest.new($api_server + '/stash/' + path).post request_options
346
+ rescue => e
347
+ $logger.warning(e)
348
+ status 404
349
+ body '{"error":"could not create a stash with the sensu api"}'
350
+ end
373
351
 
374
- http.errback do
375
- status 404
376
- body '{"error":"could not retrieve a list of stashes from the sensu api"}'
377
- end
352
+ http.errback do
353
+ status 404
354
+ body '{"error":"could not create a stash with the sensu api"}'
355
+ end
378
356
 
379
- http.callback do
380
- resp = http.response
381
- status http.response_header.status
382
- body resp
383
- end
357
+ http.callback do
358
+ status http.response_header.status
359
+ body http.response
384
360
  end
361
+ end
385
362
 
386
- apost '/stashes.json' do
387
- begin
388
- request_options = {
389
- :body => request.body.read,
390
- :head => {
391
- 'content-type' => 'application/json'
392
- }
393
- }
394
- http = EventMachine::HttpRequest.new("#{api_server}/stashes").post request_options
395
- rescue => e
396
- puts e
397
- status 404
398
- body '{\"error\":\"could not retrieve a list of stashes from the sensu api\"}'
399
- end
363
+ adelete '/stash/*.json' do |path|
364
+ begin
365
+ http = EM::HttpRequest.new($api_server + '/stash/' + path).delete
366
+ rescue => e
367
+ $logger.warning(e)
368
+ status 404
369
+ body '{"error":"could not delete a stash with the sensu api"}'
370
+ end
400
371
 
401
- http.errback do
402
- status 404
403
- body '{\"error\":\"could not retrieve a list of stashes from the sensu api\"}'
404
- end
372
+ http.errback do
373
+ status 404
374
+ body '{"error":"could not delete a stash with the sensu api"}'
375
+ end
405
376
 
406
- http.callback do
407
- resp = http.response
408
- puts resp
409
- status http.response_header.status
410
- body resp
411
- end
377
+ http.callback do
378
+ status http.response_header.status
379
+ body http.response
412
380
  end
381
+ end
413
382
 
414
- websocket_connections = Array.new
415
- EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 9000) do |websocket|
416
- websocket.onopen do
417
- websocket_connections.push websocket
418
- puts 'client connected to websocket'
419
- end
420
- websocket.onclose do
421
- websocket_connections.delete websocket
422
- puts 'client disconnected from websocket'
423
- end
383
+ apost '/event/resolve.json' do
384
+ begin
385
+ request_options = {
386
+ :body => request.body.read,
387
+ :head => {
388
+ 'content-type' => 'application/json'
389
+ }
390
+ }
391
+ http = EM::HttpRequest.new($api_server + '/event/resolve').post request_options
392
+ rescue => e
393
+ $logger.warning(e)
394
+ status 404
395
+ body '{"error":"could not resolve an event with the sensu api"}'
424
396
  end
425
397
 
426
- apost '/events.json' do
427
- unless websocket_connections.empty?
428
- websocket_connections.each do |websocket|
429
- websocket.send '{"update":"true"}'
430
- end
431
- end
432
- body '{"success":"triggered dashboard refresh"}'
398
+ http.errback do
399
+ status 404
400
+ body '{"error":"could not resolve an event with the sensu api"}'
401
+ end
402
+
403
+ http.callback do
404
+ status http.response_header.status
405
+ body http.response
433
406
  end
434
407
  end
435
408
 
436
- DashboardServer.run!({:port => SETTINGS['dashboard']['port']})
409
+ aget '/stashes.json' do
410
+ begin
411
+ http = EM::HttpRequest.new($api_server + '/stashes').get
412
+ rescue => e
413
+ $logger.warning(e)
414
+ status 404
415
+ body '{"error":"could not retrieve a list of stashes from the sensu api"}'
416
+ end
437
417
 
438
- #
439
- # Recognize exit command
440
- #
441
- Signal.trap("INT") do
442
- EM.stop
418
+ http.errback do
419
+ status 404
420
+ body '{"error":"could not retrieve a list of stashes from the sensu api"}'
421
+ end
422
+
423
+ http.callback do
424
+ status http.response_header.status
425
+ body http.response
426
+ end
443
427
  end
444
- Signal.trap("TERM") do
445
- EM.stop
428
+
429
+ apost '/stashes.json' do
430
+ begin
431
+ request_options = {
432
+ :body => request.body.read,
433
+ :head => {
434
+ 'content-type' => 'application/json'
435
+ }
436
+ }
437
+ http = EM::HttpRequest.new($api_server + '/stashes').post request_options
438
+ rescue => e
439
+ $logger.warning(e)
440
+ status 404
441
+ body '{"error":"could not retrieve a list of stashes from the sensu api"}'
442
+ end
443
+
444
+ http.errback do
445
+ status 404
446
+ body '{"error":"could not retrieve a list of stashes from the sensu api"}'
447
+ end
448
+
449
+ http.callback do
450
+ status http.response_header.status
451
+ body http.response
452
+ end
446
453
  end
447
454
 
455
+ def self.stop(signal)
456
+ $logger.warn('[stop] -- stopping sensu dashboard -- ' + signal)
457
+ EM::Timer.new(1) do
458
+ EM::stop_event_loop
459
+ end
460
+ end
448
461
  end
462
+
463
+ options = Sensu::Config.read_arguments(ARGV)
464
+ Dashboard.run(options)
@@ -1,5 +1,5 @@
1
1
  module Sensu
2
2
  module Dashboard
3
- VERSION = "0.9.5"
3
+ VERSION = "0.9.6"
4
4
  end
5
5
  end
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.summary = %q{A web interface for sensu, a publish/subscribe server monitoring framework}
12
12
  s.description = %q{Display current events and clients in sensu via a simple web interface. Please use the sensu-dashboard gem as this gem is for Sonian use only.}
13
13
 
14
- s.add_dependency("sensu")
14
+ s.add_dependency("sensu", "~> 0.9.1")
15
15
  s.add_dependency("em-http-request", "0.3.0")
16
16
  s.add_dependency("em-websocket")
17
17
  s.add_dependency("sass")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-dashboard-sonian
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
4
+ hash: 55
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 5
10
- version: 0.9.5
9
+ - 6
10
+ version: 0.9.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Kolberg
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-12-27 00:00:00 -08:00
19
+ date: 2011-12-28 00:00:00 -08:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -25,12 +25,14 @@ dependencies:
25
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
26
  none: false
27
27
  requirements:
28
- - - ">="
28
+ - - ~>
29
29
  - !ruby/object:Gem::Version
30
- hash: 3
30
+ hash: 57
31
31
  segments:
32
32
  - 0
33
- version: "0"
33
+ - 9
34
+ - 1
35
+ version: 0.9.1
34
36
  type: :runtime
35
37
  version_requirements: *id001
36
38
  - !ruby/object:Gem::Dependency