kennel 1.132.0 → 1.133.1

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: 3d0c423b6658afcd8aa09a7e80169f85312540c03aad0bc8c3543e76c5a9420b
4
- data.tar.gz: 71ab44e7dc1ed76114f6a3aadfd70d79d905d673d0090f85f96e40e6c8967620
3
+ metadata.gz: 6ebfb755b091be3c3c59e5363f7b302b3c69a67a13ec9a768c76bc68ca09ec65
4
+ data.tar.gz: ca416980653d8b8965d72693506c246dbce2c03f5937f0beedc246df194f7617
5
5
  SHA512:
6
- metadata.gz: a4b6217e61f1282dd003bd2feea590b92f7dd8ddd2c7e9efc693ee58d0735baad7ea69d260ad376e581a7ff4b6364c51ddd2d42defd978928326183e5c8c5de3
7
- data.tar.gz: ed60a47513aa4db4e1a1082cee541dbf9a1b345a512a058810eb4ad8763cc0505d3158b91f5b9df97e33a788cde84511fa0ad8b4de19aa14ca907f6944de8a2b
6
+ metadata.gz: f4e96b9bdc91ea48b644333b5c5b5c0d774d9c2f47da73b322dd51406358f7435ec4794f52ffb0cd93eb01131b78a306b1fd301c33f3069c96c24729afc07290
7
+ data.tar.gz: e7415a9706cb1803ffbef5eb46e45f8acb19c0f17d1f47a168f041886154d1f39d6fd122be072c0ee28bdc07a08061fd3e7582f2d9931349970adff5d268bbb8
@@ -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" # "default" is "evaluate as zero"
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: -> { MONITOR_OPTION_DEFAULTS.fetch(:on_missing_data) }
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.1"
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.1
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-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs