sensu-plugins-java 1.0.0 → 1.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
  SHA1:
3
- metadata.gz: db08d1099acf7dc75c03f5ae7066c5a5261661cd
4
- data.tar.gz: a5acecc18197d908901f08e008c2eb12b7cc0c43
3
+ metadata.gz: 6f55dbfc122fb05ed378456c1313e12a19d7a20c
4
+ data.tar.gz: 85bb06cf64b9caef3e72bd8bbc350b6117006c47
5
5
  SHA512:
6
- metadata.gz: 2aa5fba895920408e5b367412ca08ce7ad5a4e70e23d58cd831bcfbe0dad6d96327ae8aedd15787394fc6b90c7093b9ae2760db90bf07f794bced18b4e59ed52
7
- data.tar.gz: 8d57c0a1b3969a31723f6162de8070699beab2d525b3216bde3682176bbdf114aeae76cd979a2f51d051a95d7d33855366b894e13a631127f40a4c266d95d9c2
6
+ metadata.gz: c15154988868e6635625cdd0ab0f9010ff2031c2c45bf41c5b2bca8db59dfb7a4a48d718c9661338bfbb5b40d04f1b6cc8aa765e598b1c0a8a2d421c0fc3bd56
7
+ data.tar.gz: eae92df6d62ec66f561fb39bd11ac6a5fd68768b37aec44bbfd5c0c83f2767d99fbed33a55b390ef81890fd1ab88df0de40ed539374d6c5926db5a375cd3af0d
data/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.1.0] - 2017-08-12
9
+ ### Added
10
+ - check-java-permgen.rb: added an option to run `jps` and `jstsat` with sudo (@sovaa)
11
+
8
12
  ## [1.0.0] - 2017-07-24
9
13
  ### Breaking Changes
10
14
  - Minimum Ruby runtime version is now 2.0 (@eheydrick)
@@ -60,7 +64,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
60
64
  ### Added
61
65
  - initial release
62
66
 
63
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-java/compare/1.0.0...HEAD
67
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-java/compare/1.1.0...HEAD
68
+ [1.1.0]: https://github.com/sensu-plugins/sensu-plugins-java/compare/1.0.0...1.1.0
64
69
  [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-java/compare/0.0.6...1.0.0
65
70
  [0.0.6]: https://github.com/sensu-plugins/sensu-plugins-java/compare/0.0.5...0.0.6
66
71
  [0.0.5]: https://github.com/sensu-plugins/sensu-plugins-java/compare/0.0.4...0.0.5
@@ -36,26 +36,28 @@ class CheckJavaPermGen < Sensu::Plugin::Check::CLI
36
36
 
37
37
  option :warn, short: '-w WARNLEVEL', default: '85'
38
38
  option :crit, short: '-c CRITLEVEL', default: '95'
39
+ option :as_sudo, short: '-s', description: 'Run as sudo', boolean: true, required: false
39
40
 
40
41
  def run
41
42
  warn_procs = []
42
43
  crit_procs = []
43
44
  java_pids = []
45
+ sudo = config[:as_sudo] ? 'sudo ' : ''
44
46
 
45
- IO.popen('jps -q') do |cmd|
47
+ IO.popen("#{sudo}jps -q") do |cmd|
46
48
  java_pids = cmd.read.split
47
49
  end
48
50
 
49
51
  java_pids.each do |java_proc|
50
52
  pgcmx = nil
51
53
  pu = nil
52
- IO.popen("jstat -gcpermcapacity #{java_proc} 1 1 2>&1") do |cmd|
54
+ IO.popen("#{sudo}jstat -gcpermcapacity #{java_proc} 1 1 2>&1") do |cmd|
53
55
  pgcmx = cmd.read.split[9]
54
56
  end
55
57
  exit_code = $CHILD_STATUS.exitstatus
56
58
  next if exit_code != 0
57
59
 
58
- IO.popen("jstat -gcold #{java_proc} 1 1 2>&1") do |cmd|
60
+ IO.popen("#{sudo}jstat -gcold #{java_proc} 1 1 2>&1") do |cmd|
59
61
  pu = cmd.read.split[9]
60
62
  end
61
63
  exit_code = $CHILD_STATUS.exitstatus
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsJava
2
2
  module Version
3
3
  MAJOR = 1
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-java
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.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: 2017-07-25 00:00:00.000000000 Z
11
+ date: 2017-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin