flapjack 0.7.27 → 0.7.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/.gitignore +1 -0
  2. data/CHANGELOG.md +9 -0
  3. data/bin/flapjack +22 -28
  4. data/bin/flapjack-nagios-receiver +5 -27
  5. data/bin/flapjack-populator +2 -2
  6. data/bin/flapper +13 -14
  7. data/bin/receive-events +3 -20
  8. data/bin/simulate-failed-check +3 -20
  9. data/etc/flapjack_config.yaml.example +119 -86
  10. data/features/cli.feature +69 -0
  11. data/features/events.feature +15 -0
  12. data/features/packaging-lintian.feature +4 -6
  13. data/features/rollup.feature +198 -0
  14. data/features/steps/cli_steps.rb +81 -0
  15. data/features/steps/events_steps.rb +26 -16
  16. data/features/steps/notifications_steps.rb +2 -2
  17. data/features/steps/packaging-lintian_steps.rb +2 -2
  18. data/features/support/daemons.rb +113 -0
  19. data/features/support/env.rb +26 -4
  20. data/lib/flapjack/configuration.rb +2 -0
  21. data/lib/flapjack/data/contact.rb +76 -5
  22. data/lib/flapjack/data/entity_check.rb +16 -0
  23. data/lib/flapjack/data/message.rb +11 -8
  24. data/lib/flapjack/data/notification.rb +31 -3
  25. data/lib/flapjack/data/notification_rule.rb +1 -1
  26. data/lib/flapjack/filters/delays.rb +1 -5
  27. data/lib/flapjack/gateways/api/contact_methods.rb +12 -6
  28. data/lib/flapjack/gateways/email.rb +35 -26
  29. data/lib/flapjack/gateways/email/alert.html.erb +4 -4
  30. data/lib/flapjack/gateways/email/alert.text.erb +2 -2
  31. data/lib/flapjack/gateways/email/alert_subject.text.erb +14 -0
  32. data/lib/flapjack/gateways/email/rollup.html.erb +48 -0
  33. data/lib/flapjack/gateways/email/rollup.text.erb +20 -0
  34. data/lib/flapjack/gateways/email/rollup_subject.text.erb +19 -0
  35. data/lib/flapjack/gateways/jabber.rb +97 -47
  36. data/lib/flapjack/gateways/sms_messagenet.rb +26 -24
  37. data/lib/flapjack/gateways/sms_messagenet/alert.text.erb +15 -0
  38. data/lib/flapjack/gateways/sms_messagenet/rollup.text.erb +34 -0
  39. data/lib/flapjack/gateways/web/views/contact.html.erb +16 -8
  40. data/lib/flapjack/notifier.rb +17 -4
  41. data/lib/flapjack/processor.rb +1 -1
  42. data/lib/flapjack/version.rb +1 -1
  43. data/spec/lib/flapjack/coordinator_spec.rb +19 -19
  44. data/spec/lib/flapjack/data/contact_spec.rb +100 -25
  45. data/spec/lib/flapjack/data/event_spec.rb +1 -1
  46. data/spec/lib/flapjack/data/message_spec.rb +1 -1
  47. data/spec/lib/flapjack/data/notification_spec.rb +11 -3
  48. data/spec/lib/flapjack/gateways/api/contact_methods_spec.rb +36 -17
  49. data/spec/lib/flapjack/gateways/api/entity_check_presenter_spec.rb +1 -1
  50. data/spec/lib/flapjack/gateways/api/entity_methods_spec.rb +38 -38
  51. data/spec/lib/flapjack/gateways/api/entity_presenter_spec.rb +15 -15
  52. data/spec/lib/flapjack/gateways/email_spec.rb +4 -4
  53. data/spec/lib/flapjack/gateways/jabber_spec.rb +13 -14
  54. data/spec/lib/flapjack/gateways/oobetet_spec.rb +2 -2
  55. data/spec/lib/flapjack/gateways/pagerduty_spec.rb +5 -5
  56. data/spec/lib/flapjack/gateways/sms_messagenet.spec.rb +1 -1
  57. data/spec/lib/flapjack/gateways/web/views/contact.html.erb_spec.rb +2 -2
  58. data/spec/lib/flapjack/gateways/web_spec.rb +4 -4
  59. data/spec/lib/flapjack/logger_spec.rb +3 -3
  60. data/spec/lib/flapjack/pikelet_spec.rb +10 -10
  61. data/spec/lib/flapjack/processor_spec.rb +4 -4
  62. data/spec/lib/flapjack/redis_pool_spec.rb +1 -1
  63. metadata +70 -5
  64. checksums.yaml +0 -15
@@ -3,13 +3,13 @@ require 'flapjack/gateways/api/entity_presenter'
3
3
 
4
4
  describe 'Flapjack::Gateways::API::EntityPresenter' do
5
5
 
6
- let(:entity) { mock(Flapjack::Data::Entity) }
6
+ let(:entity) { double(Flapjack::Data::Entity) }
7
7
 
8
- let(:check_a) { mock(Flapjack::Data::EntityCheck) }
9
- let(:check_b) { mock(Flapjack::Data::EntityCheck) }
8
+ let(:check_a) { double(Flapjack::Data::EntityCheck) }
9
+ let(:check_b) { double(Flapjack::Data::EntityCheck) }
10
10
 
11
- let(:checkpres_a) { mock(Flapjack::Gateways::API::EntityCheckPresenter) }
12
- let(:checkpres_b) { mock(Flapjack::Gateways::API::EntityCheckPresenter) }
11
+ let(:checkpres_a) { double(Flapjack::Gateways::API::EntityCheckPresenter) }
12
+ let(:checkpres_b) { double(Flapjack::Gateways::API::EntityCheckPresenter) }
13
13
 
14
14
  let(:time) { Time.now.to_i }
15
15
 
@@ -33,8 +33,8 @@ describe 'Flapjack::Gateways::API::EntityPresenter' do
33
33
  it 'returns a list of status hashes for each check on an entity' do
34
34
  expect_check_presenters
35
35
 
36
- status_a = mock('status_a')
37
- status_b = mock('status_b')
36
+ status_a = double('status_a')
37
+ status_b = double('status_b')
38
38
  checkpres_a.should_receive(:status).and_return(status_a)
39
39
  checkpres_b.should_receive(:status).and_return(status_b)
40
40
 
@@ -47,8 +47,8 @@ describe 'Flapjack::Gateways::API::EntityPresenter' do
47
47
 
48
48
  it "returns a list of outage hashes for each check on an entity" do
49
49
  expect_check_presenters
50
- outages_a = mock('outages_a')
51
- outages_b = mock('outages_b')
50
+ outages_a = double('outages_a')
51
+ outages_b = double('outages_b')
52
52
  checkpres_a.should_receive(:outages).with(start_time, end_time).
53
53
  and_return(outages_a)
54
54
  checkpres_b.should_receive(:outages).with(start_time, end_time).
@@ -62,8 +62,8 @@ describe 'Flapjack::Gateways::API::EntityPresenter' do
62
62
 
63
63
  it "returns a list of unscheduled maintenance periods for each check on an entity" do
64
64
  expect_check_presenters
65
- unsched_maint_a = mock('unsched_maint_a')
66
- unsched_maint_b = mock('unsched_maint_b')
65
+ unsched_maint_a = double('unsched_maint_a')
66
+ unsched_maint_b = double('unsched_maint_b')
67
67
  checkpres_a.should_receive(:unscheduled_maintenances).with(start_time, end_time).
68
68
  and_return(unsched_maint_a)
69
69
  checkpres_b.should_receive(:unscheduled_maintenances).with(start_time, end_time).
@@ -77,8 +77,8 @@ describe 'Flapjack::Gateways::API::EntityPresenter' do
77
77
 
78
78
  it "returns a list of scheduled maintenance periods for each check on an entity" do
79
79
  expect_check_presenters
80
- sched_maint_a = mock('sched_maint_a')
81
- sched_maint_b = mock('sched_maint_b')
80
+ sched_maint_a = double('sched_maint_a')
81
+ sched_maint_b = double('sched_maint_b')
82
82
  checkpres_a.should_receive(:scheduled_maintenances).with(start_time, end_time).
83
83
  and_return(sched_maint_a)
84
84
  checkpres_b.should_receive(:scheduled_maintenances).with(start_time, end_time).
@@ -92,8 +92,8 @@ describe 'Flapjack::Gateways::API::EntityPresenter' do
92
92
 
93
93
  it "returns a list of downtime for each check on an entity" do
94
94
  expect_check_presenters
95
- downtime_a = mock('downtime_a')
96
- downtime_b = mock('downtime_b')
95
+ downtime_a = double('downtime_a')
96
+ downtime_b = double('downtime_b')
97
97
  checkpres_a.should_receive(:downtime).with(start_time, end_time).
98
98
  and_return(downtime_a)
99
99
  checkpres_b.should_receive(:downtime).with(start_time, end_time).
@@ -4,12 +4,12 @@ require 'flapjack/gateways/email'
4
4
  describe Flapjack::Gateways::Email, :logger => true do
5
5
 
6
6
  it "sends a mail with text and html parts" do
7
- email = mock('email')
7
+ email = double('email')
8
8
 
9
- entity_check = mock(Flapjack::Data::EntityCheck)
9
+ entity_check = double(Flapjack::Data::EntityCheck)
10
10
  entity_check.should_receive(:in_scheduled_maintenance?).and_return(false)
11
11
  entity_check.should_receive(:in_unscheduled_maintenance?).and_return(false)
12
- redis = mock('redis')
12
+ redis = double('redis')
13
13
 
14
14
  Flapjack::Data::EntityCheck.should_receive(:for_event_id).
15
15
  with('example.com:ping', :redis => redis).and_return(entity_check)
@@ -19,7 +19,7 @@ describe Flapjack::Gateways::Email, :logger => true do
19
19
  hash_including(:host => 'localhost',
20
20
  :port => 25)).and_return(email)
21
21
 
22
- response = mock(response)
22
+ response = double(response)
23
23
  response.should_receive(:"respond_to?").with(:code).and_return(true)
24
24
  response.should_receive(:code).and_return(250)
25
25
 
@@ -13,7 +13,7 @@ describe Flapjack::Gateways::Jabber, :logger => true do
13
13
  }
14
14
  }
15
15
 
16
- let(:stanza) { mock('stanza') }
16
+ let(:stanza) { double('stanza') }
17
17
 
18
18
  it "hooks up event handlers to the appropriate methods" do
19
19
  Socket.should_receive(:gethostname).and_return('thismachine')
@@ -53,15 +53,15 @@ describe Flapjack::Gateways::Jabber, :logger => true do
53
53
 
54
54
  it "receives an acknowledgement message" do
55
55
  stanza.should_receive(:body).and_return('flapjack: ACKID 876 fixing now duration: 90m')
56
- from = mock('from')
56
+ from = double('from')
57
57
  from.should_receive(:stripped).and_return('sender')
