flapjack 1.6.0 → 2.0.0b1
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.
- checksums.yaml +4 -4
- data/.gitignore +4 -6
- data/.gitmodules +1 -1
- data/.rspec +1 -1
- data/.ruby-version +1 -1
- data/.travis.yml +12 -13
- data/CHANGELOG.md +2 -9
- data/CONTRIBUTING.md +7 -2
- data/Gemfile +4 -13
- data/LICENCE +1 -0
- data/README.md +8 -2
- data/Rakefile +2 -2
- data/bin/flapjack +3 -12
- data/build.sh +4 -2
- data/etc/flapjack_config.toml.example +273 -0
- data/features/ack_after_sched_maint.feature +18 -21
- data/features/cli.feature +11 -71
- data/features/cli_flapjack-feed-events.feature +14 -15
- data/features/cli_flapjack-nagios-receiver.feature +12 -41
- data/features/cli_flapper.feature +12 -41
- data/features/cli_purge.feature +5 -6
- data/features/cli_receive-events.feature +6 -7
- data/features/cli_simulate-failed-check.feature +5 -6
- data/features/events.feature +206 -181
- data/features/events_check_names.feature +4 -7
- data/features/notification_rules.feature +144 -223
- data/features/notifications.feature +65 -57
- data/features/rollup.feature +45 -47
- data/features/steps/cli_steps.rb +4 -5
- data/features/steps/events_steps.rb +163 -373
- data/features/steps/notifications_steps.rb +408 -264
- data/features/steps/packaging-lintian_steps.rb +0 -4
- data/features/steps/time_travel_steps.rb +0 -26
- data/features/support/daemons.rb +6 -31
- data/features/support/env.rb +65 -74
- data/flapjack.gemspec +22 -24
- data/lib/flapjack.rb +14 -7
- data/lib/flapjack/cli/flapper.rb +74 -173
- data/lib/flapjack/cli/maintenance.rb +278 -109
- data/lib/flapjack/cli/migrate.rb +950 -0
- data/lib/flapjack/cli/purge.rb +19 -22
- data/lib/flapjack/cli/receiver.rb +150 -326
- data/lib/flapjack/cli/server.rb +8 -235
- data/lib/flapjack/cli/simulate.rb +42 -57
- data/lib/flapjack/configuration.rb +51 -37
- data/lib/flapjack/coordinator.rb +138 -129
- data/lib/flapjack/data/acknowledgement.rb +177 -0
- data/lib/flapjack/data/alert.rb +97 -158
- data/lib/flapjack/data/check.rb +611 -0
- data/lib/flapjack/data/condition.rb +70 -0
- data/lib/flapjack/data/contact.rb +226 -456
- data/lib/flapjack/data/event.rb +96 -184
- data/lib/flapjack/data/extensions/associations.rb +59 -0
- data/lib/flapjack/data/extensions/short_name.rb +25 -0
- data/lib/flapjack/data/medium.rb +428 -0
- data/lib/flapjack/data/metrics.rb +194 -0
- data/lib/flapjack/data/notification.rb +22 -281
- data/lib/flapjack/data/rule.rb +473 -0
- data/lib/flapjack/data/scheduled_maintenance.rb +244 -0
- data/lib/flapjack/data/state.rb +221 -0
- data/lib/flapjack/data/statistic.rb +112 -0
- data/lib/flapjack/data/tag.rb +277 -0
- data/lib/flapjack/data/test_notification.rb +182 -0
- data/lib/flapjack/data/unscheduled_maintenance.rb +159 -0
- data/lib/flapjack/data/validators/id_validator.rb +20 -0
- data/lib/flapjack/exceptions.rb +6 -0
- data/lib/flapjack/filters/acknowledgement.rb +23 -16
- data/lib/flapjack/filters/base.rb +0 -5
- data/lib/flapjack/filters/delays.rb +53 -43
- data/lib/flapjack/filters/ok.rb +23 -14
- data/lib/flapjack/filters/scheduled_maintenance.rb +3 -3
- data/lib/flapjack/filters/unscheduled_maintenance.rb +12 -3
- data/lib/flapjack/gateways/aws_sns.rb +65 -49
- data/lib/flapjack/gateways/aws_sns/alert.text.erb +2 -2
- data/lib/flapjack/gateways/aws_sns/alert_subject.text.erb +2 -2
- data/lib/flapjack/gateways/aws_sns/rollup_subject.text.erb +1 -1
- data/lib/flapjack/gateways/email.rb +107 -90
- data/lib/flapjack/gateways/email/alert.html.erb +19 -18
- data/lib/flapjack/gateways/email/alert.text.erb +20 -14
- data/lib/flapjack/gateways/email/alert_subject.text.erb +2 -1
- data/lib/flapjack/gateways/email/rollup.html.erb +14 -13
- data/lib/flapjack/gateways/email/rollup.text.erb +13 -10
- data/lib/flapjack/gateways/jabber.rb +679 -671
- data/lib/flapjack/gateways/jabber/alert.text.erb +9 -6
- data/lib/flapjack/gateways/jsonapi.rb +164 -350
- data/lib/flapjack/gateways/jsonapi/data/join_descriptor.rb +44 -0
- data/lib/flapjack/gateways/jsonapi/data/method_descriptor.rb +21 -0
- data/lib/flapjack/gateways/jsonapi/helpers/headers.rb +63 -0
- data/lib/flapjack/gateways/jsonapi/helpers/miscellaneous.rb +136 -0
- data/lib/flapjack/gateways/jsonapi/helpers/resources.rb +227 -0
- data/lib/flapjack/gateways/jsonapi/helpers/serialiser.rb +313 -0
- data/lib/flapjack/gateways/jsonapi/helpers/swagger_docs.rb +322 -0
- data/lib/flapjack/gateways/jsonapi/methods/association_delete.rb +115 -0
- data/lib/flapjack/gateways/jsonapi/methods/association_get.rb +288 -0
- data/lib/flapjack/gateways/jsonapi/methods/association_patch.rb +178 -0
- data/lib/flapjack/gateways/jsonapi/methods/association_post.rb +116 -0
- data/lib/flapjack/gateways/jsonapi/methods/metrics.rb +71 -0
- data/lib/flapjack/gateways/jsonapi/methods/resource_delete.rb +119 -0
- data/lib/flapjack/gateways/jsonapi/methods/resource_get.rb +186 -0
- data/lib/flapjack/gateways/jsonapi/methods/resource_patch.rb +239 -0
- data/lib/flapjack/gateways/jsonapi/methods/resource_post.rb +197 -0
- data/lib/flapjack/gateways/jsonapi/middleware/array_param_fixer.rb +27 -0
- data/lib/flapjack/gateways/jsonapi/{rack → middleware}/json_params_parser.rb +7 -6
- data/lib/flapjack/gateways/jsonapi/middleware/request_timestamp.rb +18 -0
- data/lib/flapjack/gateways/oobetet.rb +222 -170
- data/lib/flapjack/gateways/pager_duty.rb +388 -0
- data/lib/flapjack/gateways/pager_duty/alert.text.erb +13 -0
- data/lib/flapjack/gateways/slack.rb +56 -48
- data/lib/flapjack/gateways/slack/alert.text.erb +1 -1
- data/lib/flapjack/gateways/slack/rollup.text.erb +1 -1
- data/lib/flapjack/gateways/sms_aspsms.rb +155 -0
- data/lib/flapjack/gateways/sms_aspsms/alert.text.erb +7 -0
- data/lib/flapjack/gateways/sms_aspsms/rollup.text.erb +2 -0
- data/lib/flapjack/gateways/sms_messagenet.rb +77 -57
- data/lib/flapjack/gateways/sms_messagenet/alert.text.erb +3 -2
- data/lib/flapjack/gateways/sms_nexmo.rb +53 -51
- data/lib/flapjack/gateways/sms_nexmo/alert.text.erb +2 -2
- data/lib/flapjack/gateways/sms_nexmo/rollup.text.erb +1 -1
- data/lib/flapjack/gateways/sms_twilio.rb +79 -62
- data/lib/flapjack/gateways/sms_twilio/alert.text.erb +3 -2
- data/lib/flapjack/gateways/web.rb +437 -345
- data/lib/flapjack/gateways/web/middleware/request_timestamp.rb +18 -0
- data/lib/flapjack/gateways/web/public/css/bootstrap.css +3793 -4340
- data/lib/flapjack/gateways/web/public/css/bootstrap.css.map +1 -0
- data/lib/flapjack/gateways/web/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/lib/flapjack/gateways/web/public/fonts/glyphicons-halflings-regular.svg +273 -214
- data/lib/flapjack/gateways/web/public/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/lib/flapjack/gateways/web/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/lib/flapjack/gateways/web/public/fonts/glyphicons-halflings-regular.woff2 +0 -0
- data/lib/flapjack/gateways/web/public/js/bootstrap.js +1637 -1607
- data/lib/flapjack/gateways/web/public/js/self_stats.js +1 -2
- data/lib/flapjack/gateways/web/views/_pagination.html.erb +19 -0
- data/lib/flapjack/gateways/web/views/check.html.erb +159 -121
- data/lib/flapjack/gateways/web/views/checks.html.erb +82 -41
- data/lib/flapjack/gateways/web/views/contact.html.erb +59 -71
- data/lib/flapjack/gateways/web/views/contacts.html.erb +32 -8
- data/lib/flapjack/gateways/web/views/index.html.erb +2 -2
- data/lib/flapjack/gateways/web/views/{layout.erb → layout.html.erb} +7 -23
- data/lib/flapjack/gateways/web/views/self_stats.html.erb +32 -33
- data/lib/flapjack/gateways/web/views/tag.html.erb +32 -0
- data/lib/flapjack/gateways/web/views/tags.html.erb +51 -0
- data/lib/flapjack/logger.rb +34 -3
- data/lib/flapjack/notifier.rb +180 -112
- data/lib/flapjack/patches.rb +8 -63
- data/lib/flapjack/pikelet.rb +185 -143
- data/lib/flapjack/processor.rb +323 -191
- data/lib/flapjack/record_queue.rb +33 -0
- data/lib/flapjack/redis_proxy.rb +66 -0
- data/lib/flapjack/utility.rb +21 -15
- data/lib/flapjack/version.rb +2 -1
- data/libexec/httpbroker.go +218 -14
- data/libexec/oneoff.go +13 -10
- data/spec/lib/flapjack/configuration_spec.rb +286 -0
- data/spec/lib/flapjack/coordinator_spec.rb +103 -157
- data/spec/lib/flapjack/data/check_spec.rb +175 -0
- data/spec/lib/flapjack/data/contact_spec.rb +26 -349
- data/spec/lib/flapjack/data/event_spec.rb +76 -291
- data/spec/lib/flapjack/data/medium_spec.rb +19 -0
- data/spec/lib/flapjack/data/rule_spec.rb +43 -0
- data/spec/lib/flapjack/data/scheduled_maintenance_spec.rb +976 -0
- data/spec/lib/flapjack/data/unscheduled_maintenance_spec.rb +34 -0
- data/spec/lib/flapjack/gateways/aws_sns_spec.rb +111 -60
- data/spec/lib/flapjack/gateways/email_spec.rb +194 -161
- data/spec/lib/flapjack/gateways/jabber_spec.rb +961 -162
- data/spec/lib/flapjack/gateways/jsonapi/methods/check_links_spec.rb +155 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/checks_spec.rb +426 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/contact_links_spec.rb +217 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/contacts_spec.rb +425 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/events_spec.rb +271 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/media_spec.rb +257 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/medium_links_spec.rb +163 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/metrics_spec.rb +8 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/rule_links_spec.rb +212 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/rules_spec.rb +289 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/scheduled_maintenance_links_spec.rb +49 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/scheduled_maintenances_spec.rb +242 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/tag_links_spec.rb +274 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/tags_spec.rb +302 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/unscheduled_maintenance_links_spec.rb +49 -0
- data/spec/lib/flapjack/gateways/jsonapi/methods/unscheduled_maintenances_spec.rb +339 -0
- data/spec/lib/flapjack/gateways/jsonapi_spec.rb +1 -1
- data/spec/lib/flapjack/gateways/oobetet_spec.rb +151 -79
- data/spec/lib/flapjack/gateways/pager_duty_spec.rb +353 -0
- data/spec/lib/flapjack/gateways/slack_spec.rb +53 -53
- data/spec/lib/flapjack/gateways/sms_aspsms_spec.rb +106 -0
- data/spec/lib/flapjack/gateways/sms_messagenet_spec.rb +111 -54
- data/spec/lib/flapjack/gateways/sms_nexmo_spec.rb +50 -51
- data/spec/lib/flapjack/gateways/sms_twilio_spec.rb +108 -48
- data/spec/lib/flapjack/gateways/web_spec.rb +144 -216
- data/spec/lib/flapjack/notifier_spec.rb +132 -1
- data/spec/lib/flapjack/pikelet_spec.rb +111 -50
- data/spec/lib/flapjack/processor_spec.rb +210 -40
- data/spec/lib/flapjack/redis_proxy_spec.rb +45 -0
- data/spec/lib/flapjack/utility_spec.rb +11 -15
- data/spec/service_consumers/fixture_data.rb +547 -0
- data/spec/service_consumers/pact_helper.rb +21 -32
- data/spec/service_consumers/pacts/flapjack-diner_v2.0.json +4652 -0
- data/spec/service_consumers/provider_states_for_flapjack-diner.rb +279 -322
- data/spec/service_consumers/provider_support.rb +8 -0
- data/spec/spec_helper.rb +34 -44
- data/spec/support/erb_view_helper.rb +1 -1
- data/spec/support/factories.rb +58 -0
- data/spec/support/jsonapi_helper.rb +15 -26
- data/spec/support/mock_logger.rb +43 -0
- data/spec/support/xmpp_comparable.rb +24 -0
- data/src/flapjack/transport_test.go +30 -1
- data/tasks/dump_keys.rake +82 -0
- data/tasks/events.rake +7 -7
- data/tasks/support/flapjack_config_benchmark.toml +28 -0
- data/tasks/support/flapjack_config_benchmark.yaml +0 -2
- metadata +175 -222
- data/Guardfile +0 -14
- data/etc/flapjack_config.yaml.example +0 -477
- data/features/cli_flapjack-populator.feature +0 -90
- data/features/support/silent_system.rb +0 -4
- data/lib/flapjack/cli/import.rb +0 -108
- data/lib/flapjack/data/entity.rb +0 -652
- data/lib/flapjack/data/entity_check.rb +0 -1044
- data/lib/flapjack/data/message.rb +0 -56
- data/lib/flapjack/data/migration.rb +0 -234
- data/lib/flapjack/data/notification_rule.rb +0 -425
- data/lib/flapjack/data/semaphore.rb +0 -44
- data/lib/flapjack/data/tagged.rb +0 -48
- data/lib/flapjack/gateways/jsonapi/check_methods.rb +0 -206
- data/lib/flapjack/gateways/jsonapi/check_presenter.rb +0 -221
- data/lib/flapjack/gateways/jsonapi/contact_methods.rb +0 -186
- data/lib/flapjack/gateways/jsonapi/entity_methods.rb +0 -223
- data/lib/flapjack/gateways/jsonapi/medium_methods.rb +0 -185
- data/lib/flapjack/gateways/jsonapi/metrics_methods.rb +0 -132
- data/lib/flapjack/gateways/jsonapi/notification_rule_methods.rb +0 -141
- data/lib/flapjack/gateways/jsonapi/pagerduty_credential_methods.rb +0 -139
- data/lib/flapjack/gateways/jsonapi/report_methods.rb +0 -146
- data/lib/flapjack/gateways/pagerduty.rb +0 -318
- data/lib/flapjack/gateways/pagerduty/alert.text.erb +0 -10
- data/lib/flapjack/gateways/web/public/css/select2-bootstrap.css +0 -87
- data/lib/flapjack/gateways/web/public/css/select2.css +0 -615
- data/lib/flapjack/gateways/web/public/css/tablesort.css +0 -67
- data/lib/flapjack/gateways/web/public/img/select2-spinner.gif +0 -0
- data/lib/flapjack/gateways/web/public/img/select2.png +0 -0
- data/lib/flapjack/gateways/web/public/img/select2x2.png +0 -0
- data/lib/flapjack/gateways/web/public/js/backbone.js +0 -1581
- data/lib/flapjack/gateways/web/public/js/backbone.jsonapi.js +0 -322
- data/lib/flapjack/gateways/web/public/js/flapjack.js +0 -82
- data/lib/flapjack/gateways/web/public/js/jquery.tablesorter.js +0 -1640
- data/lib/flapjack/gateways/web/public/js/jquery.tablesorter.widgets.js +0 -1390
- data/lib/flapjack/gateways/web/public/js/modules/contact.js +0 -520
- data/lib/flapjack/gateways/web/public/js/modules/entity.js +0 -28
- data/lib/flapjack/gateways/web/public/js/modules/medium.js +0 -40
- data/lib/flapjack/gateways/web/public/js/select2.js +0 -3397
- data/lib/flapjack/gateways/web/public/js/tablesort.js +0 -44
- data/lib/flapjack/gateways/web/public/js/underscore.js +0 -1276
- data/lib/flapjack/gateways/web/views/edit_contacts.html.erb +0 -173
- data/lib/flapjack/gateways/web/views/entities.html.erb +0 -30
- data/lib/flapjack/gateways/web/views/entity.html.erb +0 -51
- data/lib/flapjack/rack_logger.rb +0 -47
- data/lib/flapjack/redis_pool.rb +0 -42
- data/spec/lib/flapjack/data/entity_check_spec.rb +0 -1418
- data/spec/lib/flapjack/data/entity_spec.rb +0 -872
- data/spec/lib/flapjack/data/message_spec.rb +0 -30
- data/spec/lib/flapjack/data/migration_spec.rb +0 -104
- data/spec/lib/flapjack/data/notification_rule_spec.rb +0 -232
- data/spec/lib/flapjack/data/notification_spec.rb +0 -53
- data/spec/lib/flapjack/data/semaphore_spec.rb +0 -24
- data/spec/lib/flapjack/filters/acknowledgement_spec.rb +0 -6
- data/spec/lib/flapjack/filters/delays_spec.rb +0 -6
- data/spec/lib/flapjack/filters/ok_spec.rb +0 -6
- data/spec/lib/flapjack/filters/scheduled_maintenance_spec.rb +0 -6
- data/spec/lib/flapjack/filters/unscheduled_maintenance_spec.rb +0 -6
- data/spec/lib/flapjack/gateways/jsonapi/check_methods_spec.rb +0 -315
- data/spec/lib/flapjack/gateways/jsonapi/check_presenter_spec.rb +0 -223
- data/spec/lib/flapjack/gateways/jsonapi/contact_methods_spec.rb +0 -131
- data/spec/lib/flapjack/gateways/jsonapi/entity_methods_spec.rb +0 -389
- data/spec/lib/flapjack/gateways/jsonapi/medium_methods_spec.rb +0 -231
- data/spec/lib/flapjack/gateways/jsonapi/notification_rule_methods_spec.rb +0 -169
- data/spec/lib/flapjack/gateways/jsonapi/pagerduty_credential_methods_spec.rb +0 -114
- data/spec/lib/flapjack/gateways/jsonapi/report_methods_spec.rb +0 -590
- data/spec/lib/flapjack/gateways/pagerduty_spec.rb +0 -249
- data/spec/lib/flapjack/gateways/web/views/check.html.erb_spec.rb +0 -21
- data/spec/lib/flapjack/gateways/web/views/contact.html.erb_spec.rb +0 -24
- data/spec/lib/flapjack/gateways/web/views/index.html.erb_spec.rb +0 -16
- data/spec/lib/flapjack/redis_pool_spec.rb +0 -29
- data/spec/service_consumers/pacts/flapjack-diner_v1.0.json +0 -4702
- data/tasks/entities.rake +0 -151
- data/tasks/profile.rake +0 -282
- data/tmp/acknowledge.rb +0 -13
- data/tmp/create_config_yaml.rb +0 -16
- data/tmp/create_event_ok.rb +0 -30
- data/tmp/create_event_unknown.rb +0 -30
- data/tmp/create_events_failure.rb +0 -34
- data/tmp/create_events_ok.rb +0 -32
- data/tmp/create_events_ok_fail_ack_ok.rb +0 -53
- data/tmp/create_events_ok_failure.rb +0 -41
- data/tmp/create_events_ok_failure_ack.rb +0 -53
- data/tmp/dummy_contacts.json +0 -43
- data/tmp/dummy_entities.json +0 -37
- data/tmp/generate_nagios_test_hosts.rb +0 -16
- data/tmp/notification_rules.rb +0 -73
- data/tmp/parse_config_yaml.rb +0 -7
- data/tmp/redis_find_spurious_unknown_states.rb +0 -52
- data/tmp/test_json_post.rb +0 -19
- data/tmp/test_notification_rules_api.rb +0 -171
data/features/events.feature
CHANGED
|
@@ -4,23 +4,22 @@ Feature: events
|
|
|
4
4
|
flapjack-executive must process events correctly
|
|
5
5
|
|
|
6
6
|
Background:
|
|
7
|
-
Given
|
|
8
|
-
And the check is check 'HTTP Port 80' on entity 'foo-app-01.example.com'
|
|
7
|
+
Given the check is check 'HTTP Port 80' on entity 'foo-app-01.example.com'
|
|
9
8
|
|
|
10
9
|
Scenario: Check ok to ok
|
|
11
10
|
Given the check is in an ok state
|
|
12
11
|
When an ok event is received
|
|
13
|
-
Then
|
|
12
|
+
Then no notifications should have been generated
|
|
14
13
|
|
|
15
14
|
Scenario: Check ok to warning
|
|
16
15
|
Given the check is in an ok state
|
|
17
16
|
When a warning event is received
|
|
18
|
-
Then
|
|
17
|
+
Then no notifications should have been generated
|
|
19
18
|
|
|
20
19
|
Scenario: Check ok to critical
|
|
21
20
|
Given the check is in an ok state
|
|
22
21
|
When a critical event is received
|
|
23
|
-
Then
|
|
22
|
+
Then no notifications should have been generated
|
|
24
23
|
|
|
25
24
|
@time
|
|
26
25
|
Scenario: Check critical to critical after 10 seconds
|
|
@@ -28,7 +27,15 @@ Feature: events
|
|
|
28
27
|
When a critical event is received
|
|
29
28
|
And 10 seconds passes
|
|
30
29
|
And a critical event is received
|
|
31
|
-
Then
|
|
30
|
+
Then no notifications should have been generated
|
|
31
|
+
|
|
32
|
+
@time
|
|
33
|
+
Scenario: Check critical to critical after 10 seconds, with an initial delay of 5 seconds
|
|
34
|
+
Given the check is in an ok state
|
|
35
|
+
When a critical event with an initial failure delay of 5 seconds is received
|
|
36
|
+
And 10 seconds passes
|
|
37
|
+
And a critical event with an initial failure delay of 5 seconds is received
|
|
38
|
+
Then 1 notification should have been generated
|
|
32
39
|
|
|
33
40
|
@time
|
|
34
41
|
Scenario: Check ok to warning for 1 minute
|
|
@@ -36,7 +43,7 @@ Feature: events
|
|
|
36
43
|
When a warning event is received
|
|
37
44
|
And 1 minute passes
|
|
38
45
|
And a warning event is received
|
|
39
|
-
Then
|
|
46
|
+
Then 1 notification should have been generated
|
|
40
47
|
|
|
41
48
|
@time
|
|
42
49
|
Scenario: Check ok to critical for 1 minute
|
|
@@ -44,20 +51,29 @@ Feature: events
|
|
|
44
51
|
When a critical event is received
|
|
45
52
|
And 1 minute passes
|
|
46
53
|
And a critical event is received
|
|
47
|
-
Then
|
|
54
|
+
Then 1 notification should have been generated
|
|
48
55
|
|
|
49
56
|
@time
|
|
50
|
-
Scenario: Check ok to
|
|
57
|
+
Scenario: Check ok to critical for 1 minute, with an initial delay of 2 minutes
|
|
58
|
+
And the check is in an ok state
|
|
59
|
+
When a critical event with an initial failure delay of 120 seconds is received
|
|
60
|
+
And 1 minute passes
|
|
61
|
+
And a critical event with an initial failure delay of 120 seconds is received
|
|
62
|
+
Then no notifications should have been generated
|
|
63
|
+
|
|
64
|
+
@time
|
|
65
|
+
Scenario: Check ok to warning, 45 seconds, then critical
|
|
51
66
|
Given the check is in an ok state
|
|
52
67
|
When a warning event is received
|
|
53
68
|
And 1 minute passes
|
|
54
69
|
And a warning event is received
|
|
55
|
-
Then
|
|
70
|
+
Then 1 notification should have been generated
|
|
71
|
+
And 45 seconds passes
|
|
56
72
|
When a critical event is received
|
|
57
|
-
Then
|
|
73
|
+
Then 1 notification should have been generated
|
|
58
74
|
When 1 minute passes
|
|
59
75
|
And a critical event is received
|
|
60
|
-
Then
|
|
76
|
+
Then 2 notifications should have been generated
|
|
61
77
|
|
|
62
78
|
@time
|
|
63
79
|
Scenario: Check critical and alerted to critical for 40 seconds
|
|
@@ -65,10 +81,21 @@ Feature: events
|
|
|
65
81
|
When a critical event is received
|
|
66
82
|
And 1 minute passes
|
|
67
83
|
And a critical event is received
|
|
68
|
-
Then
|
|
84
|
+
Then 1 notification should have been generated
|
|
69
85
|
When 40 seconds passes
|
|
70
86
|
And a critical event is received
|
|
71
|
-
Then
|
|
87
|
+
Then 1 notification should have been generated
|
|
88
|
+
|
|
89
|
+
@time
|
|
90
|
+
Scenario: Check critical and alerted to critical for 40 seconds, with a repeat delay of 20 seconds
|
|
91
|
+
Given the check is in an ok state
|
|
92
|
+
When a critical event with a repeat failure delay of 20 seconds is received
|
|
93
|
+
And 1 minute passes
|
|
94
|
+
And a critical event with a repeat failure delay of 20 seconds is received
|
|
95
|
+
Then 1 notification should have been generated
|
|
96
|
+
When 40 seconds passes
|
|
97
|
+
And a critical event with a repeat failure delay of 20 seconds is received
|
|
98
|
+
Then 2 notifications should have been generated
|
|
72
99
|
|
|
73
100
|
@time
|
|
74
101
|
Scenario: Check critical and alerted to critical for 6 minutes
|
|
@@ -76,10 +103,21 @@ Feature: events
|
|
|
76
103
|
When a critical event is received
|
|
77
104
|
And 1 minute passes
|
|
78
105
|
And a critical event is received
|
|
79
|
-
Then
|
|
106
|
+
Then 1 notification should have been generated
|
|
80
107
|
When 6 minutes passes
|
|
81
108
|
And a critical event is received
|
|
82
|
-
Then
|
|
109
|
+
Then 2 notifications should have been generated
|
|
110
|
+
|
|
111
|
+
@time
|
|
112
|
+
Scenario: Check critical and alerted to critical for 6 minutes, with a repeat delay of 10 minutes
|
|
113
|
+
Given the check is in an ok state
|
|
114
|
+
When a critical event with a repeat failure delay of 600 seconds is received
|
|
115
|
+
And 1 minute passes
|
|
116
|
+
And a critical event with a repeat failure delay of 600 seconds is received
|
|
117
|
+
Then 1 notification should have been generated
|
|
118
|
+
When 6 minutes passes
|
|
119
|
+
And a critical event with a repeat failure delay of 600 seconds is received
|
|
120
|
+
Then 1 notification should have been generated
|
|
83
121
|
|
|
84
122
|
@time
|
|
85
123
|
Scenario: Check ok to critical for 1 minute when in scheduled maintenance
|
|
@@ -88,7 +126,7 @@ Feature: events
|
|
|
88
126
|
When a critical event is received
|
|
89
127
|
And 1 minute passes
|
|
90
128
|
And a critical event is received
|
|
91
|
-
Then
|
|
129
|
+
Then no notifications should have been generated
|
|
92
130
|
|
|
93
131
|
@time
|
|
94
132
|
Scenario: Alert when coming out of scheduled maintenance
|
|
@@ -97,13 +135,13 @@ Feature: events
|
|
|
97
135
|
When a critical event is received
|
|
98
136
|
And 1 minute passes
|
|
99
137
|
And a critical event is received
|
|
100
|
-
Then
|
|
138
|
+
Then no notifications should have been generated
|
|
101
139
|
And 2 hours passes
|
|
102
140
|
And a critical event is received
|
|
103
|
-
Then
|
|
141
|
+
Then no notifications should have been generated
|
|
104
142
|
When 1 hours passes
|
|
105
143
|
And a critical event is received
|
|
106
|
-
Then
|
|
144
|
+
Then 1 notification should have been generated
|
|
107
145
|
|
|
108
146
|
@time
|
|
109
147
|
Scenario: Check ok to critical for 1 minute when in unscheduled maintenance
|
|
@@ -112,7 +150,7 @@ Feature: events
|
|
|
112
150
|
When a critical event is received
|
|
113
151
|
And 1 minute passes
|
|
114
152
|
And a critical event is received
|
|
115
|
-
Then
|
|
153
|
+
Then no notifications should have been generated
|
|
116
154
|
|
|
117
155
|
@time
|
|
118
156
|
Scenario: Check ok to critical for 1 minute, acknowledged, and critical for 6 minutes
|
|
@@ -120,21 +158,22 @@ Feature: events
|
|
|
120
158
|
When a critical event is received
|
|
121
159
|
And 1 minute passes
|
|
122
160
|
And a critical event is received
|
|
123
|
-
Then
|
|
161
|
+
Then 1 notification should have been generated
|
|
124
162
|
When an acknowledgement event is received
|
|
163
|
+
Then 2 notifications should have been generated
|
|
125
164
|
And 6 minute passes
|
|
126
165
|
And a critical event is received
|
|
127
|
-
Then
|
|
166
|
+
Then 2 notifications should have been generated
|
|
128
167
|
|
|
129
168
|
@time
|
|
130
169
|
Scenario: Check critical to ok
|
|
131
170
|
Given the check is in a critical state
|
|
132
171
|
When 5 minutes passes
|
|
133
172
|
And a critical event is received
|
|
134
|
-
Then
|
|
173
|
+
Then 1 notification should have been generated
|
|
135
174
|
When 5 minutes passes
|
|
136
175
|
And an ok event is received
|
|
137
|
-
Then
|
|
176
|
+
Then 2 notifications should have been generated
|
|
138
177
|
|
|
139
178
|
@time
|
|
140
179
|
Scenario: Check critical to ok when acknowledged
|
|
@@ -142,76 +181,69 @@ Feature: events
|
|
|
142
181
|
When a critical event is received
|
|
143
182
|
And one minute passes
|
|
144
183
|
And a critical event is received
|
|
145
|
-
Then
|
|
146
|
-
|
|
184
|
+
Then 1 notification should have been generated
|
|
185
|
+
And one minute passes
|
|
147
186
|
When an acknowledgement event is received
|
|
148
|
-
Then
|
|
187
|
+
Then 2 notifications should have been generated
|
|
149
188
|
When 1 minute passes
|
|
150
189
|
And an ok event is received
|
|
151
|
-
Then
|
|
190
|
+
Then 3 notifications should have been generated
|
|
152
191
|
|
|
153
192
|
@time
|
|
154
193
|
Scenario: Check critical to ok when acknowledged, and fails after 6 minutes
|
|
155
194
|
Given the check is in a critical state
|
|
156
195
|
When an acknowledgement event is received
|
|
157
|
-
Then
|
|
196
|
+
Then 1 notification should have been generated
|
|
158
197
|
When 1 minute passes
|
|
159
198
|
And an ok event is received
|
|
160
|
-
Then
|
|
199
|
+
Then 2 notifications should have been generated
|
|
161
200
|
When 6 minutes passes
|
|
162
201
|
And a critical event is received
|
|
163
|
-
Then
|
|
202
|
+
Then 3 notifications should have been generated
|
|
164
203
|
When 6 minutes passes
|
|
165
204
|
And a critical event is received
|
|
166
|
-
Then
|
|
205
|
+
Then 4 notifications should have been generated
|
|
167
206
|
|
|
168
207
|
@time
|
|
169
|
-
Scenario:
|
|
208
|
+
Scenario: Oscillating state, period of two minutes
|
|
170
209
|
Given the check is in an ok state
|
|
171
210
|
When a critical event is received
|
|
172
|
-
Then
|
|
211
|
+
Then no notifications should have been generated
|
|
173
212
|
When 50 seconds passes
|
|
174
213
|
And a critical event is received
|
|
175
|
-
Then
|
|
214
|
+
Then 1 notification should have been generated
|
|
176
215
|
When 10 seconds passes
|
|
177
216
|
And an ok event is received
|
|
178
|
-
Then
|
|
217
|
+
Then 2 notifications should have been generated
|
|
179
218
|
When 50 seconds passes
|
|
180
219
|
And an ok event is received
|
|
181
|
-
Then
|
|
220
|
+
Then 2 notifications should have been generated
|
|
182
221
|
When 10 seconds passes
|
|
183
222
|
And a critical event is received
|
|
184
|
-
Then
|
|
223
|
+
Then 3 notifications should have been generated
|
|
185
224
|
When 50 seconds passes
|
|
186
225
|
And a critical event is received
|
|
187
|
-
Then
|
|
226
|
+
Then 3 notifications should have been generated
|
|
188
227
|
When 10 seconds passes
|
|
189
228
|
And an ok event is received
|
|
190
|
-
Then
|
|
229
|
+
Then 4 notifications should have been generated
|
|
191
230
|
|
|
192
231
|
Scenario: Acknowledgement when ok
|
|
193
232
|
Given the check is in an ok state
|
|
194
233
|
When an acknowledgement event is received
|
|
195
|
-
Then
|
|
234
|
+
Then no notifications should have been generated
|
|
196
235
|
|
|
197
236
|
Scenario: Acknowledgement when critical
|
|
198
237
|
Given the check is in a critical state
|
|
199
238
|
When an acknowledgement event is received
|
|
200
|
-
Then
|
|
201
|
-
|
|
202
|
-
Scenario: Acknowledgement when acknowledged
|
|
203
|
-
Given the check is in a critical state
|
|
204
|
-
When an acknowledgement event is received
|
|
205
|
-
Then a notification should be generated
|
|
206
|
-
When an acknowledgement event is received
|
|
207
|
-
Then a notification should be generated
|
|
239
|
+
Then 1 notification should have been generated
|
|
208
240
|
|
|
209
241
|
Scenario: Brief critical then OK
|
|
210
242
|
Given the check is in an ok state
|
|
211
243
|
When a critical event is received
|
|
212
244
|
And 10 seconds passes
|
|
213
245
|
And an ok event is received
|
|
214
|
-
Then
|
|
246
|
+
Then no notifications should have been generated
|
|
215
247
|
|
|
216
248
|
@time
|
|
217
249
|
Scenario: Quick stream of unknown
|
|
@@ -219,204 +251,197 @@ Feature: events
|
|
|
219
251
|
When a critical event is received
|
|
220
252
|
And 1 minute passes
|
|
221
253
|
And a critical event is received
|
|
222
|
-
Then
|
|
254
|
+
Then 1 notification should have been generated
|
|
223
255
|
When 10 minutes passes
|
|
224
256
|
And an unknown event is received
|
|
225
|
-
Then
|
|
257
|
+
Then 2 notifications should have been generated
|
|
226
258
|
When 60 seconds passes
|
|
227
259
|
And an unknown event is received
|
|
228
|
-
Then
|
|
260
|
+
Then 3 notifications should have been generated
|
|
229
261
|
When 10 seconds passes
|
|
230
262
|
And an unknown event is received
|
|
231
|
-
Then
|
|
263
|
+
Then 3 notifications should have been generated
|
|
232
264
|
When 10 seconds passes
|
|
233
265
|
And an unknown event is received
|
|
234
|
-
Then
|
|
266
|
+
Then 3 notifications should have been generated
|
|
235
267
|
When 10 seconds passes
|
|
236
268
|
And an unknown event is received
|
|
237
|
-
Then
|
|
269
|
+
Then 3 notifications should have been generated
|
|
238
270
|
When 10 seconds passes
|
|
239
271
|
And an unknown event is received
|
|
240
|
-
Then
|
|
272
|
+
Then 3 notifications should have been generated
|
|
241
273
|
When 10 seconds passes
|
|
242
274
|
And an unknown event is received
|
|
243
|
-
Then
|
|
275
|
+
Then 3 notifications should have been generated
|
|
244
276
|
When 1 minutes passes
|
|
245
277
|
And an unknown event is received
|
|
246
|
-
Then
|
|
278
|
+
Then 4 notifications should have been generated
|
|
247
279
|
When 10 seconds passes
|
|
248
280
|
And an unknown event is received
|
|
249
|
-
Then
|
|
281
|
+
Then 4 notifications should have been generated
|
|
250
282
|
When 10 seconds passes
|
|
251
283
|
And an unknown event is received
|
|
252
|
-
Then
|
|
284
|
+
Then 4 notifications should have been generated
|
|
253
285
|
When 10 seconds passes
|
|
254
286
|
And an unknown event is received
|
|
255
|
-
Then
|
|
287
|
+
Then 4 notifications should have been generated
|
|
256
288
|
|
|
257
289
|
@time
|
|
258
290
|
Scenario: Flapper (down for one minute, up for one minute, repeat)
|
|
259
291
|
Given the check is in an ok state
|
|
260
292
|
When a critical event is received
|
|
261
|
-
Then
|
|
293
|
+
Then no notifications should have been generated
|
|
262
294
|
When 10 seconds passes
|
|
263
295
|
And a critical event is received
|
|
264
|
-
Then
|
|
296
|
+
Then no notifications should have been generated
|
|
265
297
|
When 10 seconds passes
|
|
266
298
|
And a critical event is received
|
|
267
|
-
Then
|
|
299
|
+
Then no notifications should have been generated
|
|
268
300
|
When 10 seconds passes
|
|
269
301
|
# 30 seconds
|
|
270
302
|
And a critical event is received
|
|
271
|
-
Then
|
|
303
|
+
Then 1 notification should have been generated
|
|
272
304
|
When 10 seconds passes
|
|
273
305
|
And a critical event is received
|
|
274
|
-
Then
|
|
306
|
+
Then 1 notification should have been generated
|
|
275
307
|
When 10 seconds passes
|
|
276
308
|
And a critical event is received
|
|
277
|
-
Then
|
|
309
|
+
Then 1 notification should have been generated
|
|
278
310
|
When 10 seconds passes
|
|
279
311
|
# 60 seconds
|
|
280
312
|
And an ok event is received
|
|
281
|
-
Then
|
|
313
|
+
Then 2 notifications should have been generated
|
|
282
314
|
When 10 seconds passes
|
|
283
315
|
And an ok event is received
|
|
284
|
-
Then
|
|
316
|
+
Then 2 notifications should have been generated
|
|
285
317
|
When 10 seconds passes
|
|
286
318
|
And an ok event is received
|
|
287
|
-
Then
|
|
319
|
+
Then 2 notifications should have been generated
|
|
288
320
|
When 10 seconds passes
|
|
289
321
|
And an ok event is received
|
|
290
|
-
Then
|
|
322
|
+
Then 2 notifications should have been generated
|
|
291
323
|
When 10 seconds passes
|
|
292
324
|
And an ok event is received
|
|
293
|
-
Then
|
|
325
|
+
Then 2 notifications should have been generated
|
|
294
326
|
When 10 seconds passes
|
|
295
327
|
And an ok event is received
|
|
296
|
-
Then
|
|
328
|
+
Then 2 notifications should have been generated
|
|
297
329
|
When 10 seconds passes
|
|
298
330
|
# 120 seconds
|
|
299
331
|
And a critical event is received
|
|
300
|
-
Then
|
|
332
|
+
Then 3 notifications should have been generated
|
|
301
333
|
When 10 seconds passes
|
|
302
334
|
And a critical event is received
|
|
303
|
-
Then
|
|
335
|
+
Then 3 notifications should have been generated
|
|
304
336
|
When 10 seconds passes
|
|
305
337
|
And a critical event is received
|
|
306
|
-
Then
|
|
338
|
+
Then 3 notifications should have been generated
|
|
307
339
|
When 10 seconds passes
|
|
308
340
|
# 150 seconds
|
|
309
341
|
And a critical event is received
|
|
310
|
-
Then
|
|
342
|
+
Then 3 notifications should have been generated
|
|
311
343
|
When 10 seconds passes
|
|
312
344
|
And a critical event is received
|
|
313
|
-
Then
|
|
345
|
+
Then 3 notifications should have been generated
|
|
314
346
|
When 10 seconds passes
|
|
315
347
|
And a critical event is received
|
|
316
|
-
Then
|
|
348
|
+
Then 3 notifications should have been generated
|
|
317
349
|
When 10 seconds passes
|
|
318
350
|
# 180 seconds
|
|
319
351
|
And an ok event is received
|
|
320
|
-
Then
|
|
352
|
+
Then 4 notifications should have been generated
|
|
321
353
|
|
|
322
|
-
# commenting out this test for now, will revive it
|
|
323
|
-
# when working on gh-119
|
|
324
354
|
@time
|
|
325
355
|
Scenario: a lot of quick ok -> warning -> ok -> warning
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
Scenario: scheduled maintenance created for initial check reference
|
|
420
|
-
Given the check has no state
|
|
421
|
-
When an ok event is received
|
|
422
|
-
Then scheduled maintenance should be generated
|
|
356
|
+
Given the check is in an ok state
|
|
357
|
+
When 10 seconds passes
|
|
358
|
+
And a warning event is received
|
|
359
|
+
Then no notifications should have been generated
|
|
360
|
+
When 10 seconds passes
|
|
361
|
+
And an ok event is received
|
|
362
|
+
Then no notifications should have been generated
|
|
363
|
+
When 10 seconds passes
|
|
364
|
+
And a warning event is received
|
|
365
|
+
Then no notifications should have been generated
|
|
366
|
+
When 10 seconds passes
|
|
367
|
+
And a warning event is received
|
|
368
|
+
Then no notifications should have been generated
|
|
369
|
+
When 10 seconds passes
|
|
370
|
+
And a warning event is received
|
|
371
|
+
Then no notifications should have been generated
|
|
372
|
+
When 20 seconds passes
|
|
373
|
+
And an ok event is received
|
|
374
|
+
Then no notifications should have been generated
|
|
375
|
+
When 10 seconds passes
|
|
376
|
+
And a warning event is received
|
|
377
|
+
Then no notifications should have been generated
|
|
378
|
+
When 10 seconds passes
|
|
379
|
+
And an ok event is received
|
|
380
|
+
Then no notifications should have been generated
|
|
381
|
+
When 10 seconds passes
|
|
382
|
+
And a warning event is received
|
|
383
|
+
Then no notifications should have been generated
|
|
384
|
+
When 10 seconds passes
|
|
385
|
+
And a warning event is received
|
|
386
|
+
Then no notifications should have been generated
|
|
387
|
+
When 10 seconds passes
|
|
388
|
+
And a warning event is received
|
|
389
|
+
Then no notifications should have been generated
|
|
390
|
+
When 10 seconds passes
|
|
391
|
+
And a warning event is received
|
|
392
|
+
Then 1 notification should have been generated
|
|
393
|
+
When 10 seconds passes
|
|
394
|
+
And a warning event is received
|
|
395
|
+
Then 1 notification should have been generated
|
|
396
|
+
When 10 seconds passes
|
|
397
|
+
And a warning event is received
|
|
398
|
+
Then 1 notification should have been generated
|
|
399
|
+
When 10 seconds passes
|
|
400
|
+
And an ok event is received
|
|
401
|
+
Then 2 notifications should have been generated
|
|
402
|
+
# recovered
|
|
403
|
+
When 10 seconds passes
|
|
404
|
+
And a warning event is received
|
|
405
|
+
Then 2 notifications should have been generated
|
|
406
|
+
When 10 seconds passes
|
|
407
|
+
And a warning event is received
|
|
408
|
+
Then 2 notifications should have been generated
|
|
409
|
+
When 10 seconds passes
|
|
410
|
+
And a warning event is received
|
|
411
|
+
Then 2 notifications should have been generated
|
|
412
|
+
When 10 seconds passes
|
|
413
|
+
And an ok event is received
|
|
414
|
+
Then 2 notifications should have been generated
|
|
415
|
+
When 10 seconds passes
|
|
416
|
+
And a warning event is received
|
|
417
|
+
Then 2 notifications should have been generated
|
|
418
|
+
When 10 seconds passes
|
|
419
|
+
And a warning event is received
|
|
420
|
+
Then 2 notifications should have been generated
|
|
421
|
+
When 10 seconds passes
|
|
422
|
+
And a warning event is received
|
|
423
|
+
Then 2 notifications should have been generated
|
|
424
|
+
When 10 seconds passes
|
|
425
|
+
And an ok event is received
|
|
426
|
+
Then 2 notifications should have been generated
|
|
427
|
+
When 10 seconds passes
|
|
428
|
+
And an ok event is received
|
|
429
|
+
Then 2 notifications should have been generated
|
|
430
|
+
When 10 seconds passes
|
|
431
|
+
And an ok event is received
|
|
432
|
+
Then 2 notifications should have been generated
|
|
433
|
+
When 10 seconds passes
|
|
434
|
+
And an ok event is received
|
|
435
|
+
Then 2 notifications should have been generated
|
|
436
|
+
When 10 seconds passes
|
|
437
|
+
And an ok event is received
|
|
438
|
+
Then 2 notifications should have been generated
|
|
439
|
+
When 10 seconds passes
|
|
440
|
+
And a warning event is received
|
|
441
|
+
Then 3 notifications should have been generated
|
|
442
|
+
When 10 seconds passes
|
|
443
|
+
And a warning event is received
|
|
444
|
+
Then 3 notifications should have been generated
|
|
445
|
+
When 10 seconds passes
|
|
446
|
+
And an ok event is received
|
|
447
|
+
Then 4 notifications should have been generated
|