sensu 1.8.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +11 -0
- data/README.md +4 -3
- data/lib/sensu/api/http_handler.rb +1 -0
- data/lib/sensu/constants.rb +1 -1
- data/lib/sensu/daemon.rb +1 -1
- data/lib/sensu/server/process.rb +48 -17
- data/lib/sensu/utilities.rb +3 -2
- data/sensu.gemspec +1 -1
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50aff68890750e1f00216055fb07a1ce9fc42d1a
|
4
|
+
data.tar.gz: 9414ba01d9e17fed244df0c41643113d87c9f9a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3cd5096f3c1a88b07d3a84a95851abc37a3f6c8949dc517692dd2b7783e66fdeb2aae5b83f2a99d328bfe4fcd6f2073ff837890a0ab78ccdc4bd9078a2d88a0
|
7
|
+
data.tar.gz: 6fe20dfb75829f00412dd51f244e5e8955dd7d37475d70a35d6fd49cd4aea77f54156bcf0fc82cd22d3695f1f23034f370a0651278fd20986d2f1a1487582161
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,17 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [1.9.0] - 2019-12-18
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
- Fixed check subdue times resolution, now including nanoseconds.
|
12
|
+
- API 204 no content responses now return a nil body.
|
13
|
+
- Fixed Travis CI testing (RabbitMQ was missing on Xenial).
|
14
|
+
|
15
|
+
### Added
|
16
|
+
- Added support for discarding oversized transport messages to protect
|
17
|
+
Sensu, e.g. {"sensu":{"server": {"max_message_size": 2097152}}}.
|
18
|
+
|
8
19
|
## [1.8.0] - 2019-07-09
|
9
20
|
|
10
21
|
### Added
|
data/README.md
CHANGED
@@ -5,13 +5,14 @@
|
|
5
5
|
[![MIT Licensed](https://img.shields.io/github/license/sensu/sensu.svg)](https://raw.githubusercontent.com/sensu/sensu/master/MIT-LICENSE.txt)
|
6
6
|
[![Join the chat at https://slack.sensu.io/](https://slack.sensu.io/badge.svg)](https://slack.sensu.io/)
|
7
7
|
|
8
|
-
**
|
8
|
+
:warning: **ANNOUNCEMENT - Sensu 1.x End-Of-Life on December 31st, 2019**
|
9
9
|
|
10
10
|
Sensu 1.x is currently in maintenance mode (critical bugs and security
|
11
11
|
patch releases only) with no new feature enhancements or additions
|
12
12
|
being planned at this time. The project will be end-of-life on
|
13
|
-
December 31st, 2019
|
14
|
-
|
13
|
+
December 31st, 2019 and existing package repositories will become
|
14
|
+
unreachable on January 6th, 2020. Please see our blog post for more details:
|
15
|
+
https://blog.sensu.io/announcing-the-sensu-archives
|
15
16
|
|
16
17
|
Sensu 1.x has been superseded by [Sensu Go](https://github.com/sensu/sensu-go).
|
17
18
|
|
data/lib/sensu/constants.rb
CHANGED
data/lib/sensu/daemon.rb
CHANGED
data/lib/sensu/server/process.rb
CHANGED
@@ -175,6 +175,33 @@ module Sensu
|
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
178
|
+
# Determine if a transport message is under the optional
|
179
|
+
# configured max message size. This method helps prevent
|
180
|
+
# oversized messages from consuming memory and being persisted
|
181
|
+
# to the datastore.
|
182
|
+
#
|
183
|
+
# @param message [String]
|
184
|
+
# @return [TrueClass,FalseClass]
|
185
|
+
def message_size_ok?(message)
|
186
|
+
if @settings[:sensu][:server] &&
|
187
|
+
@settings[:sensu][:server][:max_message_size]
|
188
|
+
message_size = message.bytesize
|
189
|
+
max_message_size = @settings[:sensu][:server][:max_message_size]
|
190
|
+
if message_size <= max_message_size
|
191
|
+
true
|
192
|
+
else
|
193
|
+
@logger.error("message exceeds the configured max message size", {
|
194
|
+
:max_message_size => max_message_size,
|
195
|
+
:message_size => message_size,
|
196
|
+
:message => message
|
197
|
+
})
|
198
|
+
false
|
199
|
+
end
|
200
|
+
else
|
201
|
+
true
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
178
205
|
# Set up the client keepalive consumer, keeping the Sensu client
|
179
206
|
# registry updated. The consumer receives JSON serialized client
|
180
207
|
# keepalives from the transport, parses them, and calls
|
@@ -190,14 +217,16 @@ module Sensu
|
|
190
217
|
@logger.debug("subscribing to keepalives", :pipe => keepalives_pipe)
|
191
218
|
@transport.subscribe(:direct, keepalives_pipe, "keepalives", :ack => true) do |message_info, message|
|
192
219
|
@logger.debug("received keepalive", :message => message)
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
220
|
+
if message_size_ok?(message)
|
221
|
+
begin
|
222
|
+
client = Sensu::JSON.load(message)
|
223
|
+
update_client_registry(client)
|
224
|
+
rescue Sensu::JSON::ParseError => error
|
225
|
+
@logger.error("failed to parse keepalive payload", {
|
226
|
+
:message => message,
|
227
|
+
:error => error.to_s
|
228
|
+
})
|
229
|
+
end
|
201
230
|
end
|
202
231
|
EM::next_tick do
|
203
232
|
@transport.ack(message_info)
|
@@ -742,15 +771,17 @@ module Sensu
|
|
742
771
|
end
|
743
772
|
@logger.debug("subscribing to results", :pipe => results_pipe)
|
744
773
|
@transport.subscribe(:direct, results_pipe, "results", :ack => true) do |message_info, message|
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
774
|
+
if message_size_ok?(message)
|
775
|
+
begin
|
776
|
+
result = Sensu::JSON.load(message)
|
777
|
+
@logger.debug("received result", :result => result)
|
778
|
+
process_check_result(result)
|
779
|
+
rescue Sensu::JSON::ParseError => error
|
780
|
+
@logger.error("failed to parse result payload", {
|
781
|
+
:message => message,
|
782
|
+
:error => error.to_s
|
783
|
+
})
|
784
|
+
end
|
754
785
|
end
|
755
786
|
EM::next_tick do
|
756
787
|
@transport.ack(message_info)
|
data/lib/sensu/utilities.rb
CHANGED
@@ -8,6 +8,7 @@ require "socket"
|
|
8
8
|
module Sensu
|
9
9
|
module Utilities
|
10
10
|
EVAL_PREFIX = "eval:".freeze
|
11
|
+
NANOSECOND_RESOLUTION = 9.freeze
|
11
12
|
|
12
13
|
# Determine if Sensu is being tested, using the process name.
|
13
14
|
# Sensu is being test if the process name is "rspec",
|
@@ -334,9 +335,9 @@ module Sensu
|
|
334
335
|
end_time = Time.parse(condition[:end])
|
335
336
|
if end_time < begin_time
|
336
337
|
if Time.now < end_time
|
337
|
-
begin_time = Time.
|
338
|
+
begin_time = Time.parse(*begin_time.strftime("%Y-%m-%d 00:00:00.#{Array.new(NANOSECOND_RESOLUTION, 0).join} %:z"))
|
338
339
|
else
|
339
|
-
end_time = Time.
|
340
|
+
end_time = Time.parse(*end_time.strftime("%Y-%m-%d 23:59:59.#{Array.new(NANOSECOND_RESOLUTION, 9).join} %:z"))
|
340
341
|
end
|
341
342
|
end
|
342
343
|
Time.now >= begin_time && Time.now <= end_time
|
data/sensu.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.add_dependency "eventmachine", "1.2.7"
|
15
15
|
s.add_dependency "sensu-json", "2.1.1"
|
16
16
|
s.add_dependency "sensu-logger", "1.2.2"
|
17
|
-
s.add_dependency "sensu-settings", "10.
|
17
|
+
s.add_dependency "sensu-settings", "10.17.0"
|
18
18
|
s.add_dependency "sensu-extension", "1.5.2"
|
19
19
|
s.add_dependency "sensu-extensions", "1.11.0"
|
20
20
|
s.add_dependency "sensu-transport", "8.3.0"
|
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
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Porter
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
X5jpMGFeJITiueL7BQsPY5HHiTjshkT/ltr+YQnQd3g3jR8+AoCIUylCFdJNy2CZ
|
31
31
|
oPVvM0H5TyjtwccVj04b6tZoRho=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2019-
|
33
|
+
date: 2019-12-19 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: eventmachine
|
@@ -80,14 +80,14 @@ dependencies:
|
|
80
80
|
requirements:
|
81
81
|
- - '='
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: 10.
|
83
|
+
version: 10.17.0
|
84
84
|
type: :runtime
|
85
85
|
prerelease: false
|
86
86
|
version_requirements: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - '='
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: 10.
|
90
|
+
version: 10.17.0
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: sensu-extension
|
93
93
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|