sensu-plugins-process-checks 0.0.4 → 0.0.5
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 +4 -4
- checksums.yaml.gz.sig +2 -2
- data.tar.gz.sig +1 -2
- data/CHANGELOG.md +15 -1
- data/README.md +1 -1
- data/bin/check-cmd.rb +1 -1
- data/bin/check-process-restart.rb +1 -1
- data/bin/check-process.rb +8 -2
- data/bin/check-threads-count.rb +1 -1
- data/bin/metrics-process-status.rb +2 -2
- data/bin/{process-uptime-metrics.sh → metrics-process-uptime.sh} +0 -0
- data/bin/metrics-processes-threads-count.rb +2 -2
- data/lib/sensu-plugins-process-checks/version.rb +1 -1
- metadata +6 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ce98e8ad8990b2ce46e44d22e8427e0eb6d30f5
|
4
|
+
data.tar.gz: c3488a83a43ee4310776a4fa2f9435ba4e25c653
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8626db2464051a5ab4c8cf1149dbb2292e9751ca278b1030c69bed623ed0406403d12359861ab6797a28f0b997c5d5caeec8ed5a03803d8e684c34829670336
|
7
|
+
data.tar.gz: 033d341eba5d78b5593d7323a83e48a8a3677e845ce42b34415e9e0093288e3af979df65d74c74829ac00482093d964e2afd8c2c11dadc40d1b2ba8f8880eacb
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
�
|
1
|
+
����eE?��ҏ�(�U��^Ax��b���ɏ�77��
|
2
|
+
����Z�ì�C�Z��D����[Q�i��^�5:��sJ���U7R/�w_E��f��t�N�h�d�Uv\��������lKy�[�R{ĪVu�94x>y�,�eZ<ԄF�j!�K�>4��ͳy�����ʅ���c�~P�8�ʆ�C-��'���ZJ,�.:�����LV{@�28��k����X北�E' ��Q��Wn���|禱V�Z�
|
data.tar.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
A%r=ƒ�o��\O#�Q��U��x [e�^�{�`b�j��f8�Ҽ�E]�&��6������U�W�����
|
1
|
+
��Pd�
|
data/CHANGELOG.md
CHANGED
@@ -3,7 +3,15 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
3
3
|
|
4
4
|
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
|
5
5
|
|
6
|
-
## Unreleased
|
6
|
+
## Unreleased
|
7
|
+
- nothing
|
8
|
+
|
9
|
+
## [0.0.5] - 2015-07-14
|
10
|
+
### Fixed
|
11
|
+
- include hostname in default scheme in metrics-processes-threads-count
|
12
|
+
|
13
|
+
### Changed
|
14
|
+
rename process-uptime metrics.sh -> metrics-process-uptime.sh
|
7
15
|
|
8
16
|
## [0.0.4] - 2015-07-14
|
9
17
|
### Changed
|
@@ -82,3 +90,9 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
82
90
|
- basic yard coverage
|
83
91
|
- built against 1.9.3, 2.0, 2.1
|
84
92
|
- cryptographically signed
|
93
|
+
|
94
|
+
[unreleased]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/0.0.5...HEAD
|
95
|
+
[0.0.5]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/0.0.4...0.0.5
|
96
|
+
[0.0.4]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/0.0.3...0.0.4
|
97
|
+
[0.0.3]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/0.0.2...0.0.3
|
98
|
+
[0.0.2]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/0.0.1...0.0.2
|
data/README.md
CHANGED
data/bin/check-cmd.rb
CHANGED
@@ -52,7 +52,7 @@ class CheckCmdStatus < Sensu::Plugin::Check::CLI
|
|
52
52
|
# Acquire the exit code and/or output of a command and alert if it is not
|
53
53
|
# what is expected.
|
54
54
|
#
|
55
|
-
def acquire_cmd_status
|
55
|
+
def acquire_cmd_status
|
56
56
|
stdout = `#{config[:command]}`
|
57
57
|
# #YELLOW
|
58
58
|
unless $CHILD_STATUS.exitstatus.to_s == config[:status] # rubocop:disable UnlessElse
|
@@ -94,7 +94,7 @@ class CheckProcessRestart < Sensu::Plugin::Check::CLI
|
|
94
94
|
|
95
95
|
# Main run method for the check
|
96
96
|
#
|
97
|
-
def run
|
97
|
+
def run
|
98
98
|
unless checkrestart?
|
99
99
|
unknown "Can't seem to find checkrestart. This check only works in a Debian based distribution and you need debian-goodies package installed"
|
100
100
|
end
|
data/bin/check-process.rb
CHANGED
@@ -95,6 +95,11 @@ class CheckProcess < Sensu::Plugin::Check::CLI
|
|
95
95
|
long: '--pattern PATTERN',
|
96
96
|
description: 'Match a command against this pattern'
|
97
97
|
|
98
|
+
option :exclude_pat,
|
99
|
+
short: '-x PATTERN',
|
100
|
+
long: '--exclude-pattern PATTERN',
|
101
|
+
description: "Don't match against a pattern to prevent false positives"
|
102
|
+
|
98
103
|
option :file_pid,
|
99
104
|
short: '-f PID',
|
100
105
|
long: '--file-pid PID',
|
@@ -217,14 +222,14 @@ class CheckProcess < Sensu::Plugin::Check::CLI
|
|
217
222
|
|
218
223
|
# Match to a time
|
219
224
|
#
|
220
|
-
def etime_to_esec(etime)
|
225
|
+
def etime_to_esec(etime)
|
221
226
|
m = /(\d+-)?(\d\d:)?(\d\d):(\d\d)/.match(etime)
|
222
227
|
(m[1] || 0).to_i * 86_400 + (m[2] || 0).to_i * 3600 + (m[3] || 0).to_i * 60 + (m[4] || 0).to_i
|
223
228
|
end
|
224
229
|
|
225
230
|
# Match to a time
|
226
231
|
#
|
227
|
-
def cputime_to_csec(time)
|
232
|
+
def cputime_to_csec(time)
|
228
233
|
m = /(\d+-)?(\d\d:)?(\d\d):(\d\d)/.match(time)
|
229
234
|
(m[1] || 0).to_i * 86_400 + (m[2] || 0).to_i * 3600 + (m[3] || 0).to_i * 60 + (m[4] || 0).to_i
|
230
235
|
end
|
@@ -239,6 +244,7 @@ class CheckProcess < Sensu::Plugin::Check::CLI
|
|
239
244
|
end
|
240
245
|
procs.reject! { |p| p[:pid].to_i == $PROCESS_ID } unless config[:match_self]
|
241
246
|
procs.reject! { |p| p[:pid].to_i == Process.ppid } unless config[:match_parent]
|
247
|
+
procs.reject! { |p| p[:command] =~ /#{config[:exclude_pat]}/ } if config[:exclude_pat]
|
242
248
|
procs.reject! { |p| p[:command] !~ /#{config[:cmd_pat]}/ } if config[:cmd_pat]
|
243
249
|
procs.reject! { |p| p[:vsz].to_f > config[:vsz] } if config[:vsz]
|
244
250
|
procs.reject! { |p| p[:rss].to_f > config[:rss] } if config[:rss]
|
data/bin/check-threads-count.rb
CHANGED
@@ -100,7 +100,7 @@ class ProcStatus < Sensu::Plugin::Metric::CLI::Graphite
|
|
100
100
|
#
|
101
101
|
# @param pid [String]
|
102
102
|
#
|
103
|
-
def acquire_stats_for_pid(pid)
|
103
|
+
def acquire_stats_for_pid(pid)
|
104
104
|
return nil unless ::File.exist?(::File.join('/proc', pid, 'cmdline'))
|
105
105
|
|
106
106
|
cmdline_raw = `cat /proc/#{pid}/cmdline`
|
@@ -121,7 +121,7 @@ class ProcStatus < Sensu::Plugin::Metric::CLI::Graphite
|
|
121
121
|
|
122
122
|
# Main functino
|
123
123
|
#
|
124
|
-
def run
|
124
|
+
def run
|
125
125
|
fail 'You must supply -u USER or -p PROCESSNAME' unless config[:user] || config[:processname]
|
126
126
|
metrics = {}
|
127
127
|
pgrep_output = `#{pgrep_command}`
|
File without changes
|
@@ -41,7 +41,7 @@ class ProcessesThreadsCount < Sensu::Plugin::Metric::CLI::Graphite
|
|
41
41
|
description: 'Scheme for metric output',
|
42
42
|
short: '-s SCHEME',
|
43
43
|
long: '--scheme SCHEME',
|
44
|
-
default:
|
44
|
+
default: "#{Socket.gethostname}.system"
|
45
45
|
|
46
46
|
option :threads,
|
47
47
|
description: 'If specified, count the number of threads running on the system in addition to processes. Note: Requires sys-proctables > 0.9.5',
|
@@ -84,7 +84,7 @@ class ProcessesThreadsCount < Sensu::Plugin::Metric::CLI::Graphite
|
|
84
84
|
end
|
85
85
|
|
86
86
|
# Main function
|
87
|
-
def run
|
87
|
+
def run
|
88
88
|
if config[:threads]
|
89
89
|
unknown PROCTABLE_MSG unless check_proctable_version
|
90
90
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-process-checks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu-Plugins and contributors
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
|
31
31
|
HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-
|
33
|
+
date: 2015-08-12 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: english
|
@@ -164,14 +164,14 @@ dependencies:
|
|
164
164
|
requirements:
|
165
165
|
- - '='
|
166
166
|
- !ruby/object:Gem::Version
|
167
|
-
version:
|
167
|
+
version: 0.32.1
|
168
168
|
type: :development
|
169
169
|
prerelease: false
|
170
170
|
version_requirements: !ruby/object:Gem::Requirement
|
171
171
|
requirements:
|
172
172
|
- - '='
|
173
173
|
- !ruby/object:Gem::Version
|
174
|
-
version:
|
174
|
+
version: 0.32.1
|
175
175
|
- !ruby/object:Gem::Dependency
|
176
176
|
name: redcarpet
|
177
177
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,8 +220,8 @@ files:
|
|
220
220
|
- bin/check-process.rb
|
221
221
|
- bin/check-threads-count.rb
|
222
222
|
- bin/metrics-process-status.rb
|
223
|
+
- bin/metrics-process-uptime.sh
|
223
224
|
- bin/metrics-processes-threads-count.rb
|
224
|
-
- bin/process-uptime-metrics.sh
|
225
225
|
- lib/sensu-plugins-process-checks.rb
|
226
226
|
- lib/sensu-plugins-process-checks/version.rb
|
227
227
|
homepage: https://github.com/sensu-plugins/sensu-plugins-process-checks
|
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
250
250
|
version: '0'
|
251
251
|
requirements: []
|
252
252
|
rubyforge_project:
|
253
|
-
rubygems_version: 2.4.
|
253
|
+
rubygems_version: 2.4.8
|
254
254
|
signing_key:
|
255
255
|
specification_version: 4
|
256
256
|
summary: Sensu plugins for checking running processes
|
metadata.gz.sig
CHANGED
Binary file
|