kennel 1.21.1 → 1.22.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8090eb6362c9cddbd3510dc79a6af5e40baeedde0ef9691d0403b7a0336f371d
4
- data.tar.gz: 61911837385e040944b75c3d7d9d734d880f8e1b62bee15be7c6862ee321f8e8
3
+ metadata.gz: 99fe288f8c067c9b928cad757037bb771a7eb6da1c80e135fd5ebd64aa9df418
4
+ data.tar.gz: dd92d7dcf71f2ae12a5205dc91b2d0fd1672ea3b5faa9a55813c2555cc0324df
5
5
  SHA512:
6
- metadata.gz: beeb87558d2dac74212feb9f9e17ea1f6c4d6b14ea985ef9edb152e4a6a6ea464b0170801ae7332104304c79a07cbb76bc655399d06b2bf16dd0fe5136c8016d
7
- data.tar.gz: a5a1ab6f8fe0a3ebcce5551756bb29281076df25f1a2832a334924755d505e37188bfead6c0b2fbea7b3e909fffbe38ddf222e579939eba779e81259360b4919
6
+ metadata.gz: fb9091c738a012f8328f9094a13af3a78d33cc00a8884edd04705169796dc081dad80fd7ab088427235f03aadb27035ae8a47fe8c3b2d18356b1ea03d4c80346
7
+ data.tar.gz: cf8facf8bfed794a4f452959463cc2537056221993c19b261a4154d5a928e97770cac6a6161c9be2d6f9f0f2e08d8989a1b56e347df9c958a17f26febd9a1806
@@ -46,7 +46,7 @@ module Kennel
46
46
  def filtered_monitors(api, tag)
47
47
  # Download all monitors with given tag
48
48
  monitors = Progress.progress("Downloading") do
49
- api.list("monitor", monitor_tags: tag, group_states: "all")
49
+ api.list("monitor", monitor_tags: tag, group_states: "all", with_downtimes: "true")
50
50
  end
51
51
 
52
52
  raise "No monitors for #{tag} found, check your spelling" if monitors.empty?
@@ -66,6 +66,15 @@ module Kennel
66
66
  end
67
67
  end
68
68
 
69
+ # only keep monitors that are not covered by a downtime
70
+ monitors.each do |m|
71
+ next unless m[:matching_downtimes]
72
+ downtime_groups = m[:matching_downtimes].select { |d| d[:active] }.flat_map { |d| d[:groups] }
73
+ m[:state][:groups].reject! do |k, _|
74
+ downtime_groups.include?(k.to_s)
75
+ end
76
+ end
77
+
69
78
  # only keep monitors with alerting groups
70
79
  monitors.select! { |m| m[:state][:groups].any? }
71
80
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.21.1"
3
+ VERSION = "1.22.0"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kennel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.21.1
4
+ version: 1.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-06 00:00:00.000000000 Z
11
+ date: 2018-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday