flapjack 1.0.0rc3 → 1.0.0rc5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -2
  3. data/.ruby-version +1 -0
  4. data/CHANGELOG.md +20 -0
  5. data/CONTRIBUTING.md +2 -2
  6. data/Gemfile +1 -1
  7. data/README.md +6 -16
  8. data/build.sh +13 -1
  9. data/etc/flapjack_config.yaml.example +98 -12
  10. data/features/cli.feature +8 -8
  11. data/features/cli_flapjack-nagios-receiver.feature +29 -37
  12. data/features/cli_flapper.feature +24 -12
  13. data/features/cli_simulate-failed-check.feature +2 -2
  14. data/features/notifications.feature +18 -1
  15. data/features/steps/cli_steps.rb +2 -2
  16. data/features/steps/notifications_steps.rb +71 -0
  17. data/features/support/env.rb +7 -6
  18. data/flapjack.gemspec +3 -1
  19. data/lib/flapjack/cli/flapper.rb +74 -25
  20. data/lib/flapjack/cli/import.rb +3 -4
  21. data/lib/flapjack/cli/maintenance.rb +182 -0
  22. data/lib/flapjack/cli/receiver.rb +110 -121
  23. data/lib/flapjack/cli/server.rb +30 -26
  24. data/lib/flapjack/cli/simulate.rb +2 -3
  25. data/lib/flapjack/data/contact.rb +1 -1
  26. data/lib/flapjack/data/entity.rb +425 -32
  27. data/lib/flapjack/data/entity_check.rb +212 -14
  28. data/lib/flapjack/data/event.rb +1 -1
  29. data/lib/flapjack/gateways/aws_sns.rb +134 -0
  30. data/lib/flapjack/gateways/aws_sns/alert.text.erb +5 -0
  31. data/lib/flapjack/gateways/aws_sns/rollup.text.erb +2 -0
  32. data/lib/flapjack/gateways/jabber.rb +2 -2
  33. data/lib/flapjack/gateways/jsonapi/check_methods.rb +1 -1
  34. data/lib/flapjack/gateways/jsonapi/contact_methods.rb +1 -1
  35. data/lib/flapjack/gateways/jsonapi/entity_methods.rb +15 -1
  36. data/lib/flapjack/gateways/jsonapi/metrics_methods.rb +4 -3
  37. data/lib/flapjack/gateways/jsonapi/report_methods.rb +1 -1
  38. data/lib/flapjack/gateways/web.rb +35 -16
  39. data/lib/flapjack/gateways/web/public/css/tablesort.css +0 -16
  40. data/lib/flapjack/gateways/web/public/js/backbone.jsonapi.js +1 -1
  41. data/lib/flapjack/gateways/web/public/js/jquery.tablesorter.widgets.js +0 -45
  42. data/lib/flapjack/gateways/web/public/js/modules/contact.js +2 -2
  43. data/lib/flapjack/gateways/web/public/js/modules/entity.js +2 -2
  44. data/lib/flapjack/gateways/web/public/js/modules/medium.js +4 -4
  45. data/lib/flapjack/gateways/web/public/js/self_stats.js +1 -1
  46. data/lib/flapjack/gateways/web/views/check.html.erb +10 -10
  47. data/lib/flapjack/gateways/web/views/checks.html.erb +1 -1
  48. data/lib/flapjack/gateways/web/views/contact.html.erb +5 -1
  49. data/lib/flapjack/gateways/web/views/edit_contacts.html.erb +3 -4
  50. data/lib/flapjack/gateways/web/views/entities.html.erb +1 -1
  51. data/lib/flapjack/gateways/web/views/index.html.erb +2 -2
  52. data/lib/flapjack/gateways/web/views/layout.erb +3 -3
  53. data/lib/flapjack/gateways/web/views/self_stats.html.erb +5 -6
  54. data/lib/flapjack/notifier.rb +4 -1
  55. data/lib/flapjack/patches.rb +8 -2
  56. data/lib/flapjack/pikelet.rb +3 -1
  57. data/lib/flapjack/version.rb +1 -1
  58. data/libexec/httpbroker.go +1 -1
  59. data/spec/lib/flapjack/coordinator_spec.rb +3 -3
  60. data/spec/lib/flapjack/data/contact_spec.rb +2 -2
  61. data/spec/lib/flapjack/data/entity_check_spec.rb +805 -53
  62. data/spec/lib/flapjack/data/entity_spec.rb +661 -0
  63. data/spec/lib/flapjack/gateways/aws_sns_spec.rb +123 -0
  64. data/spec/lib/flapjack/gateways/jabber_spec.rb +1 -1
  65. data/spec/lib/flapjack/gateways/jsonapi/check_methods_spec.rb +1 -1
  66. data/spec/lib/flapjack/gateways/jsonapi/entity_methods_spec.rb +2 -2
  67. data/spec/lib/flapjack/gateways/pagerduty_spec.rb +1 -1
  68. data/spec/lib/flapjack/gateways/web_spec.rb +11 -11
  69. data/spec/support/profile_all_formatter.rb +10 -10
  70. data/spec/support/uncolored_doc_formatter.rb +66 -4
  71. data/src/flapjack/event.go +1 -1
  72. data/tasks/benchmarks.rake +24 -20
  73. data/tasks/entities.rake +148 -0
  74. data/tmp/dummy_contacts.json +43 -0
  75. data/tmp/dummy_entities.json +37 -1
  76. metadata +43 -7
  77. data/tmp/test_entities.json +0 -1
@@ -0,0 +1,43 @@
1
+ [
2
+ {
3
+ "id": "362",
4
+ "first_name": "John",
5
+ "last_name": "Johnson",
6
+ "email": "johnj@example.com",
7
+ "media": {
8
+ "sms": "+61412345678",
9
+ "email": "johnj@example.com"
10
+ },
11
+ "tags": [
12
+ "source:titanium",
13
+ "foo"
14
+ ]
15
+ },
16
+ {
17
+ "id": "363",
18
+ "first_name": "Jane",
19
+ "last_name": "Janeley",
20
+ "email": "janej@example.com",
21
+ "media": {
22
+ "email": "janej@example.com"
23
+ },
24
+ "tags": [
25
+ "source:titanium",
26
+ "bar"
27
+ ]
28
+ },
29
+ {
30
+ "id": "364",
31
+ "first_name": "Roger",
32
+ "last_name": "Wilco",
33
+ "email": "rogerw@example.com",
34
+ "media": {
35
+ "jabber": "roger@conference.example.com"
36
+ },
37
+ "tags": [
38
+ "source:titanium",
39
+ "bar",
40
+ "foo"
41
+ ]
42
+ }
43
+ ]
@@ -1 +1,37 @@
1
- [{"id":"10001","name":"clientx-app-01","contacts":["0362","0363","0364"]},{"id":"10002","name":"clientx-app-02","contacts":["0362"]},{"id":"10003","name":"clienty-app-01","contacts":["0363","0364"]}]
1
+ [
2
+ {
3
+ "id": "10001",
4
+ "name": "clientx-app-01",
5
+ "contacts": [
6
+ "362",
7
+ "363",
8
+ "364"
9
+ ],
10
+ "tags": [
11
+ "source:titanium",
12
+ "foo"
13
+ ]
14
+ },
15
+ {
16
+ "id": "10002",
17
+ "name": "clientx-app-02",
18
+ "contacts": [
19
+ "362"
20
+ ],
21
+ "tags": [
22
+ "source:titanium",
23
+ "bar"
24
+ ]
25
+ },
26
+ {
27
+ "id": "10003",
28
+ "name": "clienty-app-01",
29
+ "contacts": [
30
+ "363",
31
+ "364"
32
+ ],
33
+ "tags": [
34
+ "source:titanium"
35
+ ]
36
+ }
37
+ ]
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: 1.0.0rc3
4
+ version: 1.0.0rc5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lindsay Holmwood
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-07-24 00:00:00.000000000 Z
13
+ date: 2014-08-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: dante
@@ -236,6 +236,20 @@ dependencies:
236
236
  - - ">="
237
237
  - !ruby/object:Gem::Version
238
238
  version: '0'
239
+ - !ruby/object:Gem::Dependency
240
+ name: terminal-table
241
+ requirement: !ruby/object:Gem::Requirement
242
+ requirements:
243
+ - - ">="
244
+ - !ruby/object:Gem::Version
245
+ version: '0'
246
+ type: :runtime
247
+ prerelease: false
248
+ version_requirements: !ruby/object:Gem::Requirement
249
+ requirements:
250
+ - - ">="
251
+ - !ruby/object:Gem::Version
252
+ version: '0'
239
253
  - !ruby/object:Gem::Dependency
240
254
  name: activesupport
241
255
  requirement: !ruby/object:Gem::Requirement
@@ -324,16 +338,30 @@ dependencies:
324
338
  name: gli
325
339
  requirement: !ruby/object:Gem::Requirement
326
340
  requirements:
327
- - - ">="
341
+ - - '='
328
342
  - !ruby/object:Gem::Version
329
- version: '0'
343
+ version: 2.12.0
330
344
  type: :runtime
331
345
  prerelease: false
332
346
  version_requirements: !ruby/object:Gem::Requirement
333
347
  requirements:
334
- - - ">="
348
+ - - '='
335
349
  - !ruby/object:Gem::Version
