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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d354b23d7d94b5204db458729029fea0b9d2cce10689059b7818cfb42da4101b
4
- data.tar.gz: 0c364c6db65fdf0d1fe462bc91930b6fbfeafc05f7ab152fe3d4584796fd1d57
3
+ metadata.gz: b5952c7eabf30d4dc1b95028cfd9b213f682300692d6309f5e341bd8b84b0e30
4
+ data.tar.gz: c4259d4d165d411e9f2b4f42ace8c25a7189d616e9bc1e8a79fef6c6ba2a7fb9
5
5
  SHA512:
6
- metadata.gz: 21149b9899661a927d688f5db2b71702cecf6ced3998b40d7ed03917487bcaa63c11fe581004959840c319f3b5fc228a7b8ae59f3639bdb67ee77b1d14ff5f12
7
- data.tar.gz: 9e7e174417f5a884acf06f45a03dee86fc23fe95d41cd2df993ca1e4e20fa7e72eaffc754becc0f4452ea2d3a75037dd9d43eb11ea722ed7788d62a06d17a1c3
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
- puts "#{Kennel::Utils.color(color, g[:status])}\t#{g[:name]}"
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 alerting or not silenced
51
- monitors.select! { |m| m[:overall_state] != "OK" && !m[:options][:silenced].key?(:*) }
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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.17.0"
3
+ VERSION = "1.18.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kennel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.0
4
+ version: 1.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser