sensu-plugins-process-checks 3.0.2 → 3.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
  SHA256:
3
- metadata.gz: d7d96075bfa12a8e5594f733920c38c45fd4a54fcd992191f73fb921d4e44a47
4
- data.tar.gz: 9aa70847d5f8c6dd30067d44ea2e002c660a00d1b572489d6648e785dfc29260
3
+ metadata.gz: c84badbc2308dec8746d549464c77445f7974c0aaf0e44f407e5264333654594
4
+ data.tar.gz: 0a6be9fe7ec034002ff7330c217d94700cf04ba1a92ed5372885b1c71d651555
5
5
  SHA512:
6
- metadata.gz: 215c720d7bc9764bb9223f6ee161c10965b1e640ce3e8dd4180bea7ec600ea03d375e12645b0b3845ef6f2e0071dc01761d4e2c17ea49f95798a8ffd2cdb78e5
7
- data.tar.gz: 283ccb1cbcd5bc732fedcfae32e12fe02fed7eda1efb08bf32aacb8b8f5c0e07a5b4ad0a0ae278b8d2c007397c9b323467f33c242df2c2ebda3163a2124e152c
6
+ metadata.gz: e21f9d5f026129434aa2803f26187d8e6ef84cfbf36d198ccff2cb88c612e215b1420f4204627a1d86026271871f3dccca7dea5f882ac855145a69bb3096335b
7
+ data.tar.gz: 0327f36aee33c447a4391980eb465c568c893fe7fa762698d47e13ac392211459498fb70d9c93621173ad5ea50127464fc6189f53ef400986036caf5f654a871
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [3.1.0] - 2018-05-02
10
+ ### Added
11
+ - metrics-ipcs.rb: Add ipcs metrics (@yuri-zubov sponsored by Actility, https://www.actility.com)
12
+
9
13
  ## [3.0.2] - 2018-03-27
10
14
  ### Security
11
15
  - updated yard dependency to `~> 0.9.11` per: https://nvd.nist.gov/vuln/detail/CVE-2017-17042 (@majormoses)
@@ -178,7 +182,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
178
182
  - built against 1.9.3, 2.0, 2.1
179
183
  - cryptographically signed
180
184
 
181
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/3.0.2...HEAD
185
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/3.1.0...HEAD
186
+ [3.1.0]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/3.0.2...3.1.0
182
187
  [3.0.2]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/3.0.1...3.0.2
183
188
  [3.0.1]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/3.0.0...3.0.1
184
189
  [3.0.0]: https://github.com/sensu-plugins/sensu-plugins-process-checks/compare/2.7.0...3.0.0
@@ -0,0 +1,70 @@
1
+ #! /usr/bin/env ruby
2
+ #
3
+ # metrics-ipcs
4
+ #
5
+ # DESCRIPTION:
6
+ # metrics-ipcs get metrics from ipcs
7
+ #
8
+ # OUTPUT:
9
+ # metric-data
10
+ #
11
+ # PLATFORMS:
12
+ # Linux
13
+ #
14
+ # DEPENDENCIES:
15
+ #
16
+ # USAGE:
17
+ #
18
+ #
19
+ # NOTES:
20
+ #
21
+ # LICENSE:
22
+ # Zubov Yuri <yury.zubau@gmail.com> sponsored by Actility, https://www.actility.com
23
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
24
+ # for details.
25
+ #
26
+
27
+ require 'sensu-plugin/metric/cli'
28
+ require 'open3'
29
+ require 'socket'
30
+
31
+ class MetricsIPCS < Sensu::Plugin::Metric::CLI::Graphite
32
+ option :scheme,
33
+ description: 'Metric naming scheme, text to prepend to metric',
34
+ short: '-s SCHEME',
35
+ long: '--scheme SCHEME',
36
+ default: "#{Socket.gethostname}.ipcs"
37
+
38
+ def run_ipcs
39
+ stdout, result = Open3.capture2('ipcs -u')
40
+ unknown 'Unable to get ipcs' unless result.success?
41
+ stdout
42
+ end
43
+
44
+ def run
45
+ ipcs_status = run_ipcs
46
+
47
+ found = false
48
+ index = -1
49
+ key = nil
50
+ ipcs_status.each_line do |line|
51
+ next unless line.match(/[[:space:]]*------/) ... (line == "\n")
52
+ if line.strip == ''
53
+ index = -1
54
+ else
55
+ index += 1
56
+ end
57
+ if index.zero? || index < 0
58
+ key = line.tr("-\n", '').strip.tr(' ', '-').downcase
59
+ else
60
+ result = line.match(/[[:space:]]*(?<name>[a-zA-Z ]*).*(?<value>\d+)/)
61
+ output "#{config[:scheme]}.#{key}.#{result[:name].strip.tr(' ', '-')}", result[:value].strip
62
+ end
63
+ end
64
+ if found
65
+ ok
66
+ else
67
+ critical('Not found')
68
+ end
69
+ end
70
+ end
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsProcessChecks
2
2
  module Version
3
3
  MAJOR = 3
4
- MINOR = 0
5
- PATCH = 2
4
+ MINOR = 1
5
+ PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-process-checks
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.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: 2018-03-27 00:00:00.000000000 Z
11
+ date: 2018-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: english
@@ -142,14 +142,28 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '3.1'
145
+ version: '3.7'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '3.1'
152
+ version: '3.7'
153
+ - !ruby/object:Gem::Dependency
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'
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: rubocop
155
169
  requirement: !ruby/object:Gem::Requirement
@@ -188,6 +202,7 @@ executables:
188
202
  - check-process-restart.rb
189
203
  - check-process.rb
190
204
  - check-threads-count.rb
205
+ - metrics-ipcs.rb
191
206
  - metrics-per-process.rb
192
207
  - metrics-process-status.rb
193
208
  - metrics-process-uptime.rb
@@ -202,6 +217,7 @@ files:
202
217
  - bin/check-process-restart.rb
203
218
  - bin/check-process.rb
204
219
  - bin/check-threads-count.rb
220
+ - bin/metrics-ipcs.rb
205
221
  - bin/metrics-per-process.py
206
222
  - bin/metrics-per-process.rb
207
223
  - bin/metrics-process-status.rb