sensu 0.25.4 → 0.25.5

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: 395c016d81d285d4638a986ed2e74f3a57eeee12
4
- data.tar.gz: b1910e9c168985868d21960ece8dc89db4827814
3
+ metadata.gz: 02d86ad1519a656086b16c960bbca484bb92a4ca
4
+ data.tar.gz: da7868c4ce10e396a97630a2888aaad5ce45014d
5
5
  SHA512:
6
- metadata.gz: d019339a148fb8ddc6f5bed53c39229ef5b2007ce80f8e20c63fcd26ca246180cd52fbcefe19dc1b8526fce5284ef80d79b5e5caede41af04e4d161eece9daab
7
- data.tar.gz: f33ded0aae861eedefcb2260a2d0c8fca7356511db8f101ddb4d038099ddbb929b8537e703a1be9d460abf2bb6234ce552c7ef6ad4929a7f7777da842239ff07
6
+ metadata.gz: 217e47e5de21cba8aba1aba6da58a56b87172f55f1ef254529cf29b17faffcff187fefc31ebd822cc92ed2fd5cdd2bf1c5b5cff565ffd39a1e0482b2d0885770
7
+ data.tar.gz: 8af3432ae93ab3d5282b4ab717252dbac9bd352cb1663a5f167f026671caf378df03ce2edb2506c64ae5924cd3e13ba76748f6da728d8aa94822ec266419db03
@@ -1,3 +1,16 @@
1
+ ## 0.25.5 - 2016-07-12
2
+
3
+ ### Fixes
4
+
5
+ Reverted the Sensu API race condition fix, it was a red herring. Desired
6
+ behaviour has been restored.
7
+
8
+ Custom check definition attributes are now included in check request
9
+ payloads, fixing check attribute token substitution for pubsub checks.
10
+
11
+ Transport connectivity issues are now handled while querying the Transport
12
+ for pipe stats for API `/info` and `/health`.
13
+
1
14
  ## 0.25.4 - 2016-06-20
2
15
 
3
16
  ### Fixes
@@ -15,23 +15,13 @@ module Sensu
15
15
  def self.run(options={})
16
16
  api = self.new(options)
17
17
  EM::run do
18
+ api.setup_redis
19
+ api.setup_transport
18
20
  api.start
19
21
  api.setup_signal_traps
20
22
  end
21
23
  end
22
24
 
23
- # Setup connections to redis and transport
24
- #
25
- # @yield [Object] a callback/block to be called after redis and
26
- # transport connections have been established.
27
- def setup_connections
28
- setup_redis do |redis|
29
- setup_transport do |transport|
30
- yield if block_given?
31
- end
32
- end
33
- end
34
-
35
25
  # Start the API HTTP server. This method sets `@http_server`.
36
26
  #
37
27
  # @param bind [String] address to listen on.
@@ -56,10 +46,7 @@ module Sensu
56
46
  api = @settings[:api] || {}
57
47
  bind = api[:bind] || "0.0.0.0"
58
48
  port = api[:port] || 4567
59
- setup_connections do
60
- start_http_server(bind, port)
61
- yield if block_given?
62
- end
49
+ start_http_server(bind, port)
63
50
  super
64
51
  end
65
52
 
@@ -80,8 +67,11 @@ module Sensu
80
67
  # @param options [Hash]
81
68
  def self.test(options={})
82
69
  api = self.new(options)
83
- api.start do
84
- yield
70
+ api.setup_redis do
71
+ api.setup_transport do
72
+ api.start
73
+ yield
74
+ end
85
75
  end
86
76
  end
87
77
  end
@@ -17,13 +17,18 @@ module Sensu
17
17
  :messages => nil,
18
18
  :consumers => nil
19
19
  },
20
- :connected => @transport.connected?
20
+ :connected => false
21
21
  }
22
22
  if @transport.connected?
23
23
  @transport.stats("keepalives") do |stats|
24
24
  info[:keepalives] = stats
25
- @transport.stats("results") do |stats|
26
- info[:results] = stats
25
+ if @transport.connected?
26
+ @transport.stats("results") do |stats|
27
+ info[:results] = stats
28
+ info[:connected] = @transport.connected?
29
+ yield(info)
30
+ end
31
+ else
27
32
  yield(info)
28
33
  end
29
34
  end
@@ -1,7 +1,7 @@
1
1
  module Sensu
2
2
  unless defined?(Sensu::VERSION)
3
3
  # Sensu release version.
4
- VERSION = "0.25.4".freeze
4
+ VERSION = "0.25.5".freeze
5
5
 
6
6
  # Sensu check severities.
7
7
  SEVERITIES = %w[ok warning critical unknown].freeze
@@ -641,22 +641,19 @@ module Sensu
641
641
  end
642
642
 
643
643
  # Publish a check request to the Transport. A check request is
644
- # composed of a check `:name`, an `:issued` timestamp, a check
645
- # `:command` if available, and a check `:extension if available.
646
- # The check request is published to a Transport pipe, for each
647
- # of the check `:subscribers` in its definition, eg. "webserver".
648
- # JSON serialization is used when publishing the check request
644
+ # composed of a check definition (minus `:subscribers` and
645
+ # `:interval`) and an `:issued` timestamp. The check request is
646
+ # published to a Transport pipe, for each of the check
647
+ # `:subscribers` in its definition, eg. "webserver". JSON
648
+ # serialization is used when publishing the check request
649
649
  # payload to the Transport pipes. Transport errors are logged.
650
650
  #
651
651
  # @param check [Hash] definition.
652
652
  def publish_check_request(check)
653
- payload = {
654
- :name => check[:name],
655
- :issued => Time.now.to_i
656
- }
657
- payload[:command] = check[:command] if check.has_key?(:command)
658
- payload[:source] = check[:source] if check.has_key?(:source)
659
- payload[:extension] = check[:extension] if check.has_key?(:extension)
653
+ payload = check.reject do |key, value|
654
+ [:subscribers, :interval].include?(key)
655
+ end
656
+ payload[:issued] = Time.now.to_i
660
657
  @logger.info("publishing check request", {
661
658
  :payload => payload,
662
659
  :subscribers => check[:subscribers]
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.25.4
4
+ version: 0.25.5
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: 2016-06-21 00:00:00.000000000 Z
12
+ date: 2016-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine
@@ -227,7 +227,6 @@ files:
227
227
  - exe/sensu-install
228
228
  - exe/sensu-server
229
229
  - lib/sensu.rb
230
- - lib/sensu/#test.json#
231
230
  - lib/sensu/api/http_handler.rb
232
231
  - lib/sensu/api/process.rb
233
232
  - lib/sensu/api/routes.rb
@@ -280,7 +279,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
280
279
  version: '0'
281
280
  requirements: []
282
281
  rubyforge_project:
283
- rubygems_version: 2.6.4
282
+ rubygems_version: 2.6.3
284
283
  signing_key:
285
284
  specification_version: 4
286
285
  summary: A monitoring framework
@@ -1,37 +0,0 @@
1
- {
2
-
3
- "checks": {
4
-
5
- "check_procs_slapd": {
6
-
7
- "command": "/usr/local/nagios/libexec/check_procs -c 1:4 -w 1:4 -a libexec/slapd",
8
-
9
- "subscribers": ["EBB_CKPRC_SLAPD", "EBB"],
10
-
11
- "interval": 60
12
-
13
- },
14
-
15
- "check_procs_syslog-ng": {
16
-
17
- "command": "/usr/local/nagios/libexec/check_procs -w 1:4 -c 1:4 -a syslog-ng",
18
-
19
- "subscribers": ["EBB_CKPRC_SYSLOGNG", "EBB"],
20
-
21
- "interval": 60
22
-
23
- },
24
-
25
- "check_procs_total_procs": {
26
-
27
- "command": "/usr/local/nagios/libexec/check_procs -w 150 -c 250",
28
-
29
- "subscribers": ["EBB_CKPRC_TOTAL", "EBB"],
30
-
31
- "interval": 60
32
-
33
- }
34
-
35
- }
36
-
37
- }