58
58
  stanza.should_receive(:from).and_return(from)
59
59
 
60
- redis = mock('redis')
60
+ redis = double('redis')
61
61
  redis.should_receive(:hget).with('unacknowledged_failures', '876').
62
62
  and_return('main-example.com:ping')
63
63
 
64
- entity_check = mock(Flapjack::Data::EntityCheck)
64
+ entity_check = double(Flapjack::Data::EntityCheck)
65
65
  entity_check.should_receive(:in_unscheduled_maintenance?)
66
66
 
67
67
  Flapjack::Data::Event.should_receive(:create_acknowledgement).
@@ -88,21 +88,20 @@ describe Flapjack::Gateways::Jabber, :logger => true do
88
88
  and_return('flapjack: tell me about <span style="text-decoration: underline;">' +
89
89
  '<a href="http://example.org/">example.org</a></span>')
90
90
 
91
- from = mock('from')
91
+ from = double('from')
92
92
  from.should_receive(:stripped).and_return('sender')
93
93
  stanza.should_receive(:from).and_return(from)
94
94
 
95
- redis = mock('redis')
96
- entity = mock(Flapjack::Data::Entity)
95
+ redis = double('redis')
96
+ entity = double(Flapjack::Data::Entity)
97
97
  entity.should_receive(:check_list).and_return(['ping'])
98
98
 
99
99
  Flapjack::Data::Entity.should_receive(:find_by_name).with('example.org',
100
100
  :redis => redis).and_return(entity)
101
101
 
102
- entity_check = mock(Flapjack::Data::EntityCheck)
102
+ entity_check = double(Flapjack::Data::EntityCheck)
103
103
  entity_check.should_receive(:current_maintenance).with(:scheduled => true).and_return(nil)
104
104
  entity_check.should_receive(:current_maintenance).with(:unscheduled => true).and_return(nil)
105
- entity_check.should_receive(:check).and_return('ping')
106
105
 
107
106
  Flapjack::Data::EntityCheck.should_receive(:for_entity).with(entity, 'ping',
108
107
  :redis => redis).and_return(entity_check)
@@ -119,7 +118,7 @@ describe Flapjack::Gateways::Jabber, :logger => true do
119
118
 
120
119
  it "receives a message it doesn't understand" do
121
120
  stanza.should_receive(:body).once.and_return('flapjack: hello!')
122
- from = mock('from')
121
+ from = double('from')
123
122
  from.should_receive(:stripped).and_return('sender')
124
123
  stanza.should_receive(:from).and_return(from)
125
124
 
@@ -151,11 +150,11 @@ describe Flapjack::Gateways::Jabber, :logger => true do
151
150
  end
152
151
 
153
152
  it "prompts the blocking redis connection to quit" do
154
- shutdown_redis = mock('shutdown_redis')
153
+ shutdown_redis = double('shutdown_redis')
155
154
  shutdown_redis.should_receive(:rpush).with('jabber_notifications', %q{{"notification_type":"shutdown"}})
156
155
  EM::Hiredis.should_receive(:connect).and_return(shutdown_redis)
157
156
 
158
- redis = mock('redis')
157
+ redis = double('redis')
159
158
  Flapjack::RedisPool.should_receive(:new).and_return(redis)
160
159
  fj = Flapjack::Gateways::Jabber.new(:config => config, :logger => @logger)
161
160
 
@@ -163,11 +162,11 @@ describe Flapjack::Gateways::Jabber, :logger => true do
163
162
  end
164
163
 
165
164
  it "runs a blocking loop listening for notifications" do
166
- timer = mock('timer')
165
+ timer = double('timer')
167
166
  timer.should_receive(:cancel)
168
167
  EM::Synchrony.should_receive(:add_periodic_timer).with(1).and_return(timer)
169
168
 
170
- redis = mock('redis')
169
+ redis = double('redis')
171
170
 
172
171
  Flapjack::RedisPool.should_receive(:new).and_return(redis)
173
172
  fj = Flapjack::Gateways::Jabber.new(:config => config, :logger => @logger)
@@ -14,7 +14,7 @@ describe Flapjack::Gateways::Oobetet, :logger => true do
14
14
  }
15
15
  }
16
16
 
17
- let(:stanza) { mock('stanza') }
17
+ let(:stanza) { double('stanza') }
18
18
 
19
19
  it "raises an error if a required config setting is not set" do
20
20
  Socket.should_receive(:gethostname).and_return('thismachine')
@@ -111,7 +111,7 @@ describe Flapjack::Gateways::Oobetet, :logger => true do
111
111
  end
112
112
 
113
113
  it "runs a loop checking for recorded problems" do
114
- timer = mock('timer')
114
+ timer = double('timer')
115
115
  timer.should_receive(:cancel)
116
116
  EM::Synchrony.should_receive(:add_periodic_timer).with(60).and_return(timer)
117
117
 
@@ -8,10 +8,10 @@ describe Flapjack::Gateways::Pagerduty, :logger => true do
8
8
 
9
9
  let(:time) { Time.new }
10
10
 
11
- let(:redis) { mock('redis') }
11
+ let(:redis) { double('redis') }
12
12
 
13
13
  it "prompts the blocking redis connection to quit" do
14
- shutdown_redis = mock('shutdown_redis')
14
+ shutdown_redis = double('shutdown_redis')
15
15
  shutdown_redis.should_receive(:rpush).with(config['queue'], %q{{"notification_type":"shutdown"}})
