kennel 1.132.0 → 1.133.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: 3d0c423b6658afcd8aa09a7e80169f85312540c03aad0bc8c3543e76c5a9420b
4
- data.tar.gz: 71ab44e7dc1ed76114f6a3aadfd70d79d905d673d0090f85f96e40e6c8967620
3
+ metadata.gz: d3aff9df6291b4831989719092533b91416db67398fbd2f8b43d694ce2a758c6
4
+ data.tar.gz: 316279b5d6059c65281322e8d0dae8caeac665a48bba70c377c218febfd76fb9
5
5
  SHA512:
6
- metadata.gz: a4b6217e61f1282dd003bd2feea590b92f7dd8ddd2c7e9efc693ee58d0735baad7ea69d260ad376e581a7ff4b6364c51ddd2d42defd978928326183e5c8c5de3
7
- data.tar.gz: ed60a47513aa4db4e1a1082cee541dbf9a1b345a512a058810eb4ad8763cc0505d3158b91f5b9df97e33a788cde84511fa0ad8b4de19aa14ca907f6944de8a2b
6
+ metadata.gz: f54f29018a039ee2b5d8bf4bfb05b371af4551c102a0f349463faa6a380873b387d5f8229460bb6b991d30a21cd2cdbb14765c43400e983bc74d13822467d7bf
7
+ data.tar.gz: c893a9caa3a122f454cf7f654c4583df3397c985fa230f06ff9fcdaec07fb90b89be43a363eb5911483aad6bf9699971ea0664dcc0e4758fb61e833bce587008
@@ -22,7 +22,8 @@ module Kennel
22
22
  notify_audit: false,
23
23
  no_data_timeframe: nil, # this works out ok since if notify_no_data is on, it would never be nil
24
24
  groupby_simple_monitor: false,
25
- variables: nil
25
+ variables: nil,
26
+ on_missing_data: "default"
26
27
  }.freeze
27
28
  DEFAULT_ESCALATION_MESSAGE = ["", nil].freeze
28
29
  ALLOWED_PRIORITY_CLASSES = [NilClass, Integer].freeze
@@ -31,7 +32,7 @@ module Kennel
31
32
  settings(
32
33
  :query, :name, :message, :escalation_message, :critical, :type, :renotify_interval, :warning, :timeout_h, :evaluation_delay,
33
34
  :ok, :no_data_timeframe, :notify_no_data, :notify_audit, :tags, :critical_recovery, :warning_recovery, :require_full_window,
34
- :threshold_windows, :new_host_delay, :new_group_delay, :priority, :validate_using_links, :variables
35
+ :threshold_windows, :new_host_delay, :new_group_delay, :priority, :validate_using_links, :variables, :on_missing_data
35
36
  )
36
37
 
37
38
  defaults(
@@ -52,7 +53,8 @@ module Kennel
52
53
  warning_recovery: -> { nil },
53
54
  threshold_windows: -> { nil },
54
55
  priority: -> { MONITOR_DEFAULTS.fetch(:priority) },
55
- variables: -> { MONITOR_OPTION_DEFAULTS.fetch(:variables) }
56
+ variables: -> { MONITOR_OPTION_DEFAULTS.fetch(:variables) },
57
+ on_missing_data: -> { notify_no_data ? "show_and_notify_no_data" : "default" } # "default" is "evaluate as zero"
56
58
  )
57
59
 
58
60
  def build_json
@@ -123,6 +125,13 @@ module Kennel
123
125
  options[:renotify_statuses] = statuses
124
126
  end
125
127
 
128
+ # for events: on_missing_data cannot be used with notify_no_data or no_data_timeframe
129
+ if data.fetch(:type) == "event-v2 alert"
130
+ options[:on_missing_data] = on_missing_data
131
+ options[:notify_no_data] = false # cannot set nil or it's an endless update loop
132
+ options.delete :no_data_timeframe
133
+ end
134
+
126
135
  data
127
136
  end
128
137
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.132.0"
3
+ VERSION = "1.133.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.132.0
4
+ version: 1.133.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: 2023-01-26 00:00:00.000000000 Z
11
+ date: 2023-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs