sensu 0.20.3-java → 0.20.4-java
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 +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/sensu/api/process.rb +2 -2
- data/lib/sensu/constants.rb +1 -1
- data/lib/sensu/daemon.rb +1 -1
- data/lib/sensu/server/handle.rb +1 -1
- data/lib/sensu/server/process.rb +24 -2
- data/sensu.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34732700241b68d848504a8292bd3b75f6348fdd
|
4
|
+
data.tar.gz: 4541192775dd95f090a1dfe208e1833862cf475d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 654731652717fe1a940ca0e7f24caae822525f0c7923675107fb6c2431016f63a3a91dc3c3293f0fd71064be081e2c39072f50bfbab4685649c3921d7888cd5c
|
7
|
+
data.tar.gz: eae20f46c3de25fc7559226fa8920b1c31b7393e6584b6dd6859c3d9fddfb345e9d5d822ac36d654c593af60649ef4ce606be4835c2dae7d648174e955a37920
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
## 0.20.4 - 2015-08-28
|
2
|
+
|
3
|
+
### Other
|
4
|
+
|
5
|
+
Improved check output truncation. Metric check output is truncated to a
|
6
|
+
single line and 256 characters. Standard check output is not modified.
|
7
|
+
|
8
|
+
Fixed API /results endpoint, now including all results in a single
|
9
|
+
response (unless pagination is used).
|
10
|
+
|
11
|
+
Locked amq-protocol to 1.9.2, as 2.x.x does not work on older Rubies.
|
12
|
+
|
13
|
+
Fixed pipe handler output logging on JRuby.
|
14
|
+
|
1
15
|
## 0.20.3 - 2015-08-11
|
2
16
|
|
3
17
|
### Other
|
data/lib/sensu/api/process.rb
CHANGED
@@ -740,7 +740,7 @@ module Sensu
|
|
740
740
|
unless clients.empty?
|
741
741
|
clients.each_with_index do |client_name, client_index|
|
742
742
|
settings.redis.smembers("result:#{client_name}") do |checks|
|
743
|
-
|
743
|
+
if !checks.empty?
|
744
744
|
checks.each_with_index do |check_name, check_index|
|
745
745
|
result_key = "result:#{client_name}:#{check_name}"
|
746
746
|
settings.redis.get(result_key) do |result_json|
|
@@ -751,7 +751,7 @@ module Sensu
|
|
751
751
|
end
|
752
752
|
end
|
753
753
|
end
|
754
|
-
|
754
|
+
elsif client_index == clients.size - 1
|
755
755
|
body MultiJson.dump(response)
|
756
756
|
end
|
757
757
|
end
|
data/lib/sensu/constants.rb
CHANGED
data/lib/sensu/daemon.rb
CHANGED
data/lib/sensu/server/handle.rb
CHANGED
@@ -34,7 +34,7 @@ module Sensu
|
|
34
34
|
Spawn.process(handler[:command], options) do |output, status|
|
35
35
|
@logger.info("handler output", {
|
36
36
|
:handler => handler,
|
37
|
-
:output => output.
|
37
|
+
:output => output.split("\n+")
|
38
38
|
})
|
39
39
|
@handling_event_count -= 1 if @handling_event_count
|
40
40
|
end
|
data/lib/sensu/server/process.rb
CHANGED
@@ -199,11 +199,33 @@ module Sensu
|
|
199
199
|
end
|
200
200
|
end
|
201
201
|
|
202
|
+
# Truncate check output. For metric checks, (`"type":
|
203
|
+
# "metric"`), check output is truncated to a single line and a
|
204
|
+
# maximum of 255 characters. Check output is currently left
|
205
|
+
# unmodified for standard checks.
|
206
|
+
#
|
207
|
+
# @param check [Hash]
|
208
|
+
# @return [Hash] check with truncated output.
|
209
|
+
def truncate_check_output(check)
|
210
|
+
case check[:type]
|
211
|
+
when "metric"
|
212
|
+
output_lines = check[:output].split("\n")
|
213
|
+
output = output_lines.first
|
214
|
+
if output_lines.size > 1 || output.length > 255
|
215
|
+
output = output[0..255] + "\n..."
|
216
|
+
end
|
217
|
+
check.merge(:output => output)
|
218
|
+
else
|
219
|
+
check
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
202
223
|
# Store check result data. This method stores check result data
|
203
224
|
# and the 21 most recent check result statuses for a client/check
|
204
225
|
# pair, this history is used for event context and flap detection.
|
205
226
|
# The check execution timestamp is also stored, to provide an
|
206
|
-
# indication of how recent the data is.
|
227
|
+
# indication of how recent the data is. Check output is
|
228
|
+
# truncated by `truncate_check_output()` before it is stored.
|
207
229
|
#
|
208
230
|
# @param client [Hash]
|
209
231
|
# @param check [Hash]
|
@@ -213,7 +235,7 @@ module Sensu
|
|
213
235
|
@logger.debug("storing check result", :check => check)
|
214
236
|
@redis.sadd("result:#{client[:name]}", check[:name])
|
215
237
|
result_key = "#{client[:name]}:#{check[:name]}"
|
216
|
-
check_truncated =
|
238
|
+
check_truncated = truncate_check_output(check)
|
217
239
|
@redis.set("result:#{result_key}", MultiJson.dump(check_truncated)) do
|
218
240
|
history_key = "history:#{result_key}"
|
219
241
|
@redis.rpush(history_key, check[:status]) do
|
data/sensu.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_dependency "sensu-settings", "3.1.0"
|
23
23
|
s.add_dependency "sensu-extension", "1.1.2"
|
24
24
|
s.add_dependency "sensu-extensions", "1.2.0"
|
25
|
-
s.add_dependency "sensu-transport", "3.2.
|
25
|
+
s.add_dependency "sensu-transport", "3.2.1"
|
26
26
|
s.add_dependency "sensu-spawn", "1.3.0"
|
27
27
|
s.add_dependency "em-redis-unified", "1.0.0"
|
28
28
|
s.add_dependency "sinatra", "1.4.6"
|
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: 0.20.
|
4
|
+
version: 0.20.4
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Sean Porter
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-08-
|
12
|
+
date: 2015-08-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -129,12 +129,12 @@ dependencies:
|
|
129
129
|
requirements:
|
130
130
|
- - '='
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: 3.2.
|
132
|
+
version: 3.2.1
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
135
|
- - '='
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version: 3.2.
|
137
|
+
version: 3.2.1
|
138
138
|
prerelease: false
|
139
139
|
type: :runtime
|
140
140
|
- !ruby/object:Gem::Dependency
|