kennel 1.132.0 → 1.133.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/models/monitor.rb +12 -3
- 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: d3aff9df6291b4831989719092533b91416db67398fbd2f8b43d694ce2a758c6
|
4
|
+
data.tar.gz: 316279b5d6059c65281322e8d0dae8caeac665a48bba70c377c218febfd76fb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
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.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
|
11
|
+
date: 2023-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diff-lcs
|