flapjack 1.6.0 → 2.0.0b1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (301) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -6
  3. data/.gitmodules +1 -1
  4. data/.rspec +1 -1
  5. data/.ruby-version +1 -1
  6. data/.travis.yml +12 -13
  7. data/CHANGELOG.md +2 -9
  8. data/CONTRIBUTING.md +7 -2
  9. data/Gemfile +4 -13
  10. data/LICENCE +1 -0
  11. data/README.md +8 -2
  12. data/Rakefile +2 -2
  13. data/bin/flapjack +3 -12
  14. data/build.sh +4 -2
  15. data/etc/flapjack_config.toml.example +273 -0
  16. data/features/ack_after_sched_maint.feature +18 -21
  17. data/features/cli.feature +11 -71
  18. data/features/cli_flapjack-feed-events.feature +14 -15
  19. data/features/cli_flapjack-nagios-receiver.feature +12 -41
  20. data/features/cli_flapper.feature +12 -41
  21. data/features/cli_purge.feature +5 -6
  22. data/features/cli_receive-events.feature +6 -7
  23. data/features/cli_simulate-failed-check.feature +5 -6
  24. data/features/events.feature +206 -181
  25. data/features/events_check_names.feature +4 -7
  26. data/features/notification_rules.feature +144 -223
  27. data/features/notifications.feature +65 -57
  28. data/features/rollup.feature +45 -47
  29. data/features/steps/cli_steps.rb +4 -5
  30. data/features/steps/events_steps.rb +163 -373
  31. data/features/steps/notifications_steps.rb +408 -264
  32. data/features/steps/packaging-lintian_steps.rb +0 -4
  33. data/features/steps/time_travel_steps.rb +0 -26
  34. data/features/support/daemons.rb +6 -31
  35. data/features/support/env.rb +65 -74
  36. data/flapjack.gemspec +22 -24
  37. data/lib/flapjack.rb +14 -7
  38. data/lib/flapjack/cli/flapper.rb +74 -173
  39. data/lib/flapjack/cli/maintenance.rb +278 -109
  40. data/lib/flapjack/cli/migrate.rb +950 -0
  41. data/lib/flapjack/cli/purge.rb +19 -22
  42. data/lib/flapjack/cli/receiver.rb +150 -326
  43. data/lib/flapjack/cli/server.rb +8 -235
  44. data/lib/flapjack/cli/simulate.rb +42 -57
  45. data/lib/flapjack/configuration.rb +51 -37
  46. data/lib/flapjack/coordinator.rb +138 -129
  47. data/lib/flapjack/data/acknowledgement.rb +177 -0
  48. data/lib/flapjack/data/alert.rb +97 -158
  49. data/lib/flapjack/data/check.rb +611 -0
  50. data/lib/flapjack/data/condition.rb +70 -0
  51. data/lib/flapjack/data/contact.rb +226 -456
  52. data/lib/flapjack/data/event.rb +96 -184
  53. data/lib/flapjack/data/extensions/associations.rb +59 -0
  54. data/lib/flapjack/data/extensions/short_name.rb +25 -0
  55. data/lib/flapjack/data/medium.rb +428 -0
  56. data/lib/flapjack/data/metrics.rb +194 -0
  57. data/lib/flapjack/data/notification.rb +22 -281
  58. data/lib/flapjack/data/rule.rb +473 -0
  59. data/lib/flapjack/data/scheduled_maintenance.rb +244 -0
  60. data/lib/flapjack/data/state.rb +221 -0
  61. data/lib/flapjack/data/statistic.rb +112 -0
  62. data/lib/flapjack/data/tag.rb +277 -0
  63. data/lib/flapjack/data/test_notification.rb +182 -0
  64. data/lib/flapjack/data/unscheduled_maintenance.rb +159 -0
  65. data/lib/flapjack/data/validators/id_validator.rb +20 -0
  66. data/lib/flapjack/exceptions.rb +6 -0
  67. data/lib/flapjack/filters/acknowledgement.rb +23 -16
  68. data/lib/flapjack/filters/base.rb +0 -5
  69. data/lib/flapjack/filters/delays.rb +53 -43
  70. data/lib/flapjack/filters/ok.rb +23 -14
  71. data/lib/flapjack/filters/scheduled_maintenance.rb +3 -3
  72. data/lib/flapjack/filters/unscheduled_maintenance.rb +12 -3
  73. data/lib/flapjack/gateways/aws_sns.rb +65 -49
  74. data/lib/flapjack/gateways/aws_sns/alert.text.erb +2 -2
  75. data/lib/flapjack/gateways/aws_sns/alert_subject.text.erb +2 -2
  76. data/lib/flapjack/gateways/aws_sns/rollup_subject.text.erb +1 -1
  77. data/lib/flapjack/gateways/email.rb +107 -90
  78. data/lib/flapjack/gateways/email/alert.html.erb +19 -18
  79. data/lib/flapjack/gateways/email/alert.text.erb +20 -14
  80. data/lib/flapjack/gateways/email/alert_subject.text.erb +2 -1
  81. data/lib/flapjack/gateways/email/rollup.html.erb +14 -13
  82. data/lib/flapjack/gateways/email/rollup.text.erb +13 -10
  83. data/lib/flapjack/gateways/jabber.rb +679 -671
  84. data/lib/flapjack/gateways/jabber/alert.text.erb +9 -6
  85. data/lib/flapjack/gateways/jsonapi.rb +164 -350
  86. data/lib/flapjack/gateways/jsonapi/data/join_descriptor.rb +44 -0
  87. data/lib/flapjack/gateways/jsonapi/data/method_descriptor.rb +21 -0
  88. data/lib/flapjack/gateways/jsonapi/helpers/headers.rb +63 -0
  89. data/lib/flapjack/gateways/jsonapi/helpers/miscellaneous.rb +136 -0
  90. data/lib/flapjack/gateways/jsonapi/helpers/resources.rb +227 -0
  91. data/lib/flapjack/gateways/jsonapi/helpers/serialiser.rb +313 -0
  92. data/lib/flapjack/gateways/jsonapi/helpers/swagger_docs.rb +322 -0
  93. data/lib/flapjack/gateways/jsonapi/methods/association_delete.rb +115 -0
  94. data/lib/flapjack/gateways/jsonapi/methods/association_get.rb +288 -0
  95. data/lib/flapjack/gateways/jsonapi/methods/association_patch.rb +178 -0
  96. data/lib/flapjack/gateways/jsonapi/methods/association_post.rb +116 -0
  97. data/lib/flapjack/gateways/jsonapi/methods/metrics.rb +71 -0
  98. data/lib/flapjack/gateways/jsonapi/methods/resource_delete.rb +119 -0
  99. data/lib/flapjack/gateways/jsonapi/methods/resource_get.rb +186 -0
  100. data/lib/flapjack/gateways/jsonapi/methods/resource_patch.rb +239 -0
  101. data/lib/flapjack/gateways/jsonapi/methods/resource_post.rb +197 -0
  102. data/lib/flapjack/gateways/jsonapi/middleware/array_param_fixer.rb +27 -0
  103. data/lib/flapjack/gateways/jsonapi/{rack → middleware}/json_params_parser.rb +7 -6
  104. data/lib/flapjack/gateways/jsonapi/middleware/request_timestamp.rb +18 -0
  105. data/lib/flapjack/gateways/oobetet.rb +222 -170
  106. data/lib/flapjack/gateways/pager_duty.rb +388 -0
  107. data/lib/flapjack/gateways/pager_duty/alert.text.erb +13 -0
  108. data/lib/flapjack/gateways/slack.rb +56 -48
  109. data/lib/flapjack/gateways/slack/alert.text.erb +1 -1
  110. data/lib/flapjack/gateways/slack/rollup.text.erb +1 -1
  111. data/lib/flapjack/gateways/sms_aspsms.rb +155 -0
  112. data/lib/flapjack/gateways/sms_aspsms/alert.text.erb +7 -0
  113. data/lib/flapjack/gateways/sms_aspsms/rollup.text.erb +2 -0
  114. data/lib/flapjack/gateways/sms_messagenet.rb +77 -57
  115. data/lib/flapjack/gateways/sms_messagenet/alert.text.erb +3 -2
  116. data/lib/flapjack/gateways/sms_nexmo.rb +53 -51
  117. data/lib/flapjack/gateways/sms_nexmo/alert.text.erb +2 -2
  118. data/lib/flapjack/gateways/sms_nexmo/rollup.text.erb +1 -1
  119. data/lib/flapjack/gateways/sms_twilio.rb +79 -62
  120. data/lib/flapjack/gateways/sms_twilio/alert.text.erb +3 -2
  121. data/lib/flapjack/gateways/web.rb +437 -345
  122. data/lib/flapjack/gateways/web/middleware/request_timestamp.rb +18 -0
  123. data/lib/flapjack/gateways/web/public/css/bootstrap.css +3793 -4340
  124. data/lib/flapjack/gateways/web/public/css/bootstrap.css.map +1 -0
  125. data/lib/flapjack/gateways/web/public/fonts/glyphicons-halflings-regular.eot +0 -0
  126. data/lib/flapjack/gateways/web/public/fonts/glyphicons-halflings-regular.svg +273 -214
  127. data/lib/flapjack/gateways/web/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  128. data/lib/flapjack/gateways/web/public/fonts/glyphicons-halflings-regular.woff +0 -0
  129. data/lib/flapjack/gateways/web/public/fonts/glyphicons-halflings-regular.woff2 +0 -0
  130. data/lib/flapjack/gateways/web/public/js/bootstrap.js +1637 -1607
  131. data/lib/flapjack/gateways/web/public/js/self_stats.js +1 -2
  132. data/lib/flapjack/gateways/web/views/_pagination.html.erb +19 -0
  133. data/lib/flapjack/gateways/web/views/check.html.erb +159 -121
  134. data/lib/flapjack/gateways/web/views/checks.html.erb +82 -41
  135. data/lib/flapjack/gateways/web/views/contact.html.erb +59 -71
  136. data/lib/flapjack/gateways/web/views/contacts.html.erb +32 -8
  137. data/lib/flapjack/gateways/web/views/index.html.erb +2 -2
  138. data/lib/flapjack/gateways/web/views/{layout.erb → layout.html.erb} +7 -23
  139. data/lib/flapjack/gateways/web/views/self_stats.html.erb +32 -33
  140. data/lib/flapjack/gateways/web/views/tag.html.erb +32 -0
  141. data/lib/flapjack/gateways/web/views/tags.html.erb +51 -0
  142. data/lib/flapjack/logger.rb +34 -3
  143. data/lib/flapjack/notifier.rb +180 -112
  144. data/lib/flapjack/patches.rb +8 -63
  145. data/lib/flapjack/pikelet.rb +185 -143
  146. data/lib/flapjack/processor.rb +323 -191
  147. data/lib/flapjack/record_queue.rb +33 -0
  148. data/lib/flapjack/redis_proxy.rb +66 -0
  149. data/lib/flapjack/utility.rb +21 -15
  150. data/lib/flapjack/version.rb +2 -1
  151. data/libexec/httpbroker.go +218 -14
  152. data/libexec/oneoff.go +13 -10
  153. data/spec/lib/flapjack/configuration_spec.rb +286 -0
  154. data/spec/lib/flapjack/coordinator_spec.rb +103 -157
  155. data/spec/lib/flapjack/data/check_spec.rb +175 -0
  156. data/spec/lib/flapjack/data/contact_spec.rb +26 -349
  157. data/spec/lib/flapjack/data/event_spec.rb +76 -291
  158. data/spec/lib/flapjack/data/medium_spec.rb +19 -0
  159. data/spec/lib/flapjack/data/rule_spec.rb +43 -0
  160. data/spec/lib/flapjack/data/scheduled_maintenance_spec.rb +976 -0
  161. data/spec/lib/flapjack/data/unscheduled_maintenance_spec.rb +34 -0
  162. data/spec/lib/flapjack/gateways/aws_sns_spec.rb +111 -60
  163. data/spec/lib/flapjack/gateways/email_spec.rb +194 -161
  164. data/spec/lib/flapjack/gateways/jabber_spec.rb +961 -162
  165. data/spec/lib/flapjack/gateways/jsonapi/methods/check_links_spec.rb +155 -0
  166. data/spec/lib/flapjack/gateways/jsonapi/methods/checks_spec.rb +426 -0
  167. data/spec/lib/flapjack/gateways/jsonapi/methods/contact_links_spec.rb +217 -0
  168. data/spec/lib/flapjack/gateways/jsonapi/methods/contacts_spec.rb +425 -0
  169. data/spec/lib/flapjack/gateways/jsonapi/methods/events_spec.rb +271 -0
  170. data/spec/lib/flapjack/gateways/jsonapi/methods/media_spec.rb +257 -0
  171. data/spec/lib/flapjack/gateways/jsonapi/methods/medium_links_spec.rb +163 -0
  172. data/spec/lib/flapjack/gateways/jsonapi/methods/metrics_spec.rb +8 -0
  173. data/spec/lib/flapjack/gateways/jsonapi/methods/rule_links_spec.rb +212 -0
  174. data/spec/lib/flapjack/gateways/jsonapi/methods/rules_spec.rb +289 -0
  175. data/spec/lib/flapjack/gateways/jsonapi/methods/scheduled_maintenance_links_spec.rb +49 -0
  176. data/spec/lib/flapjack/gateways/jsonapi/methods/scheduled_maintenances_spec.rb +242 -0
  177. data/spec/lib/flapjack/gateways/jsonapi/methods/tag_links_spec.rb +274 -0
  178. data/spec/lib/flapjack/gateways/jsonapi/methods/tags_spec.rb +302 -0
  179. data/spec/lib/flapjack/gateways/jsonapi/methods/unscheduled_maintenance_links_spec.rb +49 -0
  180. data/spec/lib/flapjack/gateways/jsonapi/methods/unscheduled_maintenances_spec.rb +339 -0
  181. data/spec/lib/flapjack/gateways/jsonapi_spec.rb +1 -1
  182. data/spec/lib/flapjack/gateways/oobetet_spec.rb +151 -79
  183. data/spec/lib/flapjack/gateways/pager_duty_spec.rb +353 -0
  184. data/spec/lib/flapjack/gateways/slack_spec.rb +53 -53
  185. data/spec/lib/flapjack/gateways/sms_aspsms_spec.rb +106 -0
  186. data/spec/lib/flapjack/gateways/sms_messagenet_spec.rb +111 -54
  187. data/spec/lib/flapjack/gateways/sms_nexmo_spec.rb +50 -51
  188. data/spec/lib/flapjack/gateways/sms_twilio_spec.rb +108 -48
  189. data/spec/lib/flapjack/gateways/web_spec.rb +144 -216
  190. data/spec/lib/flapjack/notifier_spec.rb +132 -1
  191. data/spec/lib/flapjack/pikelet_spec.rb +111 -50
  192. data/spec/lib/flapjack/processor_spec.rb +210 -40
  193. data/spec/lib/flapjack/redis_proxy_spec.rb +45 -0
  194. data/spec/lib/flapjack/utility_spec.rb +11 -15
  195. data/spec/service_consumers/fixture_data.rb +547 -0
  196. data/spec/service_consumers/pact_helper.rb +21 -32
  197. data/spec/service_consumers/pacts/flapjack-diner_v2.0.json +4652 -0
  198. data/spec/service_consumers/provider_states_for_flapjack-diner.rb +279 -322
  199. data/spec/service_consumers/provider_support.rb +8 -0
  200. data/spec/spec_helper.rb +34 -44
  201. data/spec/support/erb_view_helper.rb +1 -1
  202. data/spec/support/factories.rb +58 -0
  203. data/spec/support/jsonapi_helper.rb +15 -26
  204. data/spec/support/mock_logger.rb +43 -0
  205. data/spec/support/xmpp_comparable.rb +24 -0
  206. data/src/flapjack/transport_test.go +30 -1
  207. data/tasks/dump_keys.rake +82 -0
  208. data/tasks/events.rake +7 -7
  209. data/tasks/support/flapjack_config_benchmark.toml +28 -0
  210. data/tasks/support/flapjack_config_benchmark.yaml +0 -2
  211. metadata +175 -222
  212. data/Guardfile +0 -14
  213. data/etc/flapjack_config.yaml.example +0 -477
  214. data/features/cli_flapjack-populator.feature +0 -90
  215. data/features/support/silent_system.rb +0 -4
  216. data/lib/flapjack/cli/import.rb +0 -108
  217. data/lib/flapjack/data/entity.rb +0 -652
  218. data/lib/flapjack/data/entity_check.rb +0 -1044
  219. data/lib/flapjack/data/message.rb +0 -56
  220. data/lib/flapjack/data/migration.rb +0 -234
  221. data/lib/flapjack/data/notification_rule.rb +0 -425
  222. data/lib/flapjack/data/semaphore.rb +0 -44
  223. data/lib/flapjack/data/tagged.rb +0 -48
  224. data/lib/flapjack/gateways/jsonapi/check_methods.rb +0 -206
  225. data/lib/flapjack/gateways/jsonapi/check_presenter.rb +0 -221
  226. data/lib/flapjack/gateways/jsonapi/contact_methods.rb +0 -186
  227. data/lib/flapjack/gateways/jsonapi/entity_methods.rb +0 -223
  228. data/lib/flapjack/gateways/jsonapi/medium_methods.rb +0 -185
  229. data/lib/flapjack/gateways/jsonapi/metrics_methods.rb +0 -132
  230. data/lib/flapjack/gateways/jsonapi/notification_rule_methods.rb +0 -141
  231. data/lib/flapjack/gateways/jsonapi/pagerduty_credential_methods.rb +0 -139
  232. data/lib/flapjack/gateways/jsonapi/report_methods.rb +0 -146
  233. data/lib/flapjack/gateways/pagerduty.rb +0 -318
  234. data/lib/flapjack/gateways/pagerduty/alert.text.erb +0 -10
  235. data/lib/flapjack/gateways/web/public/css/select2-bootstrap.css +0 -87
  236. data/lib/flapjack/gateways/web/public/css/select2.css +0 -615
  237. data/lib/flapjack/gateways/web/public/css/tablesort.css +0 -67
  238. data/lib/flapjack/gateways/web/public/img/select2-spinner.gif +0 -0
  239. data/lib/flapjack/gateways/web/public/img/select2.png +0 -0
  240. data/lib/flapjack/gateways/web/public/img/select2x2.png +0 -0
  241. data/lib/flapjack/gateways/web/public/js/backbone.js +0 -1581
  242. data/lib/flapjack/gateways/web/public/js/backbone.jsonapi.js +0 -322
  243. data/lib/flapjack/gateways/web/public/js/flapjack.js +0 -82
  244. data/lib/flapjack/gateways/web/public/js/jquery.tablesorter.js +0 -1640
  245. data/lib/flapjack/gateways/web/public/js/jquery.tablesorter.widgets.js +0 -1390
  246. data/lib/flapjack/gateways/web/public/js/modules/contact.js +0 -520
  247. data/lib/flapjack/gateways/web/public/js/modules/entity.js +0 -28
  248. data/lib/flapjack/gateways/web/public/js/modules/medium.js +0 -40
  249. data/lib/flapjack/gateways/web/public/js/select2.js +0 -3397
  250. data/lib/flapjack/gateways/web/public/js/tablesort.js +0 -44
  251. data/lib/flapjack/gateways/web/public/js/underscore.js +0 -1276
  252. data/lib/flapjack/gateways/web/views/edit_contacts.html.erb +0 -173
  253. data/lib/flapjack/gateways/web/views/entities.html.erb +0 -30
  254. data/lib/flapjack/gateways/web/views/entity.html.erb +0 -51
  255. data/lib/flapjack/rack_logger.rb +0 -47
  256. data/lib/flapjack/redis_pool.rb +0 -42
  257. data/spec/lib/flapjack/data/entity_check_spec.rb +0 -1418
  258. data/spec/lib/flapjack/data/entity_spec.rb +0 -872
  259. data/spec/lib/flapjack/data/message_spec.rb +0 -30
  260. data/spec/lib/flapjack/data/migration_spec.rb +0 -104
  261. data/spec/lib/flapjack/data/notification_rule_spec.rb +0 -232
  262. data/spec/lib/flapjack/data/notification_spec.rb +0 -53
  263. data/spec/lib/flapjack/data/semaphore_spec.rb +0 -24
  264. data/spec/lib/flapjack/filters/acknowledgement_spec.rb +0 -6
  265. data/spec/lib/flapjack/filters/delays_spec.rb +0 -6
  266. data/spec/lib/flapjack/filters/ok_spec.rb +0 -6
  267. data/spec/lib/flapjack/filters/scheduled_maintenance_spec.rb +0 -6
  268. data/spec/lib/flapjack/filters/unscheduled_maintenance_spec.rb +0 -6
  269. data/spec/lib/flapjack/gateways/jsonapi/check_methods_spec.rb +0 -315
  270. data/spec/lib/flapjack/gateways/jsonapi/check_presenter_spec.rb +0 -223
  271. data/spec/lib/flapjack/gateways/jsonapi/contact_methods_spec.rb +0 -131
  272. data/spec/lib/flapjack/gateways/jsonapi/entity_methods_spec.rb +0 -389
  273. data/spec/lib/flapjack/gateways/jsonapi/medium_methods_spec.rb +0 -231
  274. data/spec/lib/flapjack/gateways/jsonapi/notification_rule_methods_spec.rb +0 -169
  275. data/spec/lib/flapjack/gateways/jsonapi/pagerduty_credential_methods_spec.rb +0 -114
  276. data/spec/lib/flapjack/gateways/jsonapi/report_methods_spec.rb +0 -590
  277. data/spec/lib/flapjack/gateways/pagerduty_spec.rb +0 -249
  278. data/spec/lib/flapjack/gateways/web/views/check.html.erb_spec.rb +0 -21
  279. data/spec/lib/flapjack/gateways/web/views/contact.html.erb_spec.rb +0 -24
  280. data/spec/lib/flapjack/gateways/web/views/index.html.erb_spec.rb +0 -16
  281. data/spec/lib/flapjack/redis_pool_spec.rb +0 -29
  282. data/spec/service_consumers/pacts/flapjack-diner_v1.0.json +0 -4702
  283. data/tasks/entities.rake +0 -151
  284. data/tasks/profile.rake +0 -282
  285. data/tmp/acknowledge.rb +0 -13
  286. data/tmp/create_config_yaml.rb +0 -16
  287. data/tmp/create_event_ok.rb +0 -30
  288. data/tmp/create_event_unknown.rb +0 -30
  289. data/tmp/create_events_failure.rb +0 -34
  290. data/tmp/create_events_ok.rb +0 -32
  291. data/tmp/create_events_ok_fail_ack_ok.rb +0 -53
  292. data/tmp/create_events_ok_failure.rb +0 -41
  293. data/tmp/create_events_ok_failure_ack.rb +0 -53
  294. data/tmp/dummy_contacts.json +0 -43
  295. data/tmp/dummy_entities.json +0 -37
  296. data/tmp/generate_nagios_test_hosts.rb +0 -16
  297. data/tmp/notification_rules.rb +0 -73
  298. data/tmp/parse_config_yaml.rb +0 -7
  299. data/tmp/redis_find_spurious_unknown_states.rb +0 -52
  300. data/tmp/test_json_post.rb +0 -19
  301. data/tmp/test_notification_rules_api.rb +0 -171
@@ -2,20 +2,17 @@
2
2
  Feature: events and check names
3
3
  Flapjack must handle weird characters in check names in events
4
4
 
5
- Background:
6
- Given an entity 'foo-app-01.example.com' exists
7
-
8
5
  @time
9
6
  Scenario: acknowledgements for checks with colons
10
7
  Given the check is check 'Disk C: Utilisation' on entity 'foo-app-01.example.com'
11
8
  And the check is in an ok state
12
9
  When a warning event is received
13
- Then a notification should not be generated
10
+ Then no notifications should have been generated
14
11
  When 1 minute passes
15
12
  And a warning event is received
16
- Then a notification should be generated
13
+ Then 1 notification should have been generated
17
14
  When an acknowledgement event is received
18
- Then a notification should be generated
15
+ Then 2 notifications should have been generated
19
16
  When 1 minute passes
20
17
  And a warning event is received
21
- Then a notification should not be generated
18
+ Then 2 notifications should have been generated
@@ -2,80 +2,56 @@
2
2
  Feature: Notification rules on a per contact basis
3
3
 
4
4
  Background:
5
- Given the following users exist:
6
- | id | first_name | last_name | email | sms | timezone |
7
- | c1 | Malak | Al-Musawi | malak@example.com | +61400000001 | Asia/Baghdad |
8
- | c2 | Imani | Farooq | imani@example.com | +61400000002 | Europe/Moscow |
9
- | c3 | Vera | Дурейко | vera@example.com | +61400000003 | Europe/Paris |
10
- | c4 | Lucia | Moretti | lucia@example.com | +61400000004 | Europe/Rome |
11
- | c5 | Wang Fang | Wong | fang@example.com | +61400000005 | Asia/Shanghai |
12
- | c6 | Jive | Smith | jive@example.com | +61400000006 | America/Los_Angeles |
13
-
14
- And the following entities exist:
15
- | id | name | contacts |
16
- | 1 | foo | c1 |
17
- | 2 | bar | c1,c2,c3 |
18
- | 3 | baz | c1,c3 |
19
- | 4 | buf | c1,c2,c3 |
20
- | 5 | foo-app-01.xyz | c4,c6 |
21
- | 6 | blakes7 | c2,c6 |
22
-
23
- And user c1 has the following notification intervals:
24
- | email | sms |
25
- | 15 | 60 |
26
-
27
- And user c2 has the following notification intervals:
28
- | email | sms |
29
- | 15 | 60 |
30
-
31
- And user c3 has the following notification intervals:
32
- | email | sms |
33
- | 15 | 60 |
34
-
35
- And user c4 has the following notification intervals:
36
- | email | sms |
37
- | 15 | 60 |
38
-
39
- And user c1 has the following notification rules:
40
- | entities | unknown_media | warning_media | critical_media | warning_blackhole | critical_blackhole | time_restrictions |
41
- | | | email | sms,email | true | true | |
42
- | foo | | email | sms,email | | | 8-18 weekdays |
43
- | bar | email | | sms,email | true | | |
44
- | baz | | email | sms,email | | | |
45
-
46
- And user c2 has the following notification rules:
47
- | entities | tags | warning_media | critical_media | warning_blackhole | critical_blackhole |
48
- | | | email | email | | |
49
- | | | sms | sms | | |
50
- | bar,blakes7 | | email | email,sms | | |
51
- | bar,blakes7 | wags | | | true | true |
52
-
53
- And user c3 has the following notification rules:
54
- | entities | warning_media | critical_media | warning_blackhole | critical_blackhole |
55
- | | email | email | | |
56
- | baz | sms | sms | | |
57
- | buf | email | email | | |
58
- | buf | sms | sms | | |
59
- | bar | email | email | true | true |
60
-
61
- And user c4 has the following notification rules:
62
- | tags | warning_media | critical_media | time_restrictions |
63
- | | | | |
64
- | xyz, disk, util | sms | sms | |
65
- | xyz, ping | sms,email | sms,email | 8-18 weekdays |
66
-
67
- And user c5 has the following notification rules:
68
- | unknown_media | critical_media |
69
- | email | email, sms |
70
-
71
- And user c6 has the following notification rules:
72
- | entities | regex_entities | tags | warning_media | critical_media |
73
- | | | | | |
74
- | foo-app-01.xyz | | check_disk | email | email |
75
- | blakes7 | | | | email |
76
- | blakes7 | ++* | | | sms |
77
-
78
- @time_restrictions @time
5
+ Given the following contacts exist:
6
+ | id | name | timezone |
7
+ | 7f96a216-76aa-45fc-a88e-7431cd6d7aac | Malak Al-Musawi | Asia/Baghdad |
8
+ | 65d32027-1942-43b3-93c5-52f4b12d36b0 | Imani Farooq | Europe/Moscow |
9
+ | 9f77502c-1daf-47a2-b806-f3ae7d04cefb | Vera Дурейко | Europe/Paris |
10
+ | 158ec8fd-36ca-4d10-a2f4-dc04d374e321 | Lucia Moretti | Europe/Rome |
11
+ | 5da490ec-72a0-42b0-834f-4049867dfce7 | Wang Fang Wong | Asia/Shanghai |
12
+ | 09ab8f30-a2da-475b-a61f-8fdab4430567 | John Bloke | Australia/Sydney |
13
+
14
+ And the following media exist:
15
+ | id | contact_id | transport | address | interval | rollup_threshold |
16
+ | 28032dbf-388d-4f52-91b2-dc5e5be2becc | 7f96a216-76aa-45fc-a88e-7431cd6d7aac | email | malak@example.com | 15 | 5 |
17
+ | 73e2803f-948e-467a-a707-37b9f53ee21a | 7f96a216-76aa-45fc-a88e-7431cd6d7aac | sms | +61400000001 | 60 | 5 |
18
+ | 1d473cef-5369-4396-9f59-533f3db6c1cb | 65d32027-1942-43b3-93c5-52f4b12d36b0 | email | imani@example.com | 15 | 5 |
19
+ | 7f96a216-76aa-45fc-a88e-7431cd6d7aac | 65d32027-1942-43b3-93c5-52f4b12d36b0 | sms | +61400000002 | 60 | 5 |
20
+ | 65d32027-1942-43b3-93c5-52f4b12d36b0 | 9f77502c-1daf-47a2-b806-f3ae7d04cefb | email | vera@example.com | 15 | 5 |
21
+ | 55d3778e-e4b2-4dcc-8337-03fcbd2e5f80 | 9f77502c-1daf-47a2-b806-f3ae7d04cefb | sms | +61400000003 | 60 | 5 |
22
+ | 19ef48b1-9a42-488b-9734-00314c79e5eb | 158ec8fd-36ca-4d10-a2f4-dc04d374e321 | email | lucia@example.com | 15 | 5 |
23
+ | ad25c952-c300-4285-9301-ef4408c9d645 | 158ec8fd-36ca-4d10-a2f4-dc04d374e321 | sms | +61400000004 | 60 | 5 |
24
+ | f15078cf-3643-4cf1-b701-ac9fe2836365 | 5da490ec-72a0-42b0-834f-4049867dfce7 | email | fang@example.com | 15 | 5 |
25
+ | 862228f8-fc80-4887-bc4c-e133fcda4107 | 5da490ec-72a0-42b0-834f-4049867dfce7 | sms | +61400000005 | 60 | 5 |
26
+ | 2e92f734-0597-40bb-bcc6-6ccef4b34720 | 09ab8f30-a2da-475b-a61f-8fdab4430567 | email | bloke@example.com | 15 | 5 |
27
+ | 94b74a9f-7d16-4713-83cf-37196abed014 | 09ab8f30-a2da-475b-a61f-8fdab4430567 | sms | +61400000006 | 60 | 5 |
28
+
29
+ And the following checks exist:
30
+ | id | name | tags |
31
+ | 56c13ce2-f246-4bc6-adfa-2206789c3ced | foo:ping | foo,ping |
32
+ | 91d66290-2c70-4c0e-a955-acb5bf9e721e | foo:ssh | foo,ssh |
33
+ | d1a39575-0480-4f65-a7f7-64c90db93731 | bar:ping | bar,ping |
34
+ | 2ae8327c-ecf3-4544-ac3e-9c7779503a4a | baz:ping | baz,ping |
35
+ | 982fc9fb-fbf8-44cd-b6de-6ccbab8e7230 | buf:ping | buf,ping |
36
+
37
+ And the following rules exist:
38
+ | name | id | contact_id | blackhole | strategy | tags | condition | time_restriction | media_ids |
39
+ | malak email t | b0c8deb9-b8c8-4fdd-acc4-72493852ca15 | 7f96a216-76aa-45fc-a88e-7431cd6d7aac | false | all_tags | foo,ping | critical | 8-18 weekdays | 28032dbf-388d-4f52-91b2-dc5e5be2becc |
40
+ | imani email | 2df6bbc4-d6a4-4f23-b6e5-5c4a07c6e686 | 65d32027-1942-43b3-93c5-52f4b12d36b0 | false | all_tags | bar,ping | critical,unknown | | 1d473cef-5369-4396-9f59-533f3db6c1cb |
41
+ | imani sms | fb989a80-2f65-49e6-8d73-1777ad0aee0d | 65d32027-1942-43b3-93c5-52f4b12d36b0 | false | any_tag | buf,ssh | | | 7f96a216-76aa-45fc-a88e-7431cd6d7aac |
42
+ | vera email | fc2d1b1f-1480-45dd-814b-4655bc5b1474 | 9f77502c-1daf-47a2-b806-f3ae7d04cefb | false | all_tags | foo,ping | critical | | 65d32027-1942-43b3-93c5-52f4b12d36b0 |
43
+ | vera sms | 7c123a29-1a67-4a32-b38e-2658e63834d8 | 9f77502c-1daf-47a2-b806-f3ae7d04cefb | false | all_tags | foo,ping | | | 55d3778e-e4b2-4dcc-8337-03fcbd2e5f80 |
44
+ | lucia email, sms t | e8a67e7c-4f3d-4d9b-afe4-ef276bbeb0df | 158ec8fd-36ca-4d10-a2f4-dc04d374e321 | false | all_tags | baz,ping | critical | 8-18 weekdays | 19ef48b1-9a42-488b-9734-00314c79e5eb,ad25c952-c300-4285-9301-ef4408c9d645 |
45
+ | lucia email t | 0a3c66f2-6245-49cf-a02c-28d586b2f55a | 158ec8fd-36ca-4d10-a2f4-dc04d374e321 | false | all_tags | baz,ping | warning | 8-18 weekdays | 19ef48b1-9a42-488b-9734-00314c79e5eb |
46
+ | malak email | 9b437f3e-4b48-4516-8067-a57935684777 | 7f96a216-76aa-45fc-a88e-7431cd6d7aac | false | all_tags | buf,ping | critical | | 28032dbf-388d-4f52-91b2-dc5e5be2becc |
47
+ | fang email | 724bf183-215c-4ba9-b835-56db781c4844 | 5da490ec-72a0-42b0-834f-4049867dfce7 | false | global | | | | f15078cf-3643-4cf1-b701-ac9fe2836365 |
48
+ | fang sms | 1c501800-6b20-458d-bb99-a78d17397c00 | 5da490ec-72a0-42b0-834f-4049867dfce7 | false | global | | | | 862228f8-fc80-4887-bc4c-e133fcda4107 |
49
+ | drop malak email | dd7005b9-d30b-4875-9e83-dec7fb70895c | 7f96a216-76aa-45fc-a88e-7431cd6d7aac | true | all_tags | buf,ping | | | 28032dbf-388d-4f52-91b2-dc5e5be2becc |
50
+ | bloke sms g | 4441658d-c7af-45ef-bc8e-f6cd61fdc241 | 09ab8f30-a2da-475b-a61f-8fdab4430567 | false | global | | | | 94b74a9f-7d16-4713-83cf-37196abed014 |
51
+ | bloke sms no | 0f860a78-2f8a-40ca-8070-e1d88c6ff041 | 09ab8f30-a2da-475b-a61f-8fdab4430567 | true | no_tag | buf | | | 94b74a9f-7d16-4713-83cf-37196abed014 |
52
+
53
+
54
+ @time_restriction @time
79
55
  Scenario: Alerts only during specified time restrictions
80
56
  Given the timezone is Asia/Baghdad
81
57
  And the time is February 1 2013 6:59
@@ -90,75 +66,65 @@ Feature: Notification rules on a per contact basis
90
66
  And a critical event is received
91
67
  Then 1 email alert should be queued for malak@example.com
92
68
  When the time is February 1 2013 12:00
93
- Then all alert dropping keys for user c1 should have expired
94
69
  When a critical event is received
95
70
  Then 2 email alerts should be queued for malak@example.com
96
71
  When the time is February 1 2013 17:59
97
- Then all alert dropping keys for user c1 should have expired
98
72
  When a critical event is received
99
73
  Then 3 email alerts should be queued for malak@example.com
100
74
  When the time is February 1 2013 18:01
101
75
  When a critical event is received
102
76
  Then 3 email alerts should be queued for malak@example.com
103
77
 
104
- Scenario: time restrictions continue to work as expected when a contact changes timezone
105
-
106
- @time
107
- Scenario: skip rule with invalid regex
108
- Given the check is check 'ping' on entity 'blakes7'
109
- And the check is in an ok state
110
- When a critical event is received
111
- And 5 minutes passes
112
- And a critical event is received
113
- Then 1 email alert should be queued for jive@example.com
114
- And 0 sms alerts should be queued for +61400000006
78
+ # Scenario: time restriction continues to work as expected when a contact changes timezone
115
79
 
116
80
  @severity @time
117
- Scenario: Don't alert when media,severity does not match any matching rule's severity's media
81
+ Scenario: Don't alert when severity does not match any matching routes's severity
118
82
  Given the check is check 'ping' on entity 'bar'
119
83
  And the check is in an ok state
120
84
  When a warning event is received
121
85
  And 60 minutes passes
122
86
  And a warning event is received
123
- Then no email alerts should be queued for malak@example.com
87
+ Then no email alerts should be queued for imani@example.com
124
88
 
125
89
  @severity @time
126
- Scenario: Recoveries are not affected by notification rules
127
- Given the check is check 'ping' on entity 'baz'
90
+ Scenario: Recoveries are not affected by intervals
91
+ Given the check is check 'ping' on entity 'foo'
128
92
  And the check is in an ok state
129
93
  When a critical event is received
130
94
  And 5 minutes passes
131
95
  And a critical event is received
132
- Then 1 email alert should be queued for malak@example.com
96
+ Then 1 email alert should be queued for vera@example.com
133
97
  When 1 minute passes
134
98
  And an ok event is received
135
- Then 2 email alerts should be queued for malak@example.com
99
+ Then 2 email alerts should be queued for vera@example.com
136
100
 
137
101
  @severity @time
138
102
  Scenario: Alerts are sent to media of highest severity reached since last ok
