sensu-plugins-zookeeper 1.3.0 → 1.4.0

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: 72c0c089bdf151003b5f21a405e2fa917840ef76
4
- data.tar.gz: d3a5f610c72fb9d9ef6c331eacd18b2e584d4898
3
+ metadata.gz: 50c001e82c65e3b2c3b2ef17bd5fe991baede851
4
+ data.tar.gz: 6cf166d88e6baf96295af88f4dc4aca62281a172
5
5
  SHA512:
6
- metadata.gz: 7ef6c1fdb309c82f192b9299f07f4423e5f5efa518411ca14e3ac4ab02868a6523f46c06ce1a3f233696f9c282a84a5519e7a0be6e357b77564e6202e1f07715
7
- data.tar.gz: 5816a75806675c37e4e155eb3dafbe80c3ea694769bd2b42460dd64cc09901f5fcf866d554e0b1808cd62175b15b2056b30a050208e110608aa99545c861a6cd
6
+ metadata.gz: cd99cd108966f6d63b95ea904d5c3b888ee68f821931445fe2a076f2c50ca9c85ba8d91fe0cc77c887e5b4b893b9e071a0e0a32ee73ce68645c59affbcfeacb8
7
+ data.tar.gz: 8b74c06f883117c7db8278ce75b29535d89caf04a64c9940e6eacda87b1fad4bca896cd2a53177a542458145436587acecbd905bd51672386d735ddf7f288fc0
data/CHANGELOG.md CHANGED
@@ -6,6 +6,13 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.4.0] - 2017-10-31
10
+ ### Added
11
+ - Added zookeeper port option to metrics-zookeeper-cluster.rb
12
+
13
+ ### Fixed
14
+ - Fixed a return bug in case of an error on metrics-zookeeper-cluster.rb
15
+
9
16
  ## [1.3.0] - 2017-09-09
10
17
  ### Added
11
18
  - metrics-zookeeper-cluster.rb: new script to gather metrics from a zookeeper cluster (@fsniper)
@@ -61,6 +68,7 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
61
68
  - initial release
62
69
 
63
70
  [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-zookeeper/compare/1.3.0...HEAD
71
+ [1.4.0]: https://github.com/sensu-plugins/sensu-plugins-zookeeper/compare/1.3.0...1.4.0
64
72
  [1.3.0]: https://github.com/sensu-plugins/sensu-plugins-zookeeper/compare/1.2.0...1.3.0
65
73
  [1.2.0]: https://github.com/sensu-plugins/sensu-plugins-zookeeper/compare/1.1.0...1.2.0
66
74
  [1.1.0]: https://github.com/sensu-plugins/sensu-plugins-zookeeper/compare/1.0.0...1.1.0
@@ -25,6 +25,7 @@
25
25
  #
26
26
 
27
27
  require 'sensu-plugin/metric/cli'
28
+ require 'sensu-plugins-zookeeper/version'
28
29
  require 'socket'
29
30
  require 'net/http'
30
31
  require 'json'
@@ -41,6 +42,13 @@ class ZookeeperMetrics < Sensu::Plugin::Metric::CLI::Graphite
41
42
  long: '--scheme SCHEME',
42
43
  default: 'zookeeper'
43
44
 
45
+ option :zk_port,
46
+ description: 'Zookeeper nodes\' listen port',
47
+ short: '-p port',
48
+ long: '--port port',
49
+ default: 2181,
50
+ proc: proc(&:to_i)
51
+
44
52
  def follow_url(uri_str, agent = "sensu-plugins-zookeeper/#{SensuPluginsZookeeper::Version::VER_STRING}", max_attempts = 10, timeout = 10)
45
53
  attempts = 0
46
54
  cookie = nil
@@ -102,7 +110,7 @@ class ZookeeperMetrics < Sensu::Plugin::Metric::CLI::Graphite
102
110
 
103
111
  def exhibitor_status
104
112
  response = follow_url(config[:exhibitor])
105
- JSON.parse(response.body)
113
+ json = JSON.parse(response.body)
106
114
  rescue StandardError => e
107
115
  [false, json, ['exhibitor status is not http 200 ' + e.message]]
108
116
  end
@@ -113,7 +121,7 @@ class ZookeeperMetrics < Sensu::Plugin::Metric::CLI::Graphite
113
121
  json = exhibitor_status
114
122
  json.each do |zk|
115
123
  hostname = zk['hostname']
116
- response = zk_command(:mntr, hostname, 2181)
124
+ response = zk_command(:mntr, hostname, config[:zk_port])
117
125
  metrics = {}
118
126
 
119
127
  if response =~ /^zk_avg_latency\s*(\d+)$/
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsZookeeper
2
2
  module Version
3
3
  MAJOR = 1
4
- MINOR = 3
4
+ MINOR = 4
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: 1.3.0
4
+ version: 1.4.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: 2017-09-09 00:00:00.000000000 Z
11
+ date: 2017-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  version: '0'
218
218
  requirements: []
219
219
  rubyforge_project:
220
- rubygems_version: 2.6.13
220
+ rubygems_version: 2.6.14
221
221
  signing_key:
222
222
  specification_version: 4
223
223
  summary: Sensu plugins for zookeeper