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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e1d235e741fbd0c204837dbed6c617aa5aeba28
4
- data.tar.gz: 423cea8ce3352d4319d31e69662883b5c9b36f1c
3
+ metadata.gz: 0ce98e8ad8990b2ce46e44d22e8427e0eb6d30f5
4
+ data.tar.gz: c3488a83a43ee4310776a4fa2f9435ba4e25c653
5
5
  SHA512:
6
- metadata.gz: ba55585673e786bab38e5a638f5e3a6a2a748b71bd15cf0485fb86791788c91833b4e036e1f1755d04d242328dd8b5e78a3ce3c9515612691e47e27088575c08
7
- data.tar.gz: 406caac3f879a1148036fdcb567ee735ed17bb78cd7df07677c71a582e8bbb2a1f413d2b1de6872203d96682dc4d113d467c356880298f341993d5de720d9417
6
+ metadata.gz: e8626db2464051a5ab4c8cf1149dbb2292e9751ca278b1030c69bed623ed0406403d12359861ab6797a28f0b997c5d5caeec8ed5a03803d8e684c34829670336
7
+ data.tar.gz: 033d341eba5d78b5593d7323a83e48a8a3677e845ce42b34415e9e0093288e3af979df65d74c74829ac00482093d964e2afd8c2c11dadc40d1b2ba8f8880eacb
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- /��4r$�Nlf���[�ȶG�SS�cy�Ѥ������(��[Vx@�������kOu!������P|����Y-|3�u{ ɝE.t;�'ƐEs[&��C�[�m1f7Jٟ����%�䃫�y�=̂
2
- �ڝ��z��f���ڼS/�3#@qRW��)pgZA.
1
+ ����eE?��ҏ�(�U��^Ax��b���ɏ�77��
2
+ ����Z�ì�CZ��D����[Q�i��^�5:��sJ���U7 R/�w_E��f��t�Nh�dUv\��������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��)P\q@�Ө�qu�^Ԇ
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][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
@@ -20,7 +20,7 @@
20
20
  * bin/check-threads-count.rb
21
21
  * bin/metrics-process-status.rb
22
22
  * bin/metrics-processes-threads-count.rb
23
- * bin/process-uptime-metrics.sh
23
+ * bin/metrics-process-uptime.sh
24
24
 
25
25
  ## Usage
26
26
 
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 # rubocop:disable all
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 # rubocop:disable all
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) # rubocop:disable all
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) # rubocop:disable all
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]
@@ -83,7 +83,7 @@ class ThreadsCount < Sensu::Plugin::Check::CLI
83
83
  end
84
84
 
85
85
  # Main function
86
- def run # rubocop:disable all
86
+ def run
87
87
  if !check_proctable_version
88
88
  unknown PROCTABLE_MSG unless check_proctable_version
89
89
  else
@@ -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) # rubocop:disable all
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 # rubocop:disable all
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}`
@@ -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: 'system'
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 # rubocop:disable all
87
+ def run
88
88
  if config[:threads]
89
89
  unknown PROCTABLE_MSG unless check_proctable_version
90
90
  end
@@ -2,7 +2,7 @@ module SensuPluginsProcessChecks
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 4
5
+ PATCH = 5
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  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
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-07-14 00:00:00.000000000 Z
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: '0.30'
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: '0.30'
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.6
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