sensu 1.4.2 → 1.4.3

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
  SHA1:
3
- metadata.gz: 907c67f40080774064579c80c0ec8979aea2fb1b
4
- data.tar.gz: 43d91b3282f863f8c865b0fe464e48d35741bf6f
3
+ metadata.gz: 77726a20c8e3a4cb2f549caa4f33c3c6bfcf4efb
4
+ data.tar.gz: c7fe0e9214ccb27c3b14bfa6aa7f89f7f5d07f1f
5
5
  SHA512:
6
- metadata.gz: f0595fcf9558e827b4c40ff9e0fb53c46da2747b1774b1d112703eb5f5bf64d812b7787c4ea0581c2445b0a09cf8b3b3ea4b821c1a7e388ee29986c750bc3a28
7
- data.tar.gz: 2a628deb496b12e2304391859772cce4b63e4827c1f229b53efd06629baf9f6d40909fc41201e9929fc939070abc616354be543cbbb0b793fb70498c05a58e82
6
+ metadata.gz: ef6330e24403cf0aa3d9b7e5ad9b918197ad3634583c053ffed676948f26737bf4aeda29e902318fa1c37864ca27b11250477900098bc6cf0f2467b6c95ab8e1
7
+ data.tar.gz: da78852eed102c0c250118384e976fad1c0fa64bf729b8c61459550a10a9400633f2ac093a264c56e69f9b31024e28e2260baeba6439ceceaa5ae481ab29a1e8
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -5,6 +5,14 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.4.3] - 2018-07-23
9
+
10
+ ### Fixed
11
+ - Prevent check results from being published with an empty source attribute.
12
+ - Use handler extension definitions when logging rather than handler extension objects.
13
+ - Added validation for ttl attribute in results API.
14
+ - Fixed case where proxy checks with token substitution can retain previous values.
15
+
8
16
  ## [1.4.2] - 2018-05-10
9
17
 
10
18
  ### Fixed
@@ -16,7 +16,8 @@ module Sensu
16
16
  :name => {:type => String, :nil_ok => false, :regex => /\A[\w\.-]+\z/},
17
17
  :output => {:type => String, :nil_ok => false},
18
18
  :status => {:type => Integer, :nil_ok => true},
19
- :source => {:type => String, :nil_ok => true, :regex => /\A[\w\.-]+\z/}
19
+ :source => {:type => String, :nil_ok => true, :regex => /\A[\w\.-]+\z/},
20
+ :ttl => {:type => Integer, :nil_ok => true}
20
21
  }
21
22
  read_data(rules) do |data|
22
23
  publish_check_result("sensu-api", data)
@@ -84,6 +84,7 @@ module Sensu
84
84
  #
85
85
  # @param check [Hash]
86
86
  def publish_check_result(check)
87
+ check.delete(:source) if check[:source] == ""
87
88
  payload = {
88
89
  :client => @settings[:client][:name],
89
90
  :check => check
@@ -1,7 +1,7 @@
1
1
  module Sensu
2
2
  unless defined?(Sensu::VERSION)
3
3
  # Sensu release version.
4
- VERSION = "1.4.2".freeze
4
+ VERSION = "1.4.3".freeze
5
5
 
6
6
  # Sensu release information.
7
7
  RELEASE_INFO = {
@@ -192,7 +192,11 @@ module Sensu
192
192
  # filtered.
193
193
  # @yieldparam event [Hash]
194
194
  def filter_event(handler, event)
195
- details = {:handler => handler, :event => event}
195
+ handler_info = case handler[:type]
196
+ when "extension" then handler.definition
197
+ else handler
198
+ end
199
+ details = {:handler => handler_info, :event => event}
196
200
  filter_message = case
197
201
  when handling_disabled?(event)
198
202
  "event handling disabled for event"
@@ -836,7 +836,7 @@ module Sensu
836
836
  :client => client,
837
837
  :check => check
838
838
  })
839
- proxy_check, unmatched_tokens = object_substitute_tokens(check.dup, client)
839
+ proxy_check, unmatched_tokens = object_substitute_tokens(deep_dup(check.dup), client)
840
840
  if unmatched_tokens.empty?
841
841
  proxy_check[:source] ||= client[:name]
842
842
  publish_check_request(proxy_check)
@@ -51,6 +51,31 @@ module Sensu
51
51
  merged
52
52
  end
53
53
 
54
+ # Creates a deep dup of basic ruby objects with support for walking
55
+ # hashes and arrays.
56
+ #
57
+ # @param obj [Object]
58
+ # @return [obj] a dup of the original object.
59
+ def deep_dup(obj)
60
+ if obj.class == Hash
61
+ new_obj = obj.dup
62
+ new_obj.each do |key, value|
63
+ new_obj[deep_dup(key)] = deep_dup(value)
64
+ end
65
+ new_obj
66
+ elsif obj.class == Array
67
+ arr = []
68
+ obj.each do |item|
69
+ arr << deep_dup(item)
70
+ end
71
+ arr
72
+ elsif obj.class == String
73
+ obj.dup
74
+ else
75
+ obj
76
+ end
77
+ end
78
+
54
79
  # Retrieve the system hostname. If the hostname cannot be
55
80
  # determined and an error is thrown, `nil` will be returned.
56
81
  #
@@ -10,7 +10,6 @@ Gem::Specification.new do |s|
10
10
  s.summary = "A monitoring framework"
11
11
  s.description = "A monitoring framework that aims to be simple, malleable, and scalable."
12
12
  s.license = "MIT"
13
- s.has_rdoc = false
14
13
 
15
14
  s.add_dependency "eventmachine", "1.2.5"
16
15
  s.add_dependency "sensu-json", "2.1.1"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Porter
@@ -31,7 +31,7 @@ cert_chain:
31
31
  jOeGyhtQa9j4FFmsEJDg59f5v/3hECXsa3Xuml3foaFHzX3Ya/YIyd2YFxvkFKIu
32
32
  GVbe7A3YdxzdkH2Es/Ym9twdxXaIDdXzj8sWhw==
33
33
  -----END CERTIFICATE-----
34
- date: 2018-05-10 00:00:00.000000000 Z
34
+ date: 2018-07-23 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: eventmachine
metadata.gz.sig CHANGED
Binary file