16
16
  EM::Hiredis.should_receive(:connect).and_return(shutdown_redis)
17
17
 
@@ -94,7 +94,7 @@ describe Flapjack::Gateways::Pagerduty, :logger => true do
94
94
  Flapjack::RedisPool.should_receive(:new).and_return(redis)
95
95
  fp = Flapjack::Gateways::Pagerduty.new(:config => config, :logger => @logger)
96
96
 
97
- contact = mock('contact')
97
+ contact = double('contact')
98
98
  contact.should_receive(:pagerduty_credentials).and_return({
99
99
  'service_key' => '12345678',
100
100
  'subdomain"' => 'flpjck',
@@ -102,7 +102,7 @@ describe Flapjack::Gateways::Pagerduty, :logger => true do
102
102
  'password' => 'password123'
103
103
  })
104
104
 
105
- entity_check = mock('entity_check')
105
+ entity_check = double('entity_check')
106
106
  entity_check.should_receive(:check).and_return('PING')
107
107
  entity_check.should_receive(:contacts).and_return([contact])
108
108
  entity_check.should_receive(:entity_name).exactly(2).times.and_return('foo-app-01.bar.net')
@@ -117,7 +117,7 @@ describe Flapjack::Gateways::Pagerduty, :logger => true do
117
117
  end
118
118
 
119
119
  it "runs a blocking loop listening for notifications" do
120
- timer = mock('timer')
120
+ timer = double('timer')
121
121
  timer.should_receive(:cancel)
122
122
  EM::Synchrony.should_receive(:add_periodic_timer).with(10).and_return(timer)
123
123
 
@@ -3,7 +3,7 @@ require 'flapjack/gateways/sms_messagenet'
3
3
 
4
4
  describe Flapjack::Gateways::SmsMessagenet, :logger => true do
5
5
 
6
- let(:lock) { mock(Monitor) }
6
+ let(:lock) { double(Monitor) }
7
7
 
