sensu-plugins-java 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/bin/check-java-permgen.rb +5 -3
- data/lib/sensu-plugins-java/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f55dbfc122fb05ed378456c1313e12a19d7a20c
|
4
|
+
data.tar.gz: 85bb06cf64b9caef3e72bd8bbc350b6117006c47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
data/bin/check-java-permgen.rb
CHANGED
@@ -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(
|
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
|
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.
|
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-
|
11
|
+
date: 2017-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|