336
- version: '0'
350
+ version: 2.12.0
351
+ - !ruby/object:Gem::Dependency
352
+ name: nokogiri
353
+ requirement: !ruby/object:Gem::Requirement
354
+ requirements:
355
+ - - '='
356
+ - !ruby/object:Gem::Version
357
+ version: 1.6.2.1
358
+ type: :runtime
359
+ prerelease: false
360
+ version_requirements: !ruby/object:Gem::Requirement
361
+ requirements:
362
+ - - '='
363
+ - !ruby/object:Gem::Version
364
+ version: 1.6.2.1
337
365
  description: Flapjack is a distributed monitoring notification system that provides
338
366
  a scalable method for processing streams of events from Nagios and deciding who
339
367
  should be notified
@@ -346,6 +374,7 @@ files:
346
374
  - ".gitignore"
347
375
  - ".gitmodules"
348
376
  - ".rspec"
377
+ - ".ruby-version"
349
378
  - ".travis.yml"
350
379
  - CHANGELOG.md
351
380
  - CONTRIBUTING.md
@@ -387,6 +416,7 @@ files:
387
416
  - lib/flapjack.rb
388
417
  - lib/flapjack/cli/flapper.rb
389
418
  - lib/flapjack/cli/import.rb
419
+ - lib/flapjack/cli/maintenance.rb
390
420
  - lib/flapjack/cli/receiver.rb
391
421
  - lib/flapjack/cli/server.rb
392
422
  - lib/flapjack/cli/simulate.rb
@@ -409,6 +439,9 @@ files:
409
439
  - lib/flapjack/filters/ok.rb
410
440
  - lib/flapjack/filters/scheduled_maintenance.rb
411
441
  - lib/flapjack/filters/unscheduled_maintenance.rb
442
+ - lib/flapjack/gateways/aws_sns.rb
443
+ - lib/flapjack/gateways/aws_sns/alert.text.erb
444
+ - lib/flapjack/gateways/aws_sns/rollup.text.erb
412
445
  - lib/flapjack/gateways/email.rb
413
446
  - lib/flapjack/gateways/email/alert.html.erb
414
447
  - lib/flapjack/gateways/email/alert.text.erb
@@ -520,6 +553,7 @@ files:
520
553
  - spec/lib/flapjack/filters/ok_spec.rb
521
554
  - spec/lib/flapjack/filters/scheduled_maintenance_spec.rb
522
555
  - spec/lib/flapjack/filters/unscheduled_maintenance_spec.rb
556
+ - spec/lib/flapjack/gateways/aws_sns_spec.rb
523
557
  - spec/lib/flapjack/gateways/email_spec.rb
524
558
  - spec/lib/flapjack/gateways/jabber_spec.rb
525
559
  - spec/lib/flapjack/gateways/jsonapi/check_methods_spec.rb
@@ -554,6 +588,7 @@ files:
554
588
  - src/flapjack/transport.go
555
589
  - src/flapjack/transport_test.go
556
590
  - tasks/benchmarks.rake
591
+ - tasks/entities.rake
557
592
  - tasks/events.rake
558
593
  - tasks/profile.rake
559
594
  - tasks/support/flapjack_config_benchmark.yaml
@@ -566,12 +601,12 @@ files:
566
601
  - tmp/create_events_ok_fail_ack_ok.rb
567
602
  - tmp/create_events_ok_failure.rb
568
603
  - tmp/create_events_ok_failure_ack.rb
604
+ - tmp/dummy_contacts.json
569
605
  - tmp/dummy_entities.json
570
606
  - tmp/generate_nagios_test_hosts.rb
571
607
  - tmp/notification_rules.rb
572
608
  - tmp/parse_config_yaml.rb
573
609
  - tmp/redis_find_spurious_unknown_states.rb
574
- - tmp/test_entities.json
575
610
  - tmp/test_json_post.rb
576
611
  - tmp/test_notification_rules_api.rb
577
612
  homepage: http://flapjack.io/
@@ -636,6 +671,7 @@ test_files:
636
671
  - spec/lib/flapjack/filters/ok_spec.rb
637
672
  - spec/lib/flapjack/filters/scheduled_maintenance_spec.rb
638
673
  - spec/lib/flapjack/filters/unscheduled_maintenance_spec.rb
674
+ - spec/lib/flapjack/gateways/aws_sns_spec.rb
639
675
  - spec/lib/flapjack/gateways/email_spec.rb
640
676
  - spec/lib/flapjack/gateways/jabber_spec.rb
641
677
  - spec/lib/flapjack/gateways/jsonapi/check_methods_spec.rb
@@ -1 +0,0 @@
1
- [{"id":"10001","name":"client1-localhost-test-1","contacts":["0362","0363","0364"]},{"id":"10002","name":"client1-localhost-test-2","contacts":["0362"]},{"id":"10003","name":"client1-localhost-test-3","contacts":["0363","0364"]}]