8
8
  let(:config) { {'username' => 'user',
9
9
  'password' => 'password'
@@ -3,12 +3,12 @@ require 'spec_helper'
3
3
  describe 'web/views/contact.html.erb', :erb_view => true do
4
4
 
5
5
  it "should escape unsafe check characters in URI parameters" do
6
- @contact = mock('contact')
6
+ @contact = double('contact')
7
7
  @contact.should_receive(:media)
8
8
  @contact.should_receive(:name).twice.and_return('Aeschylus')
9
9
  @contact.should_receive(:notification_rules)
10
10
 
11
- entity = mock('entity')
11
+ entity = double('entity')
12
12
  entity.should_receive(:name).exactly(3).times.and_return('abc-xyz-01')
13
13
 
14
14
  checks = ['Disk / Utilisation']
@@ -11,10 +11,10 @@ describe Flapjack::Gateways::Web, :sinatra => true, :logger => true do
11
11
  let(:entity_name_esc) { CGI.escape(entity_name) }
12
12
  let(:check) { 'ping' }
13
13
 
14
- let(:entity) { mock(Flapjack::Data::Entity) }
15
- let(:entity_check) { mock(Flapjack::Data::EntityCheck) }
14
+ let(:entity) { double(Flapjack::Data::Entity) }
15
+ let(:entity_check) { double(Flapjack::Data::EntityCheck) }
16
16
 
17
- let(:redis) { mock('redis') }
17
+ let(:redis) { double('redis') }
18
18
 
19
19
  before(:all) do
20
20
  Flapjack::Gateways::Web.class_eval {
@@ -239,7 +239,7 @@ describe Flapjack::Gateways::Web, :sinatra => true, :logger => true do
239
239
  end
240
240
 
241
241
  it "shows details of an individual contact found by id" do
242
- contact = mock('contact')
242
+ contact = double('contact')
243
243
  contact.should_receive(:name).twice.and_return("Smithson Smith")
244
244
  contact.should_receive(:media).exactly(3).times.and_return({})
245
245
  contact.should_receive(:entities).with(:checks => true).and_return([])
@@ -2,10 +2,10 @@ require 'spec_helper'
2
2
 
3
3
  describe Flapjack::Logger do
4
4
 
5
- let(:logger) { mock(::Logger) }
5
+ let(:logger) { double(::Logger) }
6
6
 
7
- let(:sys_logger) { mock(::Logger) }
8
- let(:syslog) { mock(Syslog) }
7
+ let(:sys_logger) { double(::Logger) }
8
+ let(:syslog) { double(Syslog) }
9
9
 
10
10
  it "creates a logger logging to STDOUT and syslog" do
11
11
  logger.should_receive(:formatter=).with(an_instance_of(Proc))
@@ -3,12 +3,12 @@ require 'flapjack/pikelet'
3
3
 
4
4
  describe Flapjack::Pikelet do
5
5
 
6
- let(:config) { mock('config') }
7
- let(:redis_config) { mock('redis_config') }
6
+ let(:config) { double('config') }
7
+ let(:redis_config) { double('redis_config') }
8
8
 
9
- let(:logger) { mock(Flapjack::Logger) }
9
+ let(:logger) { double(Flapjack::Logger) }
10
10
 
11
- let(:fiber) { mock(Fiber) }
11
+ let(:fiber) { double(Fiber) }
12
12
 
13
13
  let(:time) { Time.now }
14
14
 
@@ -21,9 +21,9 @@ describe Flapjack::Pikelet do
21
21
 
22
22
  config.should_receive(:[]).with('logger').and_return(nil)
23
23
 
24
- fc = mock('coordinator')
24
+ fc = double('coordinator')
25
25
 
26
- processor = mock('processor')
26
+ processor = double('processor')
27
27
  processor.should_receive(:start)
28
28
  Flapjack::Processor.should_receive(:new).with(:config => config,
29
29
  :redis_config => redis_config, :boot_time => time, :logger => logger, :coordinator => fc).
@@ -44,8 +44,8 @@ describe Flapjack::Pikelet do
44
44
  config.should_receive(:[]).with('logger').and_return(nil)
45
45
  config.should_receive(:[]).with('queue').and_return('email_notif')
46
46
 
47
- resque_redis = mock('resque_redis')
48
- redis = mock('redis')
47
+ resque_redis = double('resque_redis')
48
+ redis = double('redis')
49
49
  Flapjack::RedisPool.should_receive(:new).twice.and_return(resque_redis, redis)
50
50
  Resque.should_receive(:redis=).with(resque_redis)
51
51
 
@@ -56,7 +56,7 @@ describe Flapjack::Pikelet do
56
56
  Flapjack::Gateways::Email.should_receive(:instance_variable_set).
57
57
  with('@logger', logger)
58
58
 
59
- worker = mock('worker')
59
+ worker = double('worker')
60
60
  worker.should_receive(:work).with(0.1)
61
61
  Flapjack::Gateways::Email.should_receive(:start)
62
62
  EM::Resque::Worker.should_receive(:new).with('email_notif').and_return(worker)
@@ -77,7 +77,7 @@ describe Flapjack::Pikelet do
77
77
  config.should_receive(:[]).with('port').and_return(7654)
78
78
  config.should_receive(:[]).with('timeout').and_return(90)
79
79
 
80
- server = mock('server')
80
+ server = double('server')
81
81
  server.should_receive(:timeout=).with(90)
82
82
  server.should_receive(:start)
83
83
  Thin::Server.should_receive(:new).
@@ -7,7 +7,7 @@ describe Flapjack::Processor, :logger => true do
7
7
  # NB: this is only testing the public API of the Processor class, which is pretty limited.
8
8
  # (initialize, main, stop). Most test coverage for this class comes from the cucumber features.
9
9
 
10
- let(:config) { mock(Flapjack::Configuration) }
10
+ let(:config) { double(Flapjack::Configuration) }
11
11
 
12
12
  # TODO this does too much -- split it up
13
13
  it "starts up, runs and shuts down" do
@@ -19,7 +19,7 @@ describe Flapjack::Processor, :logger => true do
19
19
  Flapjack::Filters::Delays.should_receive(:new)
20
20
  Flapjack::Filters::Acknowledgement.should_receive(:new)
21
21
 
22
- redis = mock('redis')
22
+ redis = double('redis')
23
23
 
24
24
  redis.should_receive(:hset).with(/^executive_instance:/, "boot_time", anything)
25
25
  redis.should_receive(:hget).with('event_counters', 'all').and_return(nil)
@@ -43,11 +43,11 @@ describe Flapjack::Processor, :logger => true do
43
43
 
44
44
  Flapjack::RedisPool.should_receive(:new).and_return(redis)
45
45
 
46
- fc = mock('coordinator')
46
+ fc = double('coordinator')
47
47
 
48
48
  executive = Flapjack::Processor.new(:config => {}, :logger => @logger, :coordinator => fc)
49
49
 
50
- noop_evt = mock(Flapjack::Data::Event)
50
+ noop_evt = double(Flapjack::Data::Event)
51
51
  noop_evt.should_receive(:inspect)
52
52
  noop_evt.should_receive(:type).and_return('noop')
53
53
  Flapjack::Data::Event.should_receive(:next) {
@@ -8,7 +8,7 @@ describe Flapjack::RedisPool do
8
8
  redis_count = 3
9
9
 
10
10
  redis_conns = redis_count.times.collect {
11
- redis = mock('redis')
11
+ redis = double('redis')
12
12
  redis
13
13
  }
14
14
  ::Redis.should_receive(:new).exactly(redis_count).times.and_return(*redis_conns)
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flapjack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.27
4
+ version: 0.7.28
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Lindsay Holmwood
@@ -10,11 +11,12 @@ authors:
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2013-09-19 00:00:00.000000000 Z
14
+ date: 2013-10-21 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: dante
17
18
  requirement: !ruby/object:Gem::Requirement
19
+ none: false
18
20
  requirements:
19
21
  - - ! '>='
20
22
  - !ruby/object:Gem::Version
@@ -22,6 +24,7 @@ dependencies:
22
24
  type: :runtime
23
25
  prerelease: false
24
26
  version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
25
28
  requirements:
26
29
  - - ! '>='
27
30
  - !ruby/object:Gem::Version
@@ -29,6 +32,7 @@ dependencies:
29
32
  - !ruby/object:Gem::Dependency
30
33
  name: oj
31
34
  requirement: !ruby/object:Gem::Requirement
35
+ none: false
32
36
  requirements:
33
37
  - - ! '>='
34
38
  - !ruby/object:Gem::Version
@@ -36,6 +40,7 @@ dependencies:
36
40
  type: :runtime
37
41
  prerelease: false
38
42
  version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
39
44
  requirements:
40
45
  - - ! '>='
41
46
  - !ruby/object:Gem::Version
@@ -43,6 +48,7 @@ dependencies:
43
48
  - !ruby/object:Gem::Dependency
44
49
  name: eventmachine
45
50
  requirement: !ruby/object:Gem::Requirement
51
+ none: false
46
52
  requirements:
47
53
  - - ~>
48
54
  - !ruby/object:Gem::Version
@@ -50,6 +56,7 @@ dependencies:
50
56
  type: :runtime
51
57
  prerelease: false
52
58
  version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
53
60
  requirements:
54
61
  - - ~>
55
62
  - !ruby/object:Gem::Version
@@ -57,6 +64,7 @@ dependencies:
57
64
  - !ruby/object:Gem::Dependency
58
65
  name: hiredis
59
66
  requirement: !ruby/object:Gem::Requirement
67
+ none: false
60
68
  requirements:
61
69
  - - ! '>='
62
70
  - !ruby/object:Gem::Version
@@ -64,6 +72,7 @@ dependencies:
64
72
  type: :runtime
65
73
  prerelease: false
66
74
  version_requirements: !ruby/object:Gem::Requirement
75
+ none: false
67
76
  requirements:
68
77
  - - ! '>='
69
78
  - !ruby/object:Gem::Version
@@ -71,6 +80,7 @@ dependencies:
71
80
  - !ruby/object:Gem::Dependency
72
81
  name: em-synchrony
73
82
  requirement: !ruby/object:Gem::Requirement
83
+ none: false
74
84
  requirements:
75
85
  - - ~>
76
86
  - !ruby/object:Gem::Version
@@ -78,6 +88,7 @@ dependencies:
78
88
  type: :runtime
79
89
  prerelease: false
80
90
  version_requirements: !ruby/object:Gem::Requirement
91
+ none: false
81
92
  requirements:
82
93
  - - ~>
83
94
  - !ruby/object:Gem::Version
@@ -85,6 +96,7 @@ dependencies:
85
96
  - !ruby/object:Gem::Dependency
86
97
  name: em-http-request
87
98
  requirement: !ruby/object:Gem::Requirement
99
+ none: false
88
100
  requirements:
89
101
  - - ! '>='
90
102
  - !ruby/object:Gem::Version
@@ -92,6 +104,7 @@ dependencies:
92
104
  type: :runtime
93
105
  prerelease: false
94
106
  version_requirements: !ruby/object:Gem::Requirement
107
+ none: false
95
108
  requirements:
96
109
  - - ! '>='
97
110
  - !ruby/object:Gem::Version
@@ -99,6 +112,7 @@ dependencies:
99
112
  - !ruby/object:Gem::Dependency
100
113
  name: redis
101
114
  requirement: !ruby/object:Gem::Requirement
115
+ none: false
102
116
  requirements:
103
117
  - - ! '>='
104
118
  - !ruby/object:Gem::Version
@@ -106,6 +120,7 @@ dependencies:
106
120
  type: :runtime
107
121
  prerelease: false
108
122
  version_requirements: !ruby/object:Gem::Requirement
123
+ none: false
109
124
  requirements:
110
125
  - - ! '>='
111
126
  - !ruby/object:Gem::Version
@@ -113,6 +128,7 @@ dependencies:
113
128
  - !ruby/object:Gem::Dependency
114
129
  name: em-resque
115
130
  requirement: !ruby/object:Gem::Requirement
131
+ none: false
116
132
  requirements:
117
133
  - - ! '>='
118
134
  - !ruby/object:Gem::Version
@@ -120,6 +136,7 @@ dependencies:
120
136
  type: :runtime
121
137
  prerelease: false
122
138
  version_requirements: !ruby/object:Gem::Requirement
139
+ none: false
123
140
  requirements:
124
141
  - - ! '>='
125
142
  - !ruby/object:Gem::Version
@@ -127,6 +144,7 @@ dependencies:
127
144
  - !ruby/object:Gem::Dependency
128
145
  name: resque
129
146
  requirement: !ruby/object:Gem::Requirement
147
+ none: false
130
148
  requirements:
131
149
  - - ~>
132
150
  - !ruby/object:Gem::Version
@@ -134,6 +152,7 @@ dependencies:
134
152
  type: :runtime
135
153
  prerelease: false
136
154
  version_requirements: !ruby/object:Gem::Requirement
155
+ none: false
137
156
  requirements:
138
157
  - - ~>
139
158
  - !ruby/object:Gem::Version
@@ -141,6 +160,7 @@ dependencies:
141
160
  - !ruby/object:Gem::Dependency
142
161
  name: sinatra
143
162
  requirement: !ruby/object:Gem::Requirement
163
+ none: false
144
164
  requirements:
145
165
  - - ! '>='
146
166
  - !ruby/object:Gem::Version
@@ -148,6 +168,7 @@ dependencies:
148
168
  type: :runtime
149
169
  prerelease: false
150
170
  version_requirements: !ruby/object:Gem::Requirement
171
+ none: false
151
172
  requirements:
152
173
  - - ! '>='
153
174
  - !ruby/object:Gem::Version
@@ -155,6 +176,7 @@ dependencies:
155
176
  - !ruby/object:Gem::Dependency
156
177
  name: rack-fiber_pool
157
178
  requirement: !ruby/object:Gem::Requirement
179
+ none: false
158
180
  requirements:
159
181
  - - ! '>='
160
182
  - !ruby/object:Gem::Version
@@ -162,6 +184,7 @@ dependencies:
162
184
  type: :runtime
163
185
  prerelease: false
164
186
  version_requirements: !ruby/object:Gem::Requirement
187
+ none: false
165
188
  requirements:
166
189
  - - ! '>='
167
190
  - !ruby/object:Gem::Version
@@ -169,6 +192,7 @@ dependencies:
169
192
  - !ruby/object:Gem::Dependency
170
193
  name: thin
171
194
  requirement: !ruby/object:Gem::Requirement
195
+ none: false
172
196
  requirements:
173
197
  - - ! '>='
174
198
  - !ruby/object:Gem::Version
@@ -176,6 +200,7 @@ dependencies:
176
200
  type: :runtime
177
201
  prerelease: false
178
202
  version_requirements: !ruby/object:Gem::Requirement
203
+ none: false
179
204
  requirements:
180
205
  - - ! '>='
181
206
  - !ruby/object:Gem::Version
@@ -183,6 +208,7 @@ dependencies:
183
208
  - !ruby/object:Gem::Dependency
184
209
  name: mail
185
210
  requirement: !ruby/object:Gem::Requirement
211
+ none: false
186
212
  requirements:
187
213
  - - ! '>='
188
214
  - !ruby/object:Gem::Version
@@ -190,6 +216,7 @@ dependencies:
190
216
  type: :runtime
191
217
  prerelease: false
192
218
  version_requirements: !ruby/object:Gem::Requirement
219
+ none: false
193
220
  requirements:
194
221
  - - ! '>='
195
222
  - !ruby/object:Gem::Version
@@ -197,6 +224,7 @@ dependencies:
197
224
  - !ruby/object:Gem::Dependency
198
225
  name: blather
199
226
  requirement: !ruby/object:Gem::Requirement
227
+ none: false
200
228
  requirements:
201
229
  - - ~>
202
230
  - !ruby/object:Gem::Version
@@ -204,6 +232,7 @@ dependencies:
204
232
  type: :runtime
205
233
  prerelease: false
206
234
  version_requirements: !ruby/object:Gem::Requirement
235
+ none: false
207
236
  requirements:
208
237
  - - ~>
209
238
  - !ruby/object:Gem::Version
@@ -211,6 +240,7 @@ dependencies:
211
240
  - !ruby/object:Gem::Dependency
212
241
  name: chronic
213
242
  requirement: !ruby/object:Gem::Requirement
243
+ none: false
214
244
  requirements:
215
245
  - - ! '>='
216
246
  - !ruby/object:Gem::Version
@@ -218,6 +248,7 @@ dependencies:
218
248
  type: :runtime
219
249
  prerelease: false
220
250
  version_requirements: !ruby/object:Gem::Requirement
251
+ none: false
221
252
  requirements:
222
253
  - - ! '>='
223
254
  - !ruby/object:Gem::Version
@@ -225,6 +256,7 @@ dependencies:
225
256
  - !ruby/object:Gem::Dependency
226
257
  name: chronic_duration
227
258
  requirement: !ruby/object:Gem::Requirement
259
+ none: false
228
260
  requirements:
229
261
  - - ! '>='
230
262
  - !ruby/object:Gem::Version
@@ -232,6 +264,7 @@ dependencies:
232
264
  type: :runtime
233
265
  prerelease: false
234
266
  version_requirements: !ruby/object:Gem::Requirement
267
+ none: false
235
268
  requirements:
236
269
  - - ! '>='
237
270
  - !ruby/object:Gem::Version
@@ -239,6 +272,7 @@ dependencies:
239
272
  - !ruby/object:Gem::Dependency
240
273
  name: activesupport
241
274
  requirement: !ruby/object:Gem::Requirement
275
+ none: false
242
276
  requirements:
243
277
  - - ~>
244
278
  - !ruby/object:Gem::Version
@@ -246,6 +280,7 @@ dependencies:
246
280
  type: :runtime
247
281
  prerelease: false
248
282
  version_requirements: !ruby/object:Gem::Requirement
283
+ none: false
249
284
  requirements:
250
285
  - - ~>
251
286
  - !ruby/object:Gem::Version
@@ -253,6 +288,7 @@ dependencies:
253
288
  - !ruby/object:Gem::Dependency
254
289
  name: ice_cube
255
290
  requirement: !ruby/object:Gem::Requirement
291
+ none: false
256
292
  requirements:
257
293
  - - ! '>='
258
294
  - !ruby/object:Gem::Version
@@ -260,6 +296,7 @@ dependencies:
260
296
  type: :runtime
261
297
  prerelease: false
262
298
  version_requirements: !ruby/object:Gem::Requirement
299
+ none: false
263
300
  requirements:
264
301
  - - ! '>='
265
302
  - !ruby/object:Gem::Version
@@ -267,6 +304,7 @@ dependencies:
267
304
  - !ruby/object:Gem::Dependency
268
305
  name: tzinfo
269
306
  requirement: !ruby/object:Gem::Requirement
307
+ none: false
270
308
  requirements:
271
309
  - - ~>
272
310
  - !ruby/object:Gem::Version
@@ -274,6 +312,7 @@ dependencies:
274
312
  type: :runtime
275
313
  prerelease: false
276
314
  version_requirements: !ruby/object:Gem::Requirement
315
+ none: false
277
316
  requirements:
278
317
  - - ~>
279
318
  - !ruby/object:Gem::Version
@@ -281,6 +320,7 @@ dependencies:
281
320
  - !ruby/object:Gem::Dependency
282
321
  name: tzinfo-data
283
322
  requirement: !ruby/object:Gem::Requirement
323
+ none: false
284
324
  requirements:
285
325
  - - ! '>='
286
326
  - !ruby/object:Gem::Version
@@ -288,6 +328,7 @@ dependencies:
288
328
  type: :runtime
289
329
  prerelease: false
290
330
  version_requirements: !ruby/object:Gem::Requirement
331
+ none: false
291
332
  requirements:
292
333
  - - ! '>='
293
334
  - !ruby/object:Gem::Version
@@ -295,6 +336,7 @@ dependencies:
295
336
  - !ruby/object:Gem::Dependency
296
337
  name: rake
297
338
  requirement: !ruby/object:Gem::Requirement
339
+ none: false
298
340
  requirements:
299
341
  - - ! '>='
300
342
  - !ruby/object:Gem::Version
@@ -302,6 +344,7 @@ dependencies:
302
344
  type: :development
303
345
  prerelease: false
304
346
  version_requirements: !ruby/object:Gem::Requirement
347
+ none: false
305
348
  requirements:
306
349
  - - ! '>='
307
350
  - !ruby/object:Gem::Version
@@ -350,16 +393,20 @@ files:
350
393
  - dist/puppet/ruby/manifests/rubygems.pp
351
394
  - dist/puppet/sqlite3/manifests/dev.pp
352
395
  - etc/flapjack_config.yaml.example
396
+ - features/cli.feature
353
397
  - features/events.feature
354
398
  - features/events_check_names.feature
355
399
  - features/notification_rules.feature
356
400
  - features/notifications.feature
357
401
  - features/packaging-lintian.feature
402
+ - features/rollup.feature
403
+ - features/steps/cli_steps.rb
358
404
  - features/steps/events_steps.rb
359
405
  - features/steps/flapjack-netsaint-parser_steps.rb
360
406
  - features/steps/notifications_steps.rb
361
407
  - features/steps/packaging-lintian_steps.rb
362
408
  - features/steps/time_travel_steps.rb
409
+ - features/support/daemons.rb
363
410
  - features/support/env.rb
364
411
  - features/support/silent_system.rb
365
412
  - flapjack.gemspec
@@ -393,10 +440,16 @@ files:
393
440
  - lib/flapjack/gateways/email.rb
394
441
  - lib/flapjack/gateways/email/alert.html.erb
395
442
  - lib/flapjack/gateways/email/alert.text.erb
443
+ - lib/flapjack/gateways/email/alert_subject.text.erb
444
+ - lib/flapjack/gateways/email/rollup.html.erb
445
+ - lib/flapjack/gateways/email/rollup.text.erb
446
+ - lib/flapjack/gateways/email/rollup_subject.text.erb
396
447
  - lib/flapjack/gateways/jabber.rb
397
448
  - lib/flapjack/gateways/oobetet.rb
398
449
  - lib/flapjack/gateways/pagerduty.rb
399
450
  - lib/flapjack/gateways/sms_messagenet.rb
451
+ - lib/flapjack/gateways/sms_messagenet/alert.text.erb
452
+ - lib/flapjack/gateways/sms_messagenet/rollup.text.erb
400
453
  - lib/flapjack/gateways/web.rb
401
454
  - lib/flapjack/gateways/web/public/css/bootstrap-responsive.min.css
402
455
  - lib/flapjack/gateways/web/public/css/bootstrap.min.css
@@ -430,6 +483,7 @@ files:
430
483
  - lib/flapjack/redis_pool.rb
431
484
  - lib/flapjack/utility.rb
432
485
  - lib/flapjack/version.rb
486
+ - log/.gitkeep
433
487
  - spec/lib/flapjack/coordinator_spec.rb
434
488
  - spec/lib/flapjack/data/contact_spec.rb
435
489
  - spec/lib/flapjack/data/entity_check_spec.rb
@@ -493,38 +547,49 @@ files:
493
547
  homepage: http://flapjack-project.com/
494
548
  licenses:
495
549
  - MIT
496
- metadata: {}
497
550
  post_install_message:
498
551
  rdoc_options: []
499
552
  require_paths:
500
553
  - lib
501
554
  required_ruby_version: !ruby/object:Gem::Requirement
555
+ none: false
502
556
  requirements:
503
557
  - - ! '>='
504
558
  - !ruby/object:Gem::Version
505
559
  version: '0'
560
+ segments:
561
+ - 0
562
+ hash: -3626435737663175396
506
563
  required_rubygems_version: !ruby/object:Gem::Requirement
564
+ none: false
507
565
  requirements:
508
566
  - - ! '>='
509
567
  - !ruby/object:Gem::Version
510
568
  version: '0'
569
+ segments:
570
+ - 0
571
+ hash: -3626435737663175396
511
572
  requirements: []
512
573
  rubyforge_project:
513
- rubygems_version: 2.1.3
574
+ rubygems_version: 1.8.23
514
575
  signing_key:
515
- specification_version: 4
576
+ specification_version: 3
516
577
  summary: Intelligent, scalable, distributed monitoring notification system.
517
578
  test_files:
579
+ - features/cli.feature
518
580
  - features/events.feature
519
581
  - features/events_check_names.feature
520
582
  - features/notification_rules.feature
521
583
  - features/notifications.feature
522
584
  - features/packaging-lintian.feature
585
+ - features/rollup.feature
586
+ - features/steps/cli_steps.rb
523
587
  - features/steps/events_steps.rb
524
588
  - features/steps/flapjack-netsaint-parser_steps.rb
525
589
  - features/steps/notifications_steps.rb
526
590
  - features/steps/packaging-lintian_steps.rb
527
591
  - features/steps/time_travel_steps.rb
592
+ - features/support/daemons.rb
528
593
  - features/support/env.rb
529
594
  - features/support/silent_system.rb
530
595
  - spec/lib/flapjack/coordinator_spec.rb