sensu 0.18.0-java → 0.18.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +1 -1
- data/lib/sensu/api/process.rb +15 -15
- data/lib/sensu/client/socket.rb +7 -0
- data/lib/sensu/constants.rb +1 -1
- data/sensu.gemspec +3 -3
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6d7a448d0424a899fd3c8d28524ba0069e484b9
|
4
|
+
data.tar.gz: c8d96c4c8a55343dcb0e0b3064fd64f7a3ef0ca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af8ea8a7099f459e078968ac86beec8e2554552086fef9578c4b37ab17ee735595f0170d8c88474c6c734f730dd42adc88d39ea1a96a052fd446360fca805f6a
|
7
|
+
data.tar.gz: e3c0bb292415d73d7a06698e3557cec3b455e92b537e18ea5e1acca2ee7bdd2269fd67a2731c23b3e0efb79d7607fb8c1361b4f753191490b470f5acfc5d5360
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
## 0.18.1 - 2015-05-11
|
2
|
+
|
3
|
+
### Other
|
4
|
+
|
5
|
+
Check results written to the Sensu client socket(s) now have a default
|
6
|
+
executed timestamp, equal to the current Unix/epoch time.
|
7
|
+
|
8
|
+
Check source is now validated for check results written to the Sensu
|
9
|
+
client socket(s), using the same regular expression as the configuration
|
10
|
+
attribute validator.
|
11
|
+
|
12
|
+
The latest versions of Ruby Sinatra and Async Sinatra are now used,
|
13
|
+
which include many improvements and bug fixes.
|
14
|
+
|
15
|
+
Added a caret to the beginning of API routes/endpoints that use regular
|
16
|
+
expressions, fixing a bug that caused the wrong route/endpoint to be
|
17
|
+
called, e.g. `/clients/client`.
|
18
|
+
|
1
19
|
## 0.18.0 - 2015-05-05
|
2
20
|
|
3
21
|
### Features
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@ A monitoring framework that aims to be simple, malleable, and scalable.
|
|
5
5
|
[![Build Status](https://secure.travis-ci.org/sensu/sensu.png)](https://travis-ci.org/sensu/sensu)
|
6
6
|
|
7
7
|
## Documentation
|
8
|
-
Please refer to the [Sensu Docs](http://
|
8
|
+
Please refer to the [Sensu Docs](http://sensuapp.org/docs/latest/overview).
|
9
9
|
|
10
10
|
## License
|
11
11
|
Sensu is released under the [MIT license](https://raw.github.com/sensu/sensu/master/MIT-LICENSE.txt).
|
data/lib/sensu/api/process.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "sensu/daemon"
|
2
2
|
|
3
|
-
gem "sinatra", "1.
|
4
|
-
gem "async_sinatra", "1.
|
3
|
+
gem "sinatra", "1.4.6"
|
4
|
+
gem "async_sinatra", "1.2.0"
|
5
5
|
|
6
6
|
unless RUBY_PLATFORM =~ /java/
|
7
7
|
gem "thin", "1.5.0"
|
@@ -345,7 +345,7 @@ module Sensu
|
|
345
345
|
end
|
346
346
|
end
|
347
347
|
|
348
|
-
aget %r{
|
348
|
+
aget %r{^/clients?/([\w\.-]+)/?$} do |client_name|
|
349
349
|
settings.redis.get("client:#{client_name}") do |client_json|
|
350
350
|
unless client_json.nil?
|
351
351
|
body client_json
|
@@ -355,7 +355,7 @@ module Sensu
|
|
355
355
|
end
|
356
356
|
end
|
357
357
|
|
358
|
-
aget %r{
|
358
|
+
aget %r{^/clients/([\w\.-]+)/history/?$} do |client_name|
|
359
359
|
response = Array.new
|
360
360
|
settings.redis.smembers("result:#{client_name}") do |checks|
|
361
361
|
unless checks.empty?
|
@@ -391,7 +391,7 @@ module Sensu
|
|
391
391
|
end
|
392
392
|
end
|
393
393
|
|
394
|
-
adelete %r{
|
394
|
+
adelete %r{^/clients?/([\w\.-]+)/?$} do |client_name|
|
395
395
|
settings.redis.get("client:#{client_name}") do |client_json|
|
396
396
|
unless client_json.nil?
|
397
397
|
settings.redis.hgetall("events:#{client_name}") do |events|
|
@@ -426,7 +426,7 @@ module Sensu
|
|
426
426
|
body MultiJson.dump(settings.all_checks)
|
427
427
|
end
|
428
428
|
|
429
|
-
aget %r{
|
429
|
+
aget %r{^/checks?/([\w\.-]+)/?$} do |check_name|
|
430
430
|
if settings.checks[check_name]
|
431
431
|
response = settings.checks[check_name].merge(:name => check_name)
|
432
432
|
body MultiJson.dump(response)
|
@@ -491,7 +491,7 @@ module Sensu
|
|
491
491
|
end
|
492
492
|
end
|
493
493
|
|
494
|
-
aget %r{
|
494
|
+
aget %r{^/events/([\w\.-]+)/?$} do |client_name|
|
495
495
|
response = Array.new
|
496
496
|
settings.redis.hgetall("events:#{client_name}") do |events|
|
497
497
|
events.each do |check_name, event_json|
|
@@ -501,7 +501,7 @@ module Sensu
|
|
501
501
|
end
|
502
502
|
end
|
503
503
|
|
504
|
-
aget %r{
|
504
|
+
aget %r{^/events?/([\w\.-]+)/([\w\.-]+)/?$} do |client_name, check_name|
|
505
505
|
settings.redis.hgetall("events:#{client_name}") do |events|
|
506
506
|
event_json = events[check_name]
|
507
507
|
unless event_json.nil?
|
@@ -512,7 +512,7 @@ module Sensu
|
|
512
512
|
end
|
513
513
|
end
|
514
514
|
|
515
|
-
adelete %r{
|
515
|
+
adelete %r{^/events?/([\w\.-]+)/([\w\.-]+)/?$} do |client_name, check_name|
|
516
516
|
settings.redis.hgetall("events:#{client_name}") do |events|
|
517
517
|
if events.include?(check_name)
|
518
518
|
resolve_event(events[check_name])
|
@@ -566,7 +566,7 @@ module Sensu
|
|
566
566
|
end
|
567
567
|
end
|
568
568
|
|
569
|
-
aget %r{
|
569
|
+
aget %r{^/aggregates/([\w\.-]+)/?$} do |check_name|
|
570
570
|
settings.redis.smembers("aggregates:#{check_name}") do |aggregates|
|
571
571
|
unless aggregates.empty?
|
572
572
|
aggregates.reverse!
|
@@ -587,7 +587,7 @@ module Sensu
|
|
587
587
|
end
|
588
588
|
end
|
589
589
|
|
590
|
-
adelete %r{
|
590
|
+
adelete %r{^/aggregates/([\w\.-]+)/?$} do |check_name|
|
591
591
|
settings.redis.smembers("aggregates:#{check_name}") do |aggregates|
|
592
592
|
unless aggregates.empty?
|
593
593
|
aggregates.each do |check_issued|
|
@@ -606,7 +606,7 @@ module Sensu
|
|
606
606
|
end
|
607
607
|
end
|
608
608
|
|
609
|
-
aget %r{
|
609
|
+
aget %r{^/aggregates?/([\w\.-]+)/([\w\.-]+)/?$} do |check_name, check_issued|
|
610
610
|
result_set = "#{check_name}:#{check_issued}"
|
611
611
|
settings.redis.hgetall("aggregate:#{result_set}") do |aggregate|
|
612
612
|
unless aggregate.empty?
|
@@ -640,7 +640,7 @@ module Sensu
|
|
640
640
|
end
|
641
641
|
end
|
642
642
|
|
643
|
-
apost %r{
|
643
|
+
apost %r{^/stash(?:es)?/(.*)/?} do |path|
|
644
644
|
read_data do |data|
|
645
645
|
settings.redis.set("stash:#{path}", MultiJson.dump(data)) do
|
646
646
|
settings.redis.sadd("stashes", path) do
|
@@ -650,7 +650,7 @@ module Sensu
|
|
650
650
|
end
|
651
651
|
end
|
652
652
|
|
653
|
-
aget %r{
|
653
|
+
aget %r{^/stash(?:es)?/(.*)/?} do |path|
|
654
654
|
settings.redis.get("stash:#{path}") do |stash_json|
|
655
655
|
unless stash_json.nil?
|
656
656
|
body stash_json
|
@@ -660,7 +660,7 @@ module Sensu
|
|
660
660
|
end
|
661
661
|
end
|
662
662
|
|
663
|
-
adelete %r{
|
663
|
+
adelete %r{^/stash(?:es)?/(.*)/?} do |path|
|
664
664
|
settings.redis.exists("stash:#{path}") do |stash_exists|
|
665
665
|
if stash_exists
|
666
666
|
settings.redis.srem("stashes", path) do
|
data/lib/sensu/client/socket.rb
CHANGED
@@ -119,12 +119,18 @@ module Sensu
|
|
119
119
|
unless check[:name] =~ /^[\w\.-]+$/
|
120
120
|
raise DataError, "check name must be a string and cannot contain spaces or special characters"
|
121
121
|
end
|
122
|
+
unless check[:source].nil? || check[:source] =~ /^[\w\.-]+$/
|
123
|
+
raise DataError, "check source must be a string and cannot contain spaces or special characters"
|
124
|
+
end
|
122
125
|
unless check[:output].is_a?(String)
|
123
126
|
raise DataError, "check output must be a string"
|
124
127
|
end
|
125
128
|
unless check[:status].is_a?(Integer)
|
126
129
|
raise DataError, "check status must be an integer"
|
127
130
|
end
|
131
|
+
unless check[:executed].is_a?(Integer)
|
132
|
+
raise DataError, "check executed timestamp must be an integer"
|
133
|
+
end
|
128
134
|
end
|
129
135
|
|
130
136
|
# Publish a check result to the Sensu transport.
|
@@ -149,6 +155,7 @@ module Sensu
|
|
149
155
|
# @raise [DataError] if +check+ is invalid.
|
150
156
|
def process_check_result(check)
|
151
157
|
check[:status] ||= 0
|
158
|
+
check[:executed] ||= Time.now.to_i
|
152
159
|
validate_check_result(check)
|
153
160
|
publish_check_result(check)
|
154
161
|
respond("ok")
|
data/lib/sensu/constants.rb
CHANGED
data/sensu.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.platform = RUBY_PLATFORM =~ /java/ ? Gem::Platform::JAVA : Gem::Platform::RUBY
|
8
8
|
s.authors = ["Sean Porter", "Justin Kolberg"]
|
9
9
|
s.email = ["portertech@gmail.com", "amdprophet@gmail.com"]
|
10
|
-
s.homepage = "
|
10
|
+
s.homepage = "http://sensuapp.org"
|
11
11
|
s.summary = "A monitoring framework"
|
12
12
|
s.description = "A monitoring framework that aims to be simple, malleable, and scalable."
|
13
13
|
s.license = "MIT"
|
@@ -25,8 +25,8 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.add_dependency "sensu-transport", "2.4.0"
|
26
26
|
s.add_dependency "sensu-spawn", "1.1.0"
|
27
27
|
s.add_dependency "em-redis-unified", "0.6.0"
|
28
|
-
s.add_dependency "sinatra", "1.
|
29
|
-
s.add_dependency "async_sinatra", "1.
|
28
|
+
s.add_dependency "sinatra", "1.4.6"
|
29
|
+
s.add_dependency "async_sinatra", "1.2.0"
|
30
30
|
s.add_dependency "thin", "1.5.0" unless RUBY_PLATFORM =~ /java/
|
31
31
|
|
32
32
|
s.add_development_dependency "rake", "~> 10.3"
|
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.18.
|
4
|
+
version: 0.18.1
|
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-05-
|
12
|
+
date: 2015-05-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -171,12 +171,12 @@ dependencies:
|
|
171
171
|
requirements:
|
172
172
|
- - '='
|
173
173
|
- !ruby/object:Gem::Version
|
174
|
-
version: 1.
|
174
|
+
version: 1.4.6
|
175
175
|
requirement: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
177
|
- - '='
|
178
178
|
- !ruby/object:Gem::Version
|
179
|
-
version: 1.
|
179
|
+
version: 1.4.6
|
180
180
|
prerelease: false
|
181
181
|
type: :runtime
|
182
182
|
- !ruby/object:Gem::Dependency
|
@@ -185,12 +185,12 @@ dependencies:
|
|
185
185
|
requirements:
|
186
186
|
- - '='
|
187
187
|
- !ruby/object:Gem::Version
|
188
|
-
version: 1.
|
188
|
+
version: 1.2.0
|
189
189
|
requirement: !ruby/object:Gem::Requirement
|
190
190
|
requirements:
|
191
191
|
- - '='
|
192
192
|
- !ruby/object:Gem::Version
|
193
|
-
version: 1.
|
193
|
+
version: 1.2.0
|
194
194
|
prerelease: false
|
195
195
|
type: :runtime
|
196
196
|
- !ruby/object:Gem::Dependency
|
@@ -268,7 +268,7 @@ files:
|
|
268
268
|
- README.md
|
269
269
|
- CHANGELOG.md
|
270
270
|
- MIT-LICENSE.txt
|
271
|
-
homepage:
|
271
|
+
homepage: http://sensuapp.org
|
272
272
|
licenses:
|
273
273
|
- MIT
|
274
274
|
metadata: {}
|