flapjack 0.6.43 → 0.6.44
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.
- data/bin/flapjack +4 -2
- data/bin/flapjack-nagios-receiver +4 -1
- data/bin/flapjack-populator +4 -1
- data/etc/flapjack_config.yaml.example +111 -106
- data/features/steps/notifications_steps.rb +6 -6
- data/lib/flapjack/configuration.rb +76 -24
- data/lib/flapjack/coordinator.rb +27 -44
- data/lib/flapjack/data/entity.rb +28 -7
- data/lib/flapjack/data/entity_check.rb +18 -20
- data/lib/flapjack/executive.rb +5 -4
- data/lib/flapjack/gateways/api.rb +391 -0
- data/lib/flapjack/gateways/api/entity_check_presenter.rb +185 -0
- data/lib/flapjack/gateways/api/entity_presenter.rb +70 -0
- data/lib/flapjack/gateways/base.rb +38 -0
- data/lib/flapjack/{notification → gateways}/email.rb +4 -5
- data/lib/flapjack/{notification → gateways}/email/alert.html.haml +0 -0
- data/lib/flapjack/{notification → gateways}/email/alert.text.erb +0 -0
- data/lib/flapjack/gateways/jabber.rb +387 -0
- data/lib/flapjack/gateways/oobetet.rb +241 -0
- data/lib/flapjack/gateways/pagerduty.rb +247 -0
- data/lib/flapjack/{notification → gateways}/sms.rb +5 -6
- data/lib/flapjack/{notification → gateways}/sms/messagenet.rb +1 -1
- data/lib/flapjack/gateways/web.rb +293 -0
- data/lib/flapjack/{web → gateways/web}/views/_css.haml +0 -0
- data/lib/flapjack/{web → gateways/web}/views/_nav.haml +0 -0
- data/lib/flapjack/{web → gateways/web}/views/check.haml +0 -0
- data/lib/flapjack/{web → gateways/web}/views/contact.haml +0 -0
- data/lib/flapjack/{web → gateways/web}/views/contacts.haml +0 -0
- data/lib/flapjack/{web → gateways/web}/views/index.haml +0 -0
- data/lib/flapjack/{web → gateways/web}/views/self_stats.haml +0 -0
- data/lib/flapjack/pikelet.rb +0 -23
- data/lib/flapjack/version.rb +1 -1
- data/spec/lib/flapjack/coordinator_spec.rb +56 -36
- data/spec/lib/flapjack/data/entity_spec.rb +53 -4
- data/spec/lib/flapjack/{api → gateways/api}/entity_check_presenter_spec.rb +10 -13
- data/spec/lib/flapjack/{api → gateways/api}/entity_presenter_spec.rb +10 -10
- data/spec/lib/flapjack/{api_spec.rb → gateways/api_spec.rb} +14 -14
- data/spec/lib/flapjack/gateways/email_spec.rb +6 -0
- data/spec/lib/flapjack/{jabber_spec.rb → gateways/jabber_spec.rb} +9 -9
- data/spec/lib/flapjack/{oobetet_spec.rb → gateways/oobetet_spec.rb} +10 -10
- data/spec/lib/flapjack/{pagerduty_spec.rb → gateways/pagerduty_spec.rb} +11 -11
- data/spec/lib/flapjack/gateways/sms_spec.rb +6 -0
- data/spec/lib/flapjack/{web_spec.rb → gateways/web_spec.rb} +4 -4
- metadata +46 -79
- data/bin/install-flapjack-systemwide +0 -58
- data/features/steps/flapjack-importer_steps.rb +0 -109
- data/features/steps/flapjack-worker_steps.rb +0 -68
- data/lib/flapjack/api.rb +0 -388
- data/lib/flapjack/api/entity_check_presenter.rb +0 -181
- data/lib/flapjack/api/entity_presenter.rb +0 -66
- data/lib/flapjack/cli/worker_manager.rb +0 -46
- data/lib/flapjack/inifile.rb +0 -44
- data/lib/flapjack/jabber.rb +0 -383
- data/lib/flapjack/notifier_engine.rb +0 -40
- data/lib/flapjack/notifiers/mailer/init.rb +0 -3
- data/lib/flapjack/notifiers/mailer/mailer.rb +0 -51
- data/lib/flapjack/notifiers/xmpp/init.rb +0 -3
- data/lib/flapjack/notifiers/xmpp/xmpp.rb +0 -46
- data/lib/flapjack/oobetet.rb +0 -240
- data/lib/flapjack/pagerduty.rb +0 -242
- data/lib/flapjack/web.rb +0 -286
- data/spec.old/check_sandbox/echo +0 -3
- data/spec.old/check_sandbox/sandboxed_check +0 -5
- data/spec.old/configs/flapjack-notifier-couchdb.ini +0 -25
- data/spec.old/configs/flapjack-notifier.ini +0 -39
- data/spec.old/configs/recipients.ini +0 -14
- data/spec.old/helpers.rb +0 -15
- data/spec.old/inifile_spec.rb +0 -66
- data/spec.old/mock-notifiers/mock/init.rb +0 -3
- data/spec.old/mock-notifiers/mock/mock.rb +0 -19
- data/spec.old/notifier-directories/spoons/testmailer/init.rb +0 -20
- data/spec.old/notifier_application_spec.rb +0 -222
- data/spec.old/notifier_filters_spec.rb +0 -52
- data/spec.old/notifier_options_multiplexer_spec.rb +0 -71
- data/spec.old/notifier_options_spec.rb +0 -115
- data/spec.old/notifier_spec.rb +0 -57
- data/spec.old/notifiers/mailer_spec.rb +0 -36
- data/spec.old/notifiers/xmpp_spec.rb +0 -36
- data/spec.old/persistence/datamapper_spec.rb +0 -74
- data/spec.old/persistence/mock_persistence_backend.rb +0 -26
- data/spec.old/simple.ini +0 -6
- data/spec.old/spec.opts +0 -4
- data/spec.old/test-filters/blocker.rb +0 -13
- data/spec.old/test-filters/mock.rb +0 -13
- data/spec.old/transports/beanstalkd_spec.rb +0 -44
- data/spec.old/transports/mock_transport.rb +0 -58
- data/spec.old/worker_application_spec.rb +0 -62
- data/spec.old/worker_options_spec.rb +0 -83
- data/spec/lib/flapjack/notification/email_spec.rb +0 -6
- data/spec/lib/flapjack/notification/sms_spec.rb +0 -6
@@ -2,9 +2,9 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
require 'yajl/json_gem'
|
4
4
|
|
5
|
-
require 'flapjack/pagerduty'
|
5
|
+
require 'flapjack/gateways/pagerduty'
|
6
6
|
|
7
|
-
describe Flapjack::Pagerduty, :redis => true do
|
7
|
+
describe Flapjack::Gateways::Pagerduty, :redis => true do
|
8
8
|
|
9
9
|
let(:config) { {'queue' => 'pagerduty_notifications'} }
|
10
10
|
|
@@ -14,16 +14,16 @@ describe Flapjack::Pagerduty, :redis => true do
|
|
14
14
|
redis = mock('redis')
|
15
15
|
redis.should_receive(:rpush).with(config['queue'], %q{{"notification_type":"shutdown"}})
|
16
16
|
|
17
|
-
fp = Flapjack::Pagerduty.new
|
17
|
+
fp = Flapjack::Gateways::Pagerduty.new
|
18
18
|
Flapjack::RedisPool.should_receive(:new)
|
19
19
|
fp.bootstrap(:config => config)
|
20
20
|
fp.add_shutdown_event(:redis => redis)
|
21
21
|
end
|
22
22
|
|
23
23
|
it "doesn't look for acknowledgements if this search is already running" do
|
24
|
-
@redis.set(Flapjack::Pagerduty::SEM_PAGERDUTY_ACKS_RUNNING, 'true')
|
24
|
+
@redis.set(Flapjack::Gateways::Pagerduty::SEM_PAGERDUTY_ACKS_RUNNING, 'true')
|
25
25
|
|
26
|
-
fp = Flapjack::Pagerduty.new
|
26
|
+
fp = Flapjack::Gateways::Pagerduty.new
|
27
27
|
Flapjack::RedisPool.should_receive(:new)
|
28
28
|
fp.bootstrap(:config => config)
|
29
29
|
fp.instance_variable_set("@redis_timer", @redis)
|
@@ -33,7 +33,7 @@ describe Flapjack::Pagerduty, :redis => true do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
it "looks for acknowledgements if the search is not already running" do
|
36
|
-
fp = Flapjack::Pagerduty.new
|
36
|
+
fp = Flapjack::Gateways::Pagerduty.new
|
37
37
|
Flapjack::RedisPool.should_receive(:new)
|
38
38
|
fp.bootstrap(:config => config)
|
39
39
|
fp.instance_variable_set("@redis_timer", @redis)
|
@@ -72,7 +72,7 @@ describe Flapjack::Pagerduty, :redis => true do
|
|
72
72
|
to_return(:status => 200, :body => response.to_json, :headers => {})
|
73
73
|
|
74
74
|
EM.synchrony do
|
75
|
-
fp = Flapjack::Pagerduty.new
|
75
|
+
fp = Flapjack::Gateways::Pagerduty.new
|
76
76
|
Flapjack::RedisPool.should_receive(:new)
|
77
77
|
fp.bootstrap(:config => config)
|
78
78
|
|
@@ -89,7 +89,7 @@ describe Flapjack::Pagerduty, :redis => true do
|
|
89
89
|
end
|
90
90
|
|
91
91
|
it "creates acknowledgements when pagerduty acknowledgements are found" do
|
92
|
-
fp = Flapjack::Pagerduty.new
|
92
|
+
fp = Flapjack::Gateways::Pagerduty.new
|
93
93
|
Flapjack::RedisPool.should_receive(:new)
|
94
94
|
fp.bootstrap(:config => config)
|
95
95
|
|
@@ -119,7 +119,7 @@ describe Flapjack::Pagerduty, :redis => true do
|
|
119
119
|
redis.should_receive(:del).with('sem_pagerduty_acks_running')
|
120
120
|
redis.should_receive(:empty!)
|
121
121
|
|
122
|
-
fp = Flapjack::Pagerduty.new
|
122
|
+
fp = Flapjack::Gateways::Pagerduty.new
|
123
123
|
Flapjack::RedisPool.should_receive(:new).and_return(redis)
|
124
124
|
fp.bootstrap(:config => config)
|
125
125
|
|
@@ -147,7 +147,7 @@ describe Flapjack::Pagerduty, :redis => true do
|
|
147
147
|
with(:body => body).to_return(:status => 200, :body => '{"status":"success"}', :headers => {})
|
148
148
|
|
149
149
|
EM.synchrony do
|
150
|
-
fp = Flapjack::Pagerduty.new
|
150
|
+
fp = Flapjack::Gateways::Pagerduty.new
|
151
151
|
Flapjack::RedisPool.should_receive(:new)
|
152
152
|
fp.bootstrap(:config => config)
|
153
153
|
|
@@ -170,7 +170,7 @@ describe Flapjack::Pagerduty, :redis => true do
|
|
170
170
|
|
171
171
|
EM.synchrony do
|
172
172
|
|
173
|
-
fp = Flapjack::Pagerduty.new
|
173
|
+
fp = Flapjack::Gateways::Pagerduty.new
|
174
174
|
Flapjack::RedisPool.should_receive(:new)
|
175
175
|
fp.bootstrap(:config => config)
|
176
176
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
require 'flapjack/web'
|
2
|
+
require 'flapjack/gateways/web'
|
3
3
|
|
4
4
|
# TODO move the rest of the redis operations down to data models, then this
|
5
5
|
# test won't need read/write redis data
|
6
6
|
|
7
|
-
describe Flapjack::Web, :sinatra => true, :redis => true do
|
7
|
+
describe Flapjack::Gateways::Web, :sinatra => true, :redis => true do
|
8
8
|
|
9
9
|
def app
|
10
|
-
Flapjack::Web
|
10
|
+
Flapjack::Gateways::Web
|
11
11
|
end
|
12
12
|
|
13
13
|
let(:entity_name) { 'example.com'}
|
@@ -19,7 +19,7 @@ describe Flapjack::Web, :sinatra => true, :redis => true do
|
|
19
19
|
|
20
20
|
before(:each) do
|
21
21
|
Flapjack::RedisPool.should_receive(:new).and_return(@redis)
|
22
|
-
Flapjack::Web.bootstrap(:config => {})
|
22
|
+
Flapjack::Gateways::Web.bootstrap(:config => {})
|
23
23
|
end
|
24
24
|
|
25
25
|
def expect_stats
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flapjack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.44
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-11-
|
14
|
+
date: 2012-11-09 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: daemons
|
@@ -329,7 +329,6 @@ executables:
|
|
329
329
|
- flapjack-populator
|
330
330
|
- flapper
|
331
331
|
- flapper-control
|
332
|
-
- install-flapjack-systemwide
|
333
332
|
extensions: []
|
334
333
|
extra_rdoc_files: []
|
335
334
|
files:
|
@@ -350,7 +349,6 @@ files:
|
|
350
349
|
- bin/flapjack-populator
|
351
350
|
- bin/flapper
|
352
351
|
- bin/flapper-control
|
353
|
-
- bin/install-flapjack-systemwide
|
354
352
|
- config.ru
|
355
353
|
- dist/etc/default/flapjack-notifier
|
356
354
|
- dist/etc/default/flapjack-workers
|
@@ -372,9 +370,7 @@ files:
|
|
372
370
|
- features/notifications.feature
|
373
371
|
- features/packaging-lintian.feature
|
374
372
|
- features/steps/events_steps.rb
|
375
|
-
- features/steps/flapjack-importer_steps.rb
|
376
373
|
- features/steps/flapjack-netsaint-parser_steps.rb
|
377
|
-
- features/steps/flapjack-worker_steps.rb
|
378
374
|
- features/steps/notifications_steps.rb
|
379
375
|
- features/steps/packaging-lintian_steps.rb
|
380
376
|
- features/steps/time_travel_steps.rb
|
@@ -382,12 +378,8 @@ files:
|
|
382
378
|
- features/support/silent_system.rb
|
383
379
|
- flapjack.gemspec
|
384
380
|
- lib/flapjack.rb
|
385
|
-
- lib/flapjack/api.rb
|
386
|
-
- lib/flapjack/api/entity_check_presenter.rb
|
387
|
-
- lib/flapjack/api/entity_presenter.rb
|
388
381
|
- lib/flapjack/checks/http_content
|
389
382
|
- lib/flapjack/checks/ping
|
390
|
-
- lib/flapjack/cli/worker_manager.rb
|
391
383
|
- lib/flapjack/configuration.rb
|
392
384
|
- lib/flapjack/coordinator.rb
|
393
385
|
- lib/flapjack/daemonizing.rb
|
@@ -406,64 +398,32 @@ files:
|
|
406
398
|
- lib/flapjack/filters/ok.rb
|
407
399
|
- lib/flapjack/filters/scheduled_maintenance.rb
|
408
400
|
- lib/flapjack/filters/unscheduled_maintenance.rb
|
409
|
-
- lib/flapjack/
|
410
|
-
- lib/flapjack/
|
411
|
-
- lib/flapjack/
|
412
|
-
- lib/flapjack/
|
413
|
-
- lib/flapjack/
|
414
|
-
- lib/flapjack/
|
415
|
-
- lib/flapjack/
|
416
|
-
- lib/flapjack/
|
417
|
-
- lib/flapjack/
|
418
|
-
- lib/flapjack/
|
419
|
-
- lib/flapjack/
|
420
|
-
- lib/flapjack/
|
421
|
-
- lib/flapjack/
|
422
|
-
- lib/flapjack/
|
401
|
+
- lib/flapjack/gateways/api.rb
|
402
|
+
- lib/flapjack/gateways/api/entity_check_presenter.rb
|
403
|
+
- lib/flapjack/gateways/api/entity_presenter.rb
|
404
|
+
- lib/flapjack/gateways/base.rb
|
405
|
+
- lib/flapjack/gateways/email.rb
|
406
|
+
- lib/flapjack/gateways/email/alert.html.haml
|
407
|
+
- lib/flapjack/gateways/email/alert.text.erb
|
408
|
+
- lib/flapjack/gateways/jabber.rb
|
409
|
+
- lib/flapjack/gateways/oobetet.rb
|
410
|
+
- lib/flapjack/gateways/pagerduty.rb
|
411
|
+
- lib/flapjack/gateways/sms.rb
|
412
|
+
- lib/flapjack/gateways/sms/messagenet.rb
|
413
|
+
- lib/flapjack/gateways/web.rb
|
414
|
+
- lib/flapjack/gateways/web/views/_css.haml
|
415
|
+
- lib/flapjack/gateways/web/views/_nav.haml
|
416
|
+
- lib/flapjack/gateways/web/views/check.haml
|
417
|
+
- lib/flapjack/gateways/web/views/contact.haml
|
418
|
+
- lib/flapjack/gateways/web/views/contacts.haml
|
419
|
+
- lib/flapjack/gateways/web/views/index.haml
|
420
|
+
- lib/flapjack/gateways/web/views/self_stats.haml
|
423
421
|
- lib/flapjack/patches.rb
|
424
422
|
- lib/flapjack/pikelet.rb
|
425
423
|
- lib/flapjack/rack_logger.rb
|
426
424
|
- lib/flapjack/redis_pool.rb
|
427
425
|
- lib/flapjack/utility.rb
|
428
426
|
- lib/flapjack/version.rb
|
429
|
-
- lib/flapjack/web.rb
|
430
|
-
- lib/flapjack/web/views/_css.haml
|
431
|
-
- lib/flapjack/web/views/_nav.haml
|
432
|
-
- lib/flapjack/web/views/check.haml
|
433
|
-
- lib/flapjack/web/views/contact.haml
|
434
|
-
- lib/flapjack/web/views/contacts.haml
|
435
|
-
- lib/flapjack/web/views/index.haml
|
436
|
-
- lib/flapjack/web/views/self_stats.haml
|
437
|
-
- spec.old/check_sandbox/echo
|
438
|
-
- spec.old/check_sandbox/sandboxed_check
|
439
|
-
- spec.old/configs/flapjack-notifier-couchdb.ini
|
440
|
-
- spec.old/configs/flapjack-notifier.ini
|
441
|
-
- spec.old/configs/recipients.ini
|
442
|
-
- spec.old/helpers.rb
|
443
|
-
- spec.old/inifile_spec.rb
|
444
|
-
- spec.old/mock-notifiers/mock/init.rb
|
445
|
-
- spec.old/mock-notifiers/mock/mock.rb
|
446
|
-
- spec.old/notifier-directories/spoons/testmailer/init.rb
|
447
|
-
- spec.old/notifier_application_spec.rb
|
448
|
-
- spec.old/notifier_filters_spec.rb
|
449
|
-
- spec.old/notifier_options_multiplexer_spec.rb
|
450
|
-
- spec.old/notifier_options_spec.rb
|
451
|
-
- spec.old/notifier_spec.rb
|
452
|
-
- spec.old/notifiers/mailer_spec.rb
|
453
|
-
- spec.old/notifiers/xmpp_spec.rb
|
454
|
-
- spec.old/persistence/datamapper_spec.rb
|
455
|
-
- spec.old/persistence/mock_persistence_backend.rb
|
456
|
-
- spec.old/simple.ini
|
457
|
-
- spec.old/spec.opts
|
458
|
-
- spec.old/test-filters/blocker.rb
|
459
|
-
- spec.old/test-filters/mock.rb
|
460
|
-
- spec.old/transports/beanstalkd_spec.rb
|
461
|
-
- spec.old/transports/mock_transport.rb
|
462
|
-
- spec.old/worker_application_spec.rb
|
463
|
-
- spec.old/worker_options_spec.rb
|
464
|
-
- spec/lib/flapjack/api/entity_check_presenter_spec.rb
|
465
|
-
- spec/lib/flapjack/api/entity_presenter_spec.rb
|
466
|
-
- spec/lib/flapjack/api_spec.rb
|
467
427
|
- spec/lib/flapjack/coordinator_spec.rb
|
468
428
|
- spec/lib/flapjack/data/contact_spec.rb
|
469
429
|
- spec/lib/flapjack/data/entity_check_spec.rb
|
@@ -479,15 +439,18 @@ files:
|
|
479
439
|
- spec/lib/flapjack/filters/ok_spec.rb
|
480
440
|
- spec/lib/flapjack/filters/scheduled_maintenance_spec.rb
|
481
441
|
- spec/lib/flapjack/filters/unscheduled_maintenance_spec.rb
|
482
|
-
- spec/lib/flapjack/
|
483
|
-
- spec/lib/flapjack/
|
484
|
-
- spec/lib/flapjack/
|
485
|
-
- spec/lib/flapjack/
|
486
|
-
- spec/lib/flapjack/
|
442
|
+
- spec/lib/flapjack/gateways/api/entity_check_presenter_spec.rb
|
443
|
+
- spec/lib/flapjack/gateways/api/entity_presenter_spec.rb
|
444
|
+
- spec/lib/flapjack/gateways/api_spec.rb
|
445
|
+
- spec/lib/flapjack/gateways/email_spec.rb
|
446
|
+
- spec/lib/flapjack/gateways/jabber_spec.rb
|
447
|
+
- spec/lib/flapjack/gateways/oobetet_spec.rb
|
448
|
+
- spec/lib/flapjack/gateways/pagerduty_spec.rb
|
449
|
+
- spec/lib/flapjack/gateways/sms_spec.rb
|
450
|
+
- spec/lib/flapjack/gateways/web_spec.rb
|
487
451
|
- spec/lib/flapjack/pikelet_spec.rb
|
488
452
|
- spec/lib/flapjack/redis_pool_spec.rb
|
489
453
|
- spec/lib/flapjack/utility_spec.rb
|
490
|
-
- spec/lib/flapjack/web_spec.rb
|
491
454
|
- spec/spec_helper.rb
|
492
455
|
- spec/support/profile_all_formatter.rb
|
493
456
|
- spec/support/uncolored_doc_formatter.rb
|
@@ -517,12 +480,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
517
480
|
- - ! '>='
|
518
481
|
- !ruby/object:Gem::Version
|
519
482
|
version: '0'
|
483
|
+
segments:
|
484
|
+
- 0
|
485
|
+
hash: 2640261595995146614
|
520
486
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
521
487
|
none: false
|
522
488
|
requirements:
|
523
489
|
- - ! '>='
|
524
490
|
- !ruby/object:Gem::Version
|
525
491
|
version: '0'
|
492
|
+
segments:
|
493
|
+
- 0
|
494
|
+
hash: 2640261595995146614
|
526
495
|
requirements: []
|
527
496
|
rubyforge_project:
|
528
497
|
rubygems_version: 1.8.23
|
@@ -534,17 +503,12 @@ test_files:
|
|
534
503
|
- features/notifications.feature
|
535
504
|
- features/packaging-lintian.feature
|
536
505
|
- features/steps/events_steps.rb
|
537
|
-
- features/steps/flapjack-importer_steps.rb
|
538
506
|
- features/steps/flapjack-netsaint-parser_steps.rb
|
539
|
-
- features/steps/flapjack-worker_steps.rb
|
540
507
|
- features/steps/notifications_steps.rb
|
541
508
|
- features/steps/packaging-lintian_steps.rb
|
542
509
|
- features/steps/time_travel_steps.rb
|
543
510
|
- features/support/env.rb
|
544
511
|
- features/support/silent_system.rb
|
545
|
-
- spec/lib/flapjack/api/entity_check_presenter_spec.rb
|
546
|
-
- spec/lib/flapjack/api/entity_presenter_spec.rb
|
547
|
-
- spec/lib/flapjack/api_spec.rb
|
548
512
|
- spec/lib/flapjack/coordinator_spec.rb
|
549
513
|
- spec/lib/flapjack/data/contact_spec.rb
|
550
514
|
- spec/lib/flapjack/data/entity_check_spec.rb
|
@@ -560,15 +524,18 @@ test_files:
|
|
560
524
|
- spec/lib/flapjack/filters/ok_spec.rb
|
561
525
|
- spec/lib/flapjack/filters/scheduled_maintenance_spec.rb
|
562
526
|
- spec/lib/flapjack/filters/unscheduled_maintenance_spec.rb
|
563
|
-
- spec/lib/flapjack/
|
564
|
-
- spec/lib/flapjack/
|
565
|
-
- spec/lib/flapjack/
|
566
|
-
- spec/lib/flapjack/
|
567
|
-
- spec/lib/flapjack/
|
527
|
+
- spec/lib/flapjack/gateways/api/entity_check_presenter_spec.rb
|
528
|
+
- spec/lib/flapjack/gateways/api/entity_presenter_spec.rb
|
529
|
+
- spec/lib/flapjack/gateways/api_spec.rb
|
530
|
+
- spec/lib/flapjack/gateways/email_spec.rb
|
531
|
+
- spec/lib/flapjack/gateways/jabber_spec.rb
|
532
|
+
- spec/lib/flapjack/gateways/oobetet_spec.rb
|
533
|
+
- spec/lib/flapjack/gateways/pagerduty_spec.rb
|
534
|
+
- spec/lib/flapjack/gateways/sms_spec.rb
|
535
|
+
- spec/lib/flapjack/gateways/web_spec.rb
|
568
536
|
- spec/lib/flapjack/pikelet_spec.rb
|
569
537
|
- spec/lib/flapjack/redis_pool_spec.rb
|
570
538
|
- spec/lib/flapjack/utility_spec.rb
|
571
|
-
- spec/lib/flapjack/web_spec.rb
|
572
539
|
- spec/spec_helper.rb
|
573
540
|
- spec/support/profile_all_formatter.rb
|
574
541
|
- spec/support/uncolored_doc_formatter.rb
|
@@ -1,58 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# 28 05 2009
|
4
|
-
# Lindsay Holmwood <lindsay@holmwood.id.au>
|
5
|
-
#
|
6
|
-
# Copies various scripts to appropriate places so Flapjack can be
|
7
|
-
# started as a daemon.
|
8
|
-
#
|
9
|
-
# I abhor these sort of scripts. It's only a stopgap until Flapjack
|
10
|
-
# gets packaged properly.
|
11
|
-
#
|
12
|
-
# If you would like to package, please let me know! Patches welcome.
|
13
|
-
#
|
14
|
-
|
15
|
-
unless ENV["USERNAME"] == "root"
|
16
|
-
puts 'You need to be root to run this script'
|
17
|
-
exit 1
|
18
|
-
end
|
19
|
-
|
20
|
-
# prompt/warn the user what is about to happen
|
21
|
-
puts "This script sets up Flapjack to run as a daemon. Specifically it: "
|
22
|
-
puts
|
23
|
-
puts " * installs init scripts and configs into /etc"
|
24
|
-
puts " * sets up /var/run/flapjack "
|
25
|
-
puts " * sets Flapjack to run on boot"
|
26
|
-
puts
|
27
|
-
puts "It will prompt you if it wants to overwrite an existing file."
|
28
|
-
puts
|
29
|
-
print "Do you want to continue? [y/n] "
|
30
|
-
continue = gets.strip
|
31
|
-
puts
|
32
|
-
|
33
|
-
unless continue == "y"
|
34
|
-
puts "Exiting."
|
35
|
-
exit
|
36
|
-
end
|
37
|
-
|
38
|
-
# setup
|
39
|
-
system("mkdir -p /var/run/flapjack")
|
40
|
-
system("chmod a+rw /var/run/flapjack")
|
41
|
-
|
42
|
-
etc_path=`gem contents auxesis-flapjack |grep etc`.split.first.gsub(/etc\/.+/, 'etc').strip
|
43
|
-
system("cp -aiv #{etc_path}/* /etc")
|
44
|
-
|
45
|
-
# set sequence number to 50 so beanstalkd has a chance to boot
|
46
|
-
system("update-rc.d flapjack-workers defaults 50")
|
47
|
-
system("update-rc.d flapjack-executive defaults 50")
|
48
|
-
|
49
|
-
puts
|
50
|
-
puts "Setup complete!"
|
51
|
-
puts
|
52
|
-
puts "You will want to customise:"
|
53
|
-
puts " * /etc/flapjack/recipients.yaml"
|
54
|
-
puts " * /etc/flapjack/flapjack-executive.yaml"
|
55
|
-
puts
|
56
|
-
puts ".examples of these files exist in /etc/flapjack/'
|
57
|
-
|
58
|
-
|
@@ -1,109 +0,0 @@
|
|
1
|
-
When /^I run "([^"]*)" with the following arguments:$/ do |script, table|
|
2
|
-
@arguments = []
|
3
|
-
table.hashes.each do |attrs|
|
4
|
-
@arguments << attrs["argument"]
|
5
|
-
end
|
6
|
-
|
7
|
-
command = "bin/#{script} #{@arguments.join(' ')}"
|
8
|
-
|
9
|
-
@output = `#{command}`
|
10
|
-
$?.exitstatus.should == 0
|
11
|
-
end
|
12
|
-
|
13
|
-
Then /^I should see a batch of checks in the output$/ do
|
14
|
-
@data["batches"].should_not be_nil
|
15
|
-
@data["batches"].size.should > 0
|
16
|
-
|
17
|
-
@data["batches"].each do |batch|
|
18
|
-
batch["checks"].should_not be_nil
|
19
|
-
batch["checks"].size.should > 0
|
20
|
-
|
21
|
-
batch["checks"].each do |check|
|
22
|
-
check["id"].should_not be_nil
|
23
|
-
check["command"].should_not be_nil
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
Then /^I should see a batch of checks with relationships in the output$/ do
|
29
|
-
@data["batches"].should_not be_nil
|
30
|
-
@data["batches"].size.should > 0
|
31
|
-
|
32
|
-
@data["batches"].each do |batch|
|
33
|
-
batch["checks"].should_not be_nil
|
34
|
-
batch["checks"].size.should > 0
|
35
|
-
|
36
|
-
batch["checks"].each do |check|
|
37
|
-
check.key?("parent_id").should be_true
|
38
|
-
check.key?("child_id").should be_true
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
Given /^no file exists at "([^"]*)"$/ do |filename|
|
44
|
-
FileUtils.rm_f(filename).should be_true
|
45
|
-
end
|
46
|
-
|
47
|
-
Then /^I should see valid JSON in "([^"]*)"$/ do |filename|
|
48
|
-
lambda {
|
49
|
-
file = File.new(filename, 'r')
|
50
|
-
parser = Yajl::Parser.new
|
51
|
-
@data = parser.parse(file)
|
52
|
-
}.should_not raise_error
|
53
|
-
end
|
54
|
-
|
55
|
-
Given /^I run the importer$/ do
|
56
|
-
pending # express the regexp above with the code you wish you had
|
57
|
-
end
|
58
|
-
|
59
|
-
Given /^the necessary checks and relationships are created$/ do
|
60
|
-
pending # express the regexp above with the code you wish you had
|
61
|
-
end
|
62
|
-
|
63
|
-
Then /^the latest batch of checks should be in the work queue$/ do
|
64
|
-
pending # express the regexp above with the code you wish you had
|
65
|
-
end
|
66
|
-
|
67
|
-
Then /^I should see "([^"]*)" in the output$/ do |regex|
|
68
|
-
@output.should =~ /#{regex}/i
|
69
|
-
end
|
70
|
-
|
71
|
-
Given /^beanstalkd is running$/ do
|
72
|
-
system("which beanstalkd > /dev/null 2>&1").should be_true
|
73
|
-
|
74
|
-
command = "beanstalkd"
|
75
|
-
@beanstalk = spawn_daemon(command)
|
76
|
-
|
77
|
-
# So beanstalkd has a moment to catch its breath.
|
78
|
-
sleep 0.5
|
79
|
-
end
|
80
|
-
|
81
|
-
Given /^there are no jobs on the "([^"]*)" beanstalkd queue$/ do |queue_name|
|
82
|
-
@queue = Beanstalk::Connection.new('localhost:11300', queue_name)
|
83
|
-
100.times { @queue.put('foo') }
|
84
|
-
until @queue.stats["current-jobs-ready"] == 0
|
85
|
-
job = @queue.reserve
|
86
|
-
job.delete
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
Then /^there should be several jobs on the "([^"]*)" beanstalkd queue$/ do |queue_name|
|
91
|
-
@queue = Beanstalk::Connection.new('localhost:11300', queue_name)
|
92
|
-
@queue.stats["current-jobs-ready"].should > 0
|
93
|
-
end
|
94
|
-
|
95
|
-
|
96
|
-
Then /^I should see a valid JSON batch in "([^"]*)"$/ do |filename|
|
97
|
-
lambda {
|
98
|
-
file = File.new(filename, 'r')
|
99
|
-
parser = Yajl::Parser.new
|
100
|
-
@data = parser.parse(file)
|
101
|
-
}.should_not raise_error
|
102
|
-
|
103
|
-
@data["checks"].size.should > 0
|
104
|
-
@data["checks"].each do |check|
|
105
|
-
%w(id command interval).each do |attr|
|
106
|
-
check[attr].should_not be_nil
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|