sensu-plugins-cpu-checks 1.1.3 → 2.0.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 +12 -1
- data/bin/check-cpu.rb +2 -2
- data/bin/metrics-cpu-mpstat.rb +0 -1
- data/bin/metrics-cpu-pcnt-usage.rb +2 -3
- data/bin/metrics-cpu.rb +2 -3
- data/bin/metrics-user-pct-usage.rb +1 -1
- data/lib/sensu-plugins-cpu-checks/version.rb +3 -3
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d427c76d9667d6680f91ba2ae0a6b799e9cf2d5764d51ae64d1c3da9dca3bddd
|
4
|
+
data.tar.gz: 57cb015d1d5b1b8df2eba0d645a6ddb530d5b66735ceba208bc4f961180facfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e1f8766863d6a45b884e7a1d6207445ffc68f61c46d9f33311e95d4bd19b5189708c13f5c6247b841cc459a73b70843620ce36d70c1da5d16fd7afb5ba9fe78
|
7
|
+
data.tar.gz: 34e4c5ca4300e886ceffc58b9ad26c53826a138f28c5dee300965c7190530e44de34e3ae71456a5843f585d86318f6b6f561bbea6bacca3948bfec3dd02f2170
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,16 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [2.0.0] - 2018-03-07
|
9
|
+
### Security
|
10
|
+
- updated rubocop dependency to `~> 0.51.0` per: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8418. (@majormoses)
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
- appeased the cops (@majormoses)
|
14
|
+
|
15
|
+
### Breaking Changes
|
16
|
+
- removed ruby `< 2.1` support (@majormoses)
|
17
|
+
|
8
18
|
## [1.1.3] - 2018-01-25
|
9
19
|
### Added
|
10
20
|
- ruby 2.4 testing (@majormoses)
|
@@ -69,7 +79,8 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
69
79
|
- initial release
|
70
80
|
|
71
81
|
|
72
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-cpu-checks/compare/
|
82
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-cpu-checks/compare/2.0.0...HEAD
|
83
|
+
[2.0.0]: https://github.com/sensu-plugins/sensu-plugins-cpu-checks/compare/1.1.3...2.0.0
|
73
84
|
[1.1.3]: https://github.com/sensu-plugins/sensu-plugins-cpu-checks/compare/1.1.2...1.1.3
|
74
85
|
[1.1.2]: https://github.com/sensu-plugins/sensu-plugins-cpu-checks/compare/1.1.1...1.1.2
|
75
86
|
[1.1.1]: https://github.com/sensu-plugins/sensu-plugins-cpu-checks/compare/1.1.0...1.1.1
|
data/bin/check-cpu.rb
CHANGED
@@ -32,7 +32,7 @@ require 'json'
|
|
32
32
|
# Check CPU
|
33
33
|
#
|
34
34
|
class CheckCPU < Sensu::Plugin::Check::CLI
|
35
|
-
CPU_METRICS = [
|
35
|
+
CPU_METRICS = %i[user nice system idle iowait irq softirq steal guest guest_nice].freeze
|
36
36
|
|
37
37
|
option :less_than,
|
38
38
|
description: 'Change whether value is less than check',
|
@@ -69,7 +69,7 @@ class CheckCPU < Sensu::Plugin::Check::CLI
|
|
69
69
|
long: '--idle-metrics METRICS',
|
70
70
|
description: 'Treat the specified metrics as idle. Defaults to idle,iowait,steal,guest,guest_nice',
|
71
71
|
proc: proc { |x| x.split(/,/).map { |y| y.strip.to_sym } },
|
72
|
-
default: [
|
72
|
+
default: %i[idle iowait steal guest guest_nice]
|
73
73
|
|
74
74
|
CPU_METRICS.each do |metric|
|
75
75
|
option metric,
|
data/bin/metrics-cpu-mpstat.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
|
-
# encoding: UTF-8
|
3
2
|
#
|
4
3
|
# cpu-pct-usage-metrics
|
5
4
|
#
|
@@ -42,7 +41,7 @@ class CpuGraphite < Sensu::Plugin::Metric::CLI::Graphite
|
|
42
41
|
default: '/proc'
|
43
42
|
|
44
43
|
def acquire_proc_stats
|
45
|
-
cpu_metrics = %w
|
44
|
+
cpu_metrics = %w[user nice system idle iowait irq softirq steal guest]
|
46
45
|
File.open("#{config[:proc_path]}/stat", 'r').each_line do |line|
|
47
46
|
info = line.split(/\s+/)
|
48
47
|
next if info.empty?
|
@@ -59,7 +58,7 @@ class CpuGraphite < Sensu::Plugin::Metric::CLI::Graphite
|
|
59
58
|
|
60
59
|
def sum_cpu_metrics(metrics)
|
61
60
|
# #YELLOW
|
62
|
-
metrics.values.reduce { |sum, metric| sum + metric }
|
61
|
+
metrics.values.reduce { |sum, metric| sum + metric }
|
63
62
|
end
|
64
63
|
|
65
64
|
def run
|
data/bin/metrics-cpu.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
|
-
# encoding: UTF-8
|
3
2
|
#
|
4
3
|
# cpu-metrics
|
5
4
|
#
|
@@ -42,8 +41,8 @@ class CpuGraphite < Sensu::Plugin::Metric::CLI::Graphite
|
|
42
41
|
default: '/proc'
|
43
42
|
|
44
43
|
def run
|
45
|
-
cpu_metrics = %w
|
46
|
-
other_metrics = %w
|
44
|
+
cpu_metrics = %w[user nice system idle iowait irq softirq steal guest guest_nice]
|
45
|
+
other_metrics = %w[ctxt processes procs_running procs_blocked btime intr]
|
47
46
|
cpu_count = 0
|
48
47
|
|
49
48
|
File.open("#{config[:proc_path]}/stat", 'r').each_line do |line|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-cpu-checks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.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-
|
11
|
+
date: 2018-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -123,33 +123,33 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '3.2'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: rspec
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: '3.4'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: '3.4'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: rubocop
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: 0.51.0
|
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:
|
152
|
+
version: 0.51.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: yard
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,7 +209,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
209
209
|
requirements:
|
210
210
|
- - ">="
|
211
211
|
- !ruby/object:Gem::Version
|
212
|
-
version: 2.
|
212
|
+
version: '2.1'
|
213
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
214
214
|
requirements:
|
215
215
|
- - ">="
|
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
217
|
version: '0'
|
218
218
|
requirements: []
|
219
219
|
rubyforge_project:
|
220
|
-
rubygems_version: 2.7.
|
220
|
+
rubygems_version: 2.7.6
|
221
221
|
signing_key:
|
222
222
|
specification_version: 4
|
223
223
|
summary: Sensu plugins for cpu checks and metrics
|