kennel 1.17.0 → 1.18.0
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/lib/kennel/unmuted_alerts.rb +9 -3
- data/lib/kennel/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5952c7eabf30d4dc1b95028cfd9b213f682300692d6309f5e341bd8b84b0e30
|
4
|
+
data.tar.gz: c4259d4d165d411e9f2b4f42ace8c25a7189d616e9bc1e8a79fef6c6ba2a7fb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5f3312421018e6321d5197939f0fc2479dbebeacdd00793bcc67ff4c88ed23e7bf08a068ba7b5cd4155df74134108ebc9317ee8d6f9006fd183dc70f2c3aeca
|
7
|
+
data.tar.gz: fb556c8a290c9f4322226dfd2a2bfa34a75e3067994b9ed3e4f98270a761bf3a391ac00b838686ae423c7f8164568d6d82a90a4234a8bbee953e21613f2e613c
|
@@ -21,7 +21,8 @@ module Kennel
|
|
21
21
|
puts Utils.path_to_url("/monitors/#{m[:id]}")
|
22
22
|
m[:state][:groups].each do |g|
|
23
23
|
color = COLORS[g[:status]] || :default
|
24
|
-
|
24
|
+
since = "\t#{time_since(g[:last_triggered_ts])}"
|
25
|
+
puts "#{Kennel::Utils.color(color, g[:status])}\t#{g[:name]}#{since}"
|
25
26
|
end
|
26
27
|
puts
|
27
28
|
end
|
@@ -37,6 +38,11 @@ module Kennel
|
|
37
38
|
monitor[:state][:groups] = groups
|
38
39
|
end
|
39
40
|
|
41
|
+
def time_since(t)
|
42
|
+
diff = Time.now.to_i - Integer(t)
|
43
|
+
"%02d:%02d:%02d" % [diff / 3600, diff / 60 % 60, diff % 60]
|
44
|
+
end
|
45
|
+
|
40
46
|
def filtered_monitors(api, tag)
|
41
47
|
# Download all monitors
|
42
48
|
monitors = Progress.progress("Downloading") do
|
@@ -47,8 +53,8 @@ module Kennel
|
|
47
53
|
monitors.select! { |m| m[:tags].include? tag }
|
48
54
|
raise "No monitors for #{tag} found, check your spelling" if monitors.empty?
|
49
55
|
|
50
|
-
# only keep monitors that are
|
51
|
-
monitors.
|
56
|
+
# only keep monitors that are not completely silenced
|
57
|
+
monitors.reject! { |m| m[:options][:silenced].key?(:*) }
|
52
58
|
|
53
59
|
# get state details to romove silenced alerts
|
54
60
|
Progress.progress("Getting monitor details") do
|
data/lib/kennel/version.rb
CHANGED