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 +4 -4
- data/lib/kennel/unmuted_alerts.rb +10 -1
- data/lib/kennel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99fe288f8c067c9b928cad757037bb771a7eb6da1c80e135fd5ebd64aa9df418
|
4
|
+
data.tar.gz: dd92d7dcf71f2ae12a5205dc91b2d0fd1672ea3b5faa9a55813c2555cc0324df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/kennel/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2018-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|