sensu 0.28.2 → 0.28.3
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 +8 -0
- data/lib/sensu/client/process.rb +19 -7
- data/lib/sensu/constants.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9121ba275faec01ad227bfe360ecf35f98bb8136
|
|
4
|
+
data.tar.gz: a9bd2e508a8f271456775a4061ed9ba4e016880c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f8493131b507781309e4c769d2e3f9273a1bbe97fc6d5bb82d140b44cd4058ea9edf182ec57c955a0156d3a99cc42ddebfc0089c7e2b20813d9505d062b855f8
|
|
7
|
+
data.tar.gz: a2aa66bc4afe3abcbbe5f378712bd6854784086d5b79865020f85d58a7a652ef4a1c6fe993fe15011eba43e03d8b8af71d90276311aa1043f810b21bfdd1a306
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 0.28.3 - 2017-03-09
|
|
2
|
+
|
|
3
|
+
### Fixes
|
|
4
|
+
|
|
5
|
+
The Sensu client now includes check source when tracking in progress check
|
|
6
|
+
executions. These changes are necessary to allow the Sensu client to
|
|
7
|
+
execute on several concurrent proxy check requests.
|
|
8
|
+
|
|
1
9
|
## 0.28.2 - 2017-03-03
|
|
2
10
|
|
|
3
11
|
### Fixes
|
data/lib/sensu/client/process.rb
CHANGED
|
@@ -100,6 +100,16 @@ module Sensu
|
|
|
100
100
|
end
|
|
101
101
|
end
|
|
102
102
|
|
|
103
|
+
# Create an in progress key for a check, used to determine if an
|
|
104
|
+
# execution is still in progress. The key is composed of check
|
|
105
|
+
# `source` (if set) and `name`, joined by a colon.
|
|
106
|
+
#
|
|
107
|
+
# @param check [Hash]
|
|
108
|
+
# @return [String]
|
|
109
|
+
def check_in_progress_key(check)
|
|
110
|
+
[check[:source], check[:name]].compact.join(":")
|
|
111
|
+
end
|
|
112
|
+
|
|
103
113
|
# Execute a check command, capturing its output (STDOUT/ERR),
|
|
104
114
|
# exit status code, execution duration, timestamp, and publish
|
|
105
115
|
# the result. This method guards against multiple executions for
|
|
@@ -115,8 +125,9 @@ module Sensu
|
|
|
115
125
|
# @param check [Hash]
|
|
116
126
|
def execute_check_command(check)
|
|
117
127
|
@logger.debug("attempting to execute check command", :check => check)
|
|
118
|
-
|
|
119
|
-
|
|
128
|
+
in_progress_key = check_in_progress_key(check)
|
|
129
|
+
unless @checks_in_progress.include?(in_progress_key)
|
|
130
|
+
@checks_in_progress << in_progress_key
|
|
120
131
|
substituted, unmatched_tokens = object_substitute_tokens(check.dup, @settings[:client])
|
|
121
132
|
check = substituted.merge(:command => check[:command])
|
|
122
133
|
started = Time.now.to_f
|
|
@@ -127,14 +138,14 @@ module Sensu
|
|
|
127
138
|
check[:output] = output
|
|
128
139
|
check[:status] = status
|
|
129
140
|
publish_check_result(check)
|
|
130
|
-
@checks_in_progress.delete(
|
|
141
|
+
@checks_in_progress.delete(in_progress_key)
|
|
131
142
|
end
|
|
132
143
|
else
|
|
133
144
|
check[:output] = "Unmatched client token(s): " + unmatched_tokens.join(", ")
|
|
134
145
|
check[:status] = 3
|
|
135
146
|
check[:handle] = false
|
|
136
147
|
publish_check_result(check)
|
|
137
|
-
@checks_in_progress.delete(
|
|
148
|
+
@checks_in_progress.delete(in_progress_key)
|
|
138
149
|
end
|
|
139
150
|
else
|
|
140
151
|
@logger.warn("previous check command execution in progress", :check => check)
|
|
@@ -156,8 +167,9 @@ module Sensu
|
|
|
156
167
|
# @param check [Hash]
|
|
157
168
|
def run_check_extension(check)
|
|
158
169
|
@logger.debug("attempting to run check extension", :check => check)
|
|
159
|
-
|
|
160
|
-
|
|
170
|
+
in_progress_key = check_in_progress_key(check)
|
|
171
|
+
unless @checks_in_progress.include?(in_progress_key)
|
|
172
|
+
@checks_in_progress << in_progress_key
|
|
161
173
|
started = Time.now.to_f
|
|
162
174
|
check[:executed] = started.to_i
|
|
163
175
|
extension_name = check[:extension] || check[:name]
|
|
@@ -167,7 +179,7 @@ module Sensu
|
|
|
167
179
|
check[:output] = output
|
|
168
180
|
check[:status] = status
|
|
169
181
|
publish_check_result(check)
|
|
170
|
-
@checks_in_progress.delete(
|
|
182
|
+
@checks_in_progress.delete(in_progress_key)
|
|
171
183
|
end
|
|
172
184
|
else
|
|
173
185
|
@logger.warn("previous check extension execution in progress", :check => check)
|
data/lib/sensu/constants.rb
CHANGED
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.28.
|
|
4
|
+
version: 0.28.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sean Porter
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2017-03-
|
|
12
|
+
date: 2017-03-09 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: eventmachine
|
|
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
298
298
|
version: '0'
|
|
299
299
|
requirements: []
|
|
300
300
|
rubyforge_project:
|
|
301
|
-
rubygems_version: 2.6.
|
|
301
|
+
rubygems_version: 2.6.3
|
|
302
302
|
signing_key:
|
|
303
303
|
specification_version: 4
|
|
304
304
|
summary: A monitoring framework
|