139
- Given the check is check 'ping' on entity 'baz'
103
+ Given the timezone is Europe/Rome
104
+ And the time is February 1 2013 8:01
105
+ And the check is check 'ping' on entity 'baz'
140
106
  And the check is in an ok state
141
107
  When a warning event is received
142
108
  And 1 minute passes
143
109
  And a warning event is received
144
- Then 1 email alert should be queued for malak@example.com
145
- And 0 sms alerts should be queued for +61400000001
110
+ Then 1 email alert should be queued for lucia@example.com
111
+ And 0 sms alerts should be queued for +61400000004
146
112
  When 70 minutes passes
147
113
  And a critical event is received
148
114
  And 1 minute passes
149
115
  And a critical event is received
150
- Then 2 email alerts should be queued for malak@example.com
151
- And 1 sms alert should be queued for +61400000001
116
+ Then 2 email alerts should be queued for lucia@example.com
117
+ And 1 sms alert should be queued for +61400000004
152
118
  When 70 minutes passes
153
119
  And a warning event is received
154
120
  And 1 minute passes
155
121
  And a warning event is received
156
- Then 3 email alerts should be queued for malak@example.com
157
- And 2 sms alerts should be queued for +61400000001
122
+ Then 3 email alerts should be queued for lucia@example.com
123
+ And 2 sms alerts should be queued for +61400000004
158
124
  When 70 minutes passes
159
125
  And an ok event is received
160
- Then 4 email alerts should be queued for malak@example.com
161
- And 3 sms alerts should be queued for +61400000001
126
+ Then 4 email alerts should be queued for lucia@example.com
127
+ And 3 sms alerts should be queued for +61400000004
162
128
 
163
129
  @severity @time
164
130
  Scenario: Alerts only when media,severity matches any matching rule's severity's media with ok->warning->critical->ok
@@ -167,17 +133,17 @@ Feature: Notification rules on a per contact basis
167
133
  When a warning event is received
168
134
  And 1 minute passes
169
135
  And a warning event is received
170
- Then no email alerts should be queued for malak@example.com
136
+ Then no email alerts should be queued for imani@example.com
171
137
  When a critical event is received
172
138
  And 5 minutes passes
173
139
  And a critical event is received
174
- Then 1 email alert should be queued for malak@example.com
140
+ Then 1 email alert should be queued for imani@example.com
175
141
  When 1 minute passes
176
142
  And an ok event is received
177
- Then 2 email alert should be queued for malak@example.com
143
+ Then 2 email alert should be queued for imani@example.com
178
144
 
179
145
  @blackhole @time
180
- Scenario: Drop alerts matching a general blackhole rule
146
+ Scenario: Drop alerts matching a rejector
181
147
  Given the check is check 'ping' on entity 'buf'
182
148
  And the check is in an ok state
183
149
  When a critical event is received
@@ -185,80 +151,58 @@ Feature: Notification rules on a per contact basis
185
151
  And a critical event is received
186
152
  Then 0 email alerts should be queued for malak@example.com
187
153
 
188
- @blackhole @time
189
- Scenario: Drop alerts matching a blackhole rule by entity
190
- Given the check is check 'ping' on entity 'bar'
191
- And the check is in an ok state
192
- When a warning event is received
193
- And 1 minute passes
194
- And a warning event is received
195
- Then 0 email alerts should be queued for malak@example.com
196
- And 0 email alerts should be queued for vera@example.com
197
- When an ok event is received
198
- Then 0 email alerts should be queued for malak@example.com
199
- And 0 email alerts should be queued for vera@example.com
200
-
201
- @blackhole @time
202
- Scenario: Drop alerts matching a blackhole rule by tags
203
- Given the check is check 'wags the dog' on entity 'blakes7'
204
- And the check is in an ok state
205
- When a warning event is received
206
- And 1 minute passes
207
- And a warning event is received
208
- Then 0 email alerts should be queued for imani@example.com
209
- When an ok event is received
210
- Then 0 email alerts should be queued for imani@example.com
211
-
212
154
  @intervals @time
213
155
  Scenario: Alerts according to custom interval
214
156
  Given the check is check 'ping' on entity 'bar'
215
157
  And the check is in an ok state
216
158
  When a critical event is received
217
- Then no email alerts should be queued for malak@example.com
159
+ Then no email alerts should be queued for imani@example.com
218
160
  When 1 minute passes
219
161
  And a critical event is received
220
- Then 1 email alert should be queued for malak@example.com
162
+ Then 1 email alert should be queued for imani@example.com
221
163
  When 10 minutes passes
222
164
  And a critical event is received
223
- Then 1 email alert should be queued for malak@example.com
165
+ Then 1 email alert should be queued for imani@example.com
224
166
  When 6 minutes passes
225
167
  And a critical event is received
226
- Then 2 email alerts should be queued for malak@example.com
168
+ Then 2 email alerts should be queued for imani@example.com
227
169
 
228
170
  @intervals @time
229
171
  Scenario: Alerts according to custom interval with unknown
230
172
  Given the check is check 'ping' on entity 'bar'
231
173
  And the check is in an ok state
232
174
  When an unknown event is received
233
- Then no email alerts should be queued for malak@example.com
175
+ Then no email alerts should be queued for imani@example.com
234
176
  When 1 minute passes
235
177
  And an unknown event is received
236
- Then 1 email alert should be queued for malak@example.com
178
+ Then 1 email alert should be queued for imani@example.com
237
179
  When 10 minutes passes
238
180
  And an unknown event is received
239
- Then 1 email alert should be queued for malak@example.com
181
+ Then 1 email alert should be queued for imani@example.com
240
182
  When 6 minutes passes
241
183
  And an unknown event is received
242
- Then 2 email alerts should be queued for malak@example.com
184
+ Then 2 email alerts should be queued for imani@example.com
243
185
 
244
186
  @intervals @time
245
- Scenario: Problem directly after Recovery should alert despite notification intervals
246
- Given the check is check 'ping' on entity 'baz'
187
+ Scenario: Problem directly after recovery should alert despite notification intervals
188
+ Given the timezone is Europe/Rome
189
+ And the time is February 1 2013 8:01
190
+ And the check is check 'ping' on entity 'baz'
247
191
  And the check is in an ok state
248
192
  When a critical event is received
249
193
  And 1 minute passes
250
194
  And a critical event is received
251
- Then 1 email alert should be queued for malak@example.com
252
- And 1 sms alert should be queued for +61400000001
195
+ Then 1 email alert should be queued for lucia@example.com
196
+ And 1 sms alert should be queued for +61400000004
253
197
  When an ok event is received
254
- Then 2 email alerts should be queued for malak@example.com
255
- And 2 sms alerts should be queued for +61400000001
198
+ Then 2 email alerts should be queued for lucia@example.com
199
+ And 2 sms alerts should be queued for +61400000004
256
200
  When 1 minute passes
257
201
  And a critical event is received
258
202
  And 1 minute passes
259
203
  And a critical event is received
260
- Then 3 email alerts should be queued for malak@example.com
261
- And 3 sms alerts should be queued for +61400000001
204
+ Then 3 email alerts should be queued for lucia@example.com
205
+ And 3 sms alerts should be queued for +61400000004
262
206
 
263
207
  @intervals @time
264
208
  Scenario: Problem directly after Recovery should alert despite notification intervals with unknown
@@ -267,19 +211,18 @@ Feature: Notification rules on a per contact basis
267
211
  When an unknown event is received
268
212
  And 1 minute passes
269
213
  And an unknown event is received
270
- Then 1 email alert should be queued for malak@example.com
214
+ Then 1 email alert should be queued for imani@example.com
271
215
  When an ok event is received
272
- Then 2 email alert should be queued for malak@example.com
216
+ Then 2 email alert should be queued for imani@example.com
273
217
  When 1 minute passes
274
218
  And an unknown event is received
275
219
  And 1 minute passes
276
220
  And an unknown event is received
277
- Then 3 email alerts should be queued for malak@example.com
278
- And 0 sms alerts should be queued for +61400000001
221
+ Then 3 email alerts should be queued for imani@example.com
279
222
 
280
223
  @time
281
- Scenario: Contact with only entity specific rules should not be notified for other entities they are a contact for
282
- Given the check is check 'ping' on entity 'buf'
224
+ Scenario: Contact without a global rule is not notified for non-matching checks
225
+ Given the check is check 'ping' on entity 'baz'
283
226
  And the check is in an ok state
284
227
  When a critical event is received
285
228
  And 1 minute passes
@@ -287,17 +230,17 @@ Feature: Notification rules on a per contact basis
287
230
  Then no email alerts should be queued for malak@example.com
288
231
 
289
232
  @time
290
- Scenario: Contact with entity specific rules and general rules should be notified for other entities they are a contact for
291
- Given the check is check 'ping' on entity 'buf'
233
+ Scenario: Contact with a global rule should be notified for all events
234
+ Given the check is check 'ping' on entity 'bar'
292
235
  And the check is in an ok state
293
236
  When a critical event is received
294
237
  And 1 minute passes
295
238
  And a critical event is received
296
- Then 1 email alert should be queued for imani@example.com
239
+ Then 1 email alert should be queued for fang@example.com
297
240
 
298
241
  @time
299
- Scenario: Mutiple rules for an entity should be additive
300
- Given the check is check 'ping' on entity 'buf'
242
+ Scenario: Multiple matching 'all_tags' rules should be additive
243
+ Given the check is check 'ping' on entity 'foo'
301
244
  And the check is in an ok state
302
245
  When a critical event is received
303
246
  And 1 minute passes
@@ -306,47 +249,61 @@ Feature: Notification rules on a per contact basis
306
249
  Then 1 sms alert should be queued for +61400000003
307
250
 
308
251
  @time
309
- Scenario: Multiple general rules should be additive
310
- Given the check is check 'ping' on entity 'buf'
252
+ Scenario: Multiple global rules should be additive
253
+ Given the check is check 'ping' on entity 'bar'
254
+ And the check is in an ok state
255
+ When a critical event is received
256
+ And 1 minute passes
257
+ And a critical event is received
258
+ Then 1 email alert should be queued for fang@example.com
259
+ Then 1 sms alert should be queued for +61400000005
260
+
261
+ @time
262
+ Scenario: An 'any_tag' rule should match even if only one tag matches
263
+ Given the check is check 'ssh' on entity 'foo'
311
264
  And the check is in an ok state
312
265
  When a critical event is received
313
266
  And 1 minute passes
314
267
  And a critical event is received
315
- Then 1 email alert should be queued for imani@example.com
316
268
  Then 1 sms alert should be queued for +61400000002
317
269
 
318
270
  @time
319
- Scenario: An entity specific rule should override general rules
320
- Given the check is check 'ping' on entity 'baz'
271
+ Scenario: A 'no_tag' blackhole rule should not match if a tag matches
272
+ Given the check is check 'ping' on entity 'buf'
321
273
  And the check is in an ok state
322
274
  When a critical event is received
323
275
  And 1 minute passes
324
276
  And a critical event is received
325
- Then 0 email alerts should be queued for vera@example.com
326
- Then 1 sms alert should be queued for +61400000003
277
+ Then 1 sms alert should be queued for +61400000006
278
+
279
+ @time
280
+ Scenario: A 'no_tag' blackhole rule should match if no tag matches
281
+ Given the check is check 'ping' on entity 'foo'
282
+ And the check is in an ok state
283
+ When a critical event is received
284
+ And 1 minute passes
285
+ And a critical event is received
286
+ Then no sms alerts should be queued for +61400000006
327
287
 
328
288
  @time
329
289
  Scenario: Test notifications behave like a critical notification
330
- Given the check is check 'ping' on entity 'baz'
290
+ Given the check is check 'ping' on entity 'bar'
331
291
  And the check is in an ok state
332
292
  When a test event is received
333
- Then 1 email alert should be queued for malak@example.com
334
- And 1 sms alert should be queued for +61400000001
293
+ Then 1 email alert should be queued for imani@example.com
294
+
335
295
  @time
336
296
  Scenario: Critical straight after test
337
- Given the check is check 'ping' on entity 'baz'
297
+ Given the check is check 'ping' on entity 'bar'
338
298
  And the check is in an ok state
339
299
  When a test event is received
340
- Then 1 email alert should be queued for malak@example.com
341
- And 1 sms alert should be queued for +61400000001
300
+ Then 1 email alert should be queued for imani@example.com
342
301
  When 10 seconds passes
343
302
  And a critical event is received
344
- Then 1 email alert should be queued for malak@example.com
345
- And 1 sms alert should be queued for +61400000001
303
+ Then 1 email alert should be queued for imani@example.com
346
304
  When 40 seconds passes
347
305
  And a critical event is received
348
- Then 2 email alert should be queued for malak@example.com
349
- And 2 sms alert should be queued for +61400000001
306
+ Then 2 email alert should be queued for imani@example.com
350
307
 
351
308
  @time
352
309
  Scenario: Unknown event during unscheduled maintenance
@@ -355,63 +312,30 @@ Feature: Notification rules on a per contact basis
355
312
  When an unknown event is received
356
313
  And 1 minute passes
357
314
  And an unknown event is received
358
- Then 1 email alert should be queued for malak@example.com
315
+ Then 1 email alert should be queued for imani@example.com
359
316
  When 6 minutes passes
360
317
  And an acknowledgement event is received
361
- Then 2 email alerts should be queued for malak@example.com
318
+ Then 2 email alerts should be queued for imani@example.com
362
319
  When 6 minutes passes
363
320
  And an unknown event is received
364
- Then 2 email alerts should be queued for malak@example.com
321
+ Then 2 email alerts should be queued for imani@example.com
365
322
  When 1 minute passes
366
323
  And an unknown event is received
367
- Then 2 email alerts should be queued for malak@example.com
324
+ Then 2 email alerts should be queued for imani@example.com
368
325
 
369
326
  Scenario: Unknown events alert only specified media
370
- Given the check is check 'ping' on entity 'baz'
327
+ Given the check is check 'ping' on entity 'bar'
371
328
  And the check is in an ok state
372
329
  When an unknown event is received
373
330
  And 1 minute passes
374
331
  And an unknown event is received
375
- Then 0 sms alerts should be queued for +61400000001
376
-
377
- @time
378
- Scenario: A blackhole rule on an entity should override another matching entity specific rule
379
-
380
- @time
381
- Scenario: A blackhole rule on an entity should override another matching general rule
382
-
383
- @time
384
- Scenario: Notify when tags in a rule match the event's tags
385
- Given the check is check 'Disk / Util' on entity 'foo-app-01.xyz'
386
- And the check is in an ok state
387
- When a critical event is received
388
- And 1 minute passes
389
- And a critical event is received
390
- Then 1 sms alert should be queued for +61400000004
391
-
392
- @time
393
- Scenario: Don't notify when tags in a rule don't match the event's tags
394
- Given the check is check 'Memory Util' on entity 'foo-app-01.xyz'
395
- And the check is in an ok state
396
- When a critical event is received
397
- And 1 minute passes
398
- And a critical event is received
399
- Then no sms alerts should be queued for +61400000004
332
+ Then 0 sms alerts should be queued for +61400000002
400
333
 
401
334
  @time
402
- Scenario: Don't notify when tags in a rule don't match, but the entity does match
403
- Given the check is check 'Memory Util' on entity 'foo-app-01.xyz'
404
- And the check is in an ok state
405
- When a critical event is received
406
- And 1 minute passes
407
- And a critical event is received
408
- Then no email alerts should be queued for jive@example.com
409
-
410
- @time
411
- Scenario: Only notify during specified time periods in tag matched rules
335
+ Scenario: Only notify during specified time periods
412
336
  Given the timezone is Europe/Rome
413
337
  And the time is February 1 2013 6:59
414
- And the check is check 'ping' on entity 'foo-app-01.xyz'
338
+ And the check is check 'ping' on entity 'baz'
415
339
  And the check is in an ok state
416
340
  And a critical event is received
417
341
  Then no sms alerts should be queued for +61400000004
@@ -422,37 +346,34 @@ Feature: Notification rules on a per contact basis
422
346
  And a critical event is received
423
347
  Then 1 sms alert should be queued for +61400000004
424
348
  When the time is February 1 2013 12:00
425
- Then all alert dropping keys for user c1 should have expired
426
349
  When a critical event is received
427
350
  Then 2 sms alerts should be queued for +61400000004
428
351
  When the time is February 1 2013 17:59
429
- Then all alert dropping keys for user c1 should have expired
430
352
  When a critical event is received
431
353
  Then 3 sms alerts should be queued for +61400000004
432
354
  When the time is February 1 2013 18:01
433
- Then all alert dropping keys for user c1 should have expired
434
355
  When a critical event is received
435
356
  Then 3 sms alerts should be queued for +61400000004
436
357
 
437
358
  # tests that notifications are sent as acknowledgement clears the notification intervals
438
359
  @time
439
360
  Scenario: an second acknowledgement is created after the first is deleted (gh-308)
440
- Given the check is check 'ping' on entity 'baz'
361
+ Given the check is check 'ping' on entity 'bar'
441
362
  And the check is in an ok state
442
363
  When a critical event is received
443
364
  And 1 minute passes
444
365
  And a critical event is received
445
- Then 1 email alert should be queued for malak@example.com
366
+ Then 1 email alert should be queued for imani@example.com
446
367
  When 1 minute passes
447
368
  And an acknowledgement event is received
448
369
  Then unscheduled maintenance should be generated
449
- And 2 email alerts should be queued for malak@example.com
370
+ And 2 email alerts should be queued for imani@example.com
450
371
  When 1 minute passes
451
372
  And the unscheduled maintenance is ended
452
373
  And 1 minute passes
453
374
  And a critical event is received
454
- Then 3 email alerts should be queued for malak@example.com
375
+ Then 3 email alerts should be queued for imani@example.com
455
376
  When 1 minute passes
456
377
  And an acknowledgement event is received
457
378
  Then unscheduled maintenance should be generated
458
- And 4 email alerts should be queued for malak@example.com
379
+ And 4 email alerts should be queued for imani@example.com