sensu-plugins-zookeeper 3.0.0 → 3.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bfa8a78004fae9e11f38490aef5c5c8e09f3cc4a4b613b5099eb495e47805d0b
4
- data.tar.gz: aa41d17de0b05b8487d52ac80e58094c77c725466b67dc74f7df2f232dc8b14b
3
+ metadata.gz: fbff5ca8017a67540ee0e3460626562dd1e584aa882bbf1ecd5d16c7853528ef
4
+ data.tar.gz: 782756085bfbc2284ae6f9a2bd05346a8c984c2c28b3224f9975a3191bfb59c4
5
5
  SHA512:
6
- metadata.gz: 9e93f3edf92996b15cf7a90f34228093b15b70dc06ba73b2b902fe638dad21f7d325fdb9636ccaf1aa79902d88ce58d68d7e5b1f0cb55caf8d8198104cd1861c
7
- data.tar.gz: d486f4a0f8e405575db2116792f12aea2d7078ce9cc93cac3263ed38ae7b86458d087d65d24a59d652af5d404e1d7873e46c72e9074e73f08b6a4e756ed1253f
6
+ metadata.gz: 00c793488c17da38a9f7be98d49769a30eec26691f24a2439487b6964079dffa98697a27894494075fd8fb35753601904c8a39d35fc6d4f45d263fa050d8f587
7
+ data.tar.gz: c14da55994f9d5e221edf89278a94170eba0e5fa4acc15b4ec03b07595c4d68fd4b7fe4b3044f1621f66c7028335fc15112595c42554ee31e83bf935ec906e42
data/CHANGELOG.md CHANGED
@@ -6,6 +6,16 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [3.1.0] - 2021-03-31
10
+
11
+ ### Changes
12
+ - Use TCPSocket logic with timeout for check-zookeeper-mode.rb and metricz-zookepper.rb
13
+ - Update development_dependency: yard >= 0.9.20
14
+ - Remove CentOS 6 Asset build, CentOS6 reach end of life
15
+
16
+ ### Fixed
17
+ - Remove deplicate count option in check-zookeeper-cluster.rb
18
+
9
19
  ## [3.0.0] - 2020-03-19
10
20
  ### Breaking Changes
11
21
  - Bump `sensu-plugin` dependency to `~> 4.0` you can read the changelog entries for [4.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#400---2018-02-17), [3.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#300---2018-12-04), and [2.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#v200---2017-03-29)
@@ -98,7 +108,8 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
98
108
  ### Added
99
109
  - initial release
100
110
 
101
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-zookeeper/compare/3.0.0...HEAD
111
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-zookeeper/compare/3.1.0...HEAD
112
+ [3.1.0]: https://github.com/sensu-plugins/sensu-plugins-zookeeper/compare/3.0.0...3.1.0
102
113
  [3.0.0]: https://github.com/sensu-plugins/sensu-plugins-zookeeper/compare/2.0.0...3.0.0
103
114
  [2.0.0]: https://github.com/sensu-plugins/sensu-plugins-zookeeper/compare/1.5.0...2.0.0
104
115
  [1.5.0]: https://github.com/sensu-plugins/sensu-plugins-zookeeper/compare/1.4.0...1.5.0
@@ -44,13 +44,6 @@ class CheckZookeeperCluster < Sensu::Plugin::Check::CLI
44
44
  default: 2181,
45
45
  proc: proc(&:to_i)
46
46
 
47
- option :count,
48
- description: 'Zookeeper cluster node count',
49
- short: '-c count',
50
- long: '--count count',
51
- default: 3,
52
- proc: proc(&:to_i)
53
-
54
47
  option :exhibitor,
55
48
  description: 'exhibitor end node for status checks',
56
49
  short: '-e Exhibitor status end point',
@@ -53,10 +53,16 @@ class CheckZookeeperMode < Sensu::Plugin::Check::CLI
53
53
  required: true
54
54
 
55
55
  def zk_command(four_letter_word)
56
- Socket.tcp(config[:server], config[:port]) do |sock|
57
- sock.print "#{four_letter_word}\r\n"
58
- sock.close_write
59
- sock.read
56
+ TCPSocket.open(config[:server], config[:port]) do |socket|
57
+ socket.write four_letter_word.to_s
58
+ ready = IO.select([socket], nil, nil, config[:timeout])
59
+
60
+ if ready.nil?
61
+ critical %(Zookeeper did not respond to #{four_letter_word} within #{config[:timeout]} seconds)
62
+ end
63
+
64
+ result = ready.first.first.read.chomp
65
+ return result
60
66
  end
61
67
  end
62
68
 
@@ -38,6 +38,13 @@ class ZookeeperMetrics < Sensu::Plugin::Metric::CLI::Graphite
38
38
  proc: proc(&:to_i),
39
39
  default: 2181
40
40
 
41
+ option :timeout,
42
+ description: 'How long to wait for a reply in seconds.',
43
+ short: '-t SECS',
44
+ long: '--timeout SECS',
45
+ proc: proc(&:to_i),
46
+ default: 5
47
+
41
48
  option :scheme,
42
49
  description: 'Metric naming scheme, text to prepend to metrics',
43
50
  long: '--scheme SCHEME',
@@ -48,10 +55,15 @@ class ZookeeperMetrics < Sensu::Plugin::Metric::CLI::Graphite
48
55
  end
49
56
 
50
57
  def zk_command(four_letter_word)
51
- Socket.tcp(config[:host], config[:port]) do |sock|
52
- sock.print "#{four_letter_word}\r\n"
53
- sock.close_write
54
- sock.read
58
+ TCPSocket.open(config[:server], config[:port]) do |socket|
59
+ socket.write four_letter_word.to_s
60
+ ready = IO.select([socket], nil, nil, config[:timeout])
61
+
62
+ if ready.nil?
63
+ critical %(Zookeeper did not respond to '#{four_letter_word}' within #{config[:timeout]} seconds)
64
+ end
65
+ result = ready.first.first.read.chomp
66
+ return result
55
67
  end
56
68
  end
57
69
 
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsZookeeper
2
2
  module Version
3
3
  MAJOR = 3
4
- MINOR = 0
4
+ MINOR = 1
5
5
  PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-zookeeper
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-16 00:00:00.000000000 Z
11
+ date: 2021-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '0.8'
159
+ version: 0.9.20
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '0.8'
166
+ version: 0.9.20
167
167
  description: Zookeeper plugins for checks and metrics
168
168
  email: "<sensu-users@googlegroups.com>"
169
169
  executables:
@@ -218,8 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  - !ruby/object:Gem::Version
219
219
  version: '0'
220
220
  requirements: []
221
- rubyforge_project:
222
- rubygems_version: 2.7.7
221
+ rubygems_version: 3.0.8
223
222
  signing_key:
224
223
  specification_version: 4
225
224
  summary: Sensu plugins for zookeeper