sensu-plugins-java 1.3.0 → 2.0.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
- SHA1:
3
- metadata.gz: eec29f729a7a98717093cff57fb3f57420a176cd
4
- data.tar.gz: 540998b80a6cee2300e9b985c1710a580273df3a
2
+ SHA256:
3
+ metadata.gz: 2369aa881a904df71ca1219f00a973805a62b6e1a0734ff379c0ab77baf572dc
4
+ data.tar.gz: 384484b025960940dd5a0a81bcbce73350f98a706129d86affadf0318677b200
5
5
  SHA512:
6
- metadata.gz: 1b8b550f2e68bdbf54133fbed8256e7aa8f149e6e77e667e7de0ef8a0a49ac98c8bd2c75a9454f3f3333a99ed4d421236e1945a0acd339fc98bf87c8d87a6fcf
7
- data.tar.gz: 8453f95a3c5bf25bdf15ac3b9a34db8f7d49f851be49d9f7b416636f975a70804e5825c84afd52a532f13acf4ce94143a3634bc7522760854d3955309f95b647
6
+ metadata.gz: ed2fec365f030b6b0e957e0c4a58e2a033ed309b2a20804f8fbcd787bc2212d235e860edff7c81bd5e4d4331b6b241f695b6a546d0d9fdba0ef13427719f8f16
7
+ data.tar.gz: 130d9c573c0059e86299a9e0b311288b5ba91857be2c4c0de63924be4b51aac3536f04455405adb0e286df8e64adfc6efd5cb784c9612ed0552f1f2ec361cff6
@@ -1,10 +1,26 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
- This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
4
+ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [2.0.0] - 2018-03-31
9
+ ### Breaking Changes
10
+ - dropped ruby 2.1 support (@yuri-zubov sponsored by Actility, https://www.actility.com)
11
+ - added `rest-client` as a dependency which requires you to have a local c compiler present to install this plugin (@yuri-zubov sponsored by Actility, https://www.actility.com)
12
+
13
+ ### Security
14
+ - updated yard dependency to `~> 0.9.11` per: https://nvd.nist.gov/vuln/detail/CVE-2017-17042 (@yuri-zubov sponsored by Actility, https://www.actility.com)
15
+ - updated rubocop dependency to `~> 0.51.0` per: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8418. (@yuri-zubov sponsored by Actility, https://www.actility.com)
16
+
17
+ ### Added
18
+ - Added ability to get metrics from VertX (@yuri-zubov sponsored by Actility, https://www.actility.com)
19
+ - Added health-check VertX (@yuri-zubov sponsored by Actility, https://www.actility.com)
20
+
21
+ ### Changed
22
+ - updated Changelog guidelines location (@majormoses)
23
+
8
24
  ## [1.3.0] - 2017-09-05
9
25
  ### Added
10
26
  - option `-l` to change if you wish to grab the max or the current heap limits (@Juan-Moreno)
@@ -72,7 +88,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
72
88
  ### Added
73
89
  - initial release
74
90
 
75
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-java/compare/1.3.0...HEAD
91
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-java/compare/2.0.0...HEAD
92
+ [2.0.0]: https://github.com/sensu-plugins/sensu-plugins-java/compare/1.3.0...2.0.0
76
93
  [1.3.0]: https://github.com/sensu-plugins/sensu-plugins-java/compare/1.2.0...1.3.0
77
94
  [1.2.0]: https://github.com/sensu-plugins/sensu-plugins-java/compare/1.1.0...1.2.0
78
95
  [1.1.0]: https://github.com/sensu-plugins/sensu-plugins-java/compare/1.0.0...1.1.0
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- bin_dir = File.expand_path(File.dirname(__FILE__))
4
- shell_script_path = File.join(bin_dir, File.basename($PROGRAM_NAME, '.rb') + '.sh')
3
+ shell_script_path = File.join(__dir__, File.basename($PROGRAM_NAME, '.rb') + '.sh')
5
4
 
6
5
  exec shell_script_path, *ARGV
@@ -0,0 +1,59 @@
1
+ #! /usr/bin/env ruby
2
+ #
3
+ # check-vertx-health
4
+ #
5
+ # DESCRIPTION:
6
+ # check-vertx-health simple way to expose health checks for VertX
7
+ #
8
+ # OUTPUT:
9
+ # plain text
10
+ #
11
+ # PLATFORMS:
12
+ # Linux
13
+ #
14
+ # DEPENDENCIES:
15
+ # gem: rest-client
16
+ #
17
+ #
18
+ # USAGE:
19
+ #
20
+ #
21
+ # NOTES:
22
+ #
23
+ # LICENSE:
24
+ # Zubov Yuri <yury.zubau@gmail.com> sponsored by Actility, https://www.actility.com
25
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
26
+ # for details.
27
+ #
28
+ require 'sensu-plugin/check/cli'
29
+ require 'rest-client'
30
+ require 'json'
31
+
32
+ class CheckVertXHealth < Sensu::Plugin::Check::CLI
33
+ include CommonVertX
34
+
35
+ option :endpoint,
36
+ short: '-p ENDPOINT',
37
+ long: '--endpointn ENDPOINT',
38
+ description: 'VertX Endpoint',
39
+ default: 'http://localhost:8080/rest/health'
40
+
41
+ def check_health
42
+ response = request
43
+
44
+ result = JSON.parse(response)
45
+ result['outcome']
46
+ end
47
+
48
+ def run
49
+ result = check_health
50
+
51
+ if result == 'UP'
52
+ ok 'VertX is UP'
53
+ elsif result == 'DOWN'
54
+ warning 'VertX is DOWN'
55
+ end
56
+ rescue StandardError => e
57
+ critical e.message
58
+ end
59
+ end
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- bin_dir = File.expand_path(File.dirname(__FILE__))
4
- shell_script_path = File.join(bin_dir, File.basename($PROGRAM_NAME, '.rb') + '.sh')
3
+ shell_script_path = File.join(__dir__, File.basename($PROGRAM_NAME, '.rb') + '.sh')
5
4
 
6
5
  exec shell_script_path, *ARGV
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- bin_dir = File.expand_path(File.dirname(__FILE__))
4
- shell_script_path = File.join(bin_dir, File.basename($PROGRAM_NAME, '.rb') + '.py')
3
+ shell_script_path = File.join(__dir__, File.basename($PROGRAM_NAME, '.rb') + '.py')
5
4
 
6
5
  exec shell_script_path, *ARGV
@@ -0,0 +1,61 @@
1
+ #! /usr/bin/env ruby
2
+ #
3
+ # metrics-vertx
4
+ #
5
+ # DESCRIPTION:
6
+ # metrics-vertx get metrics from VertX
7
+ #
8
+ # OUTPUT:
9
+ # metric-data
10
+ #
11
+ # PLATFORMS:
12
+ # Linux
13
+ #
14
+ # DEPENDENCIES:
15
+ # gem: rest-clien
16
+ #
17
+ # USAGE:
18
+ #
19
+ #
20
+ # NOTES:
21
+ #
22
+ # LICENSE:
23
+ # Zubov Yuri <yury.zubau@gmail.com> sponsored by Actility, https://www.actility.com
24
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
25
+ # for details.
26
+ #
27
+
28
+ require 'sensu-plugin/metric/cli'
29
+ require 'rest-client'
30
+ require 'json'
31
+
32
+ class MetricsVertX < Sensu::Plugin::Metric::CLI::Graphite
33
+ include CommonVertX
34
+
35
+ option :endpoint,
36
+ short: '-p ENDPOINT',
37
+ long: '--endpointn ENDPOINT',
38
+ description: 'VertX Endpoint',
39
+ default: 'http://localhost:8080/rest/metrics'
40
+
41
+ option :scheme,
42
+ description: 'Metric naming scheme, text to prepend to metric',
43
+ short: '-S SCHEME',
44
+ long: '--scheme SCHEME',
45
+ default: "#{Socket.gethostname}.vertx"
46
+
47
+ def metrics
48
+ response = request
49
+ JSON.parse(response)
50
+ end
51
+
52
+ def run
53
+ metrics.each do |key, metrics|
54
+ type_of_metric = metrics.delete('type')
55
+ metrics.each do |metric_name, value|
56
+ output("#{config[:scheme]}.#{key}.#{type_of_metric}.#{metric_name}", value)
57
+ end
58
+ end
59
+ ok
60
+ end
61
+ end
@@ -1 +1,2 @@
1
+ require 'sensu-plugins-java/common_vertx'
1
2
  require 'sensu-plugins-java/version'
@@ -0,0 +1,8 @@
1
+ module CommonVertX
2
+ def request
3
+ RestClient::Request.execute(
4
+ method: :get,
5
+ url: config[:endpoint]
6
+ )
7
+ end
8
+ end
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsJava
2
2
  module Version
3
- MAJOR = 1
4
- MINOR = 3
3
+ MAJOR = 2
4
+ MINOR = 0
5
5
  PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,43 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-java
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 2.0.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-06 00:00:00.000000000 Z
11
+ date: 2018-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: sensu-plugin
14
+ name: english
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.6.3
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.6.3
27
+ - !ruby/object:Gem::Dependency
28
+ name: rest-client
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: '1.2'
33
+ version: '2.0'
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: '1.2'
40
+ version: '2.0'
27
41
  - !ruby/object:Gem::Dependency
28
- name: english
42
+ name: sensu-plugin
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - '='
45
+ - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: 0.6.3
47
+ version: '1.2'
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - '='
52
+ - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: 0.6.3
54
+ version: '1.2'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -123,54 +137,70 @@ dependencies:
123
137
  - !ruby/object:Gem::Version
124
138
  version: '3.2'
125
139
  - !ruby/object:Gem::Dependency
126
- name: rubocop
140
+ name: rspec
127
141
  requirement: !ruby/object:Gem::Requirement
128
142
  requirements:
129
143
  - - "~>"
130
144
  - !ruby/object:Gem::Version
131
- version: 0.40.0
145
+ version: '3.7'
132
146
  type: :development
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
135
149
  requirements:
136
150
  - - "~>"
137
151
  - !ruby/object:Gem::Version
138
- version: 0.40.0
152
+ version: '3.7'
139
153
  - !ruby/object:Gem::Dependency
140
- name: rspec
154
+ name: rspec-mocks
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '3.7'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '3.7'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rubocop
141
169
  requirement: !ruby/object:Gem::Requirement
142
170
  requirements:
143
171
  - - "~>"
144
172
  - !ruby/object:Gem::Version
145
- version: '3.4'
173
+ version: 0.51.0
146
174
  type: :development
147
175
  prerelease: false
148
176
  version_requirements: !ruby/object:Gem::Requirement
149
177
  requirements:
150
178
  - - "~>"
151
179
  - !ruby/object:Gem::Version
152
- version: '3.4'
180
+ version: 0.51.0
153
181
  - !ruby/object:Gem::Dependency
154
182
  name: yard
155
183
  requirement: !ruby/object:Gem::Requirement
156
184
  requirements:
157
185
  - - "~>"
158
186
  - !ruby/object:Gem::Version
159
- version: '0.8'
187
+ version: 0.9.11
160
188
  type: :development
161
189
  prerelease: false
162
190
  version_requirements: !ruby/object:Gem::Requirement
163
191
  requirements:
164
192
  - - "~>"
165
193
  - !ruby/object:Gem::Version
166
- version: '0.8'
194
+ version: 0.9.11
167
195
  description: Sensu plugins for Java
168
196
  email: "<sensu-users@googlegroups.com>"
169
197
  executables:
170
198
  - check-java-heap-pcnt.rb
171
199
  - check-java-permgen.rb
200
+ - check-vertx-health.rb
172
201
  - metrics-java-heap-graphite.rb
173
202
  - metrics-jstat.rb
203
+ - metrics-vertx.rb
174
204
  extensions: []
175
205
  extra_rdoc_files: []
176
206
  files:
@@ -181,6 +211,7 @@ files:
181
211
  - bin/check-java-heap-pcnt.rb
182
212
  - bin/check-java-heap-pcnt.sh
183
213
  - bin/check-java-permgen.rb
214
+ - bin/check-vertx-health.rb
184
215
  - bin/java-heap-pcnt.sh
185
216
  - bin/metrics-java-heap-graphite-java8.sh
186
217
  - bin/metrics-java-heap-graphite.rb
@@ -188,7 +219,9 @@ files:
188
219
  - bin/metrics-jstat-java8.py
189
220
  - bin/metrics-jstat.py
190
221
  - bin/metrics-jstat.rb
222
+ - bin/metrics-vertx.rb
191
223
  - lib/sensu-plugins-java.rb
224
+ - lib/sensu-plugins-java/common_vertx.rb
192
225
  - lib/sensu-plugins-java/version.rb
193
226
  homepage: https://github.com/sensu-plugins/sensu-plugins-java
194
227
  licenses:
@@ -208,7 +241,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
208
241
  requirements:
209
242
  - - ">="
210
243
  - !ruby/object:Gem::Version
211
- version: 2.0.0
244
+ version: 2.1.0
212
245
  required_rubygems_version: !ruby/object:Gem::Requirement
213
246
  requirements:
214
247
  - - ">="
@@ -216,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
249
  version: '0'
217
250
  requirements: []
218
251
  rubyforge_project:
219
- rubygems_version: 2.6.13
252
+ rubygems_version: 2.7.6
220
253
  signing_key:
221
254
  specification_version: 4
222
255
  summary: Sensu plugins for Java