sensu-plugins-disk-checks 2.5.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3dcdf8a494bf31a521ed81f321701776a0787fe4f6904daace173daf3f9189ef
4
- data.tar.gz: c6d016ba7250007408f4aacd211f423f2a00d65e3fceaef5fb48793883f5461f
3
+ metadata.gz: 7bf5513d304d4157a83a33571861bb105e35a3f47a867b0d77d6b2c0e0b54037
4
+ data.tar.gz: feafc7c7df2fbd162d34406fc199fa500ce646f41d74601347cc1c9991160936
5
5
  SHA512:
6
- metadata.gz: e4b25651b43fb6a432bc92a6388307e8ef1f492e187049d86a5461cae608d764b64010d53c6f0fa3886b5667c3edc9769343257640f46a244a6f9cbf9f288945
7
- data.tar.gz: f27e711a3201bfe66288a8e5c95e02223c4080706814cf19ef0d6086c7244334d06123dc7d9477da89ebbdaafa65f903eb134a55c2ddfba108ca5a410e259394
6
+ metadata.gz: 8a1536ade75fa3ac7f047fe7bfe8adcbcbea0adeef3c8bef27a32f5b264744934272b8c7c67195674d52002278d48bde7f59ca23a34d344261c85283fe1add10
7
+ data.tar.gz: ed3039e31f4c1ffff1226b9279ad1187e7cf26506395e16002a0d320243be8a934e5dab27d54c0ba1e757d14c1a3ddff988d82cd7f4939933a65e323cea2a47f
@@ -1,13 +1,24 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
- This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
4
+ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [3.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
+ ### Breaking Changes
13
+ - removed ruby `< 2.1` support (@majormoses)
14
+
15
+ ### Changed
16
+ - updated the changelog location guidelines (@majormoses)
17
+ - appeased the cops and created TODOs for refactoring (@majormoses)
18
+
8
19
  ## [2.5.1] - 2017-12-05
9
20
  ### Fixed
10
- - check-disk-usage.rb: now exits unknown instead of critical when retrieving mountpoints fail
21
+ - check-disk-usage.rb: now exits unknown instead of critical when retrieving mountpoints fail (@exeral)
11
22
 
12
23
  ## [2.5.0] - 2017-08-28
13
24
  ### Changed
@@ -160,7 +171,8 @@ https://mathias-kettner.de/checkmk_filesystems.html
160
171
  ### Added
161
172
  - initial release
162
173
 
163
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/2.5.1...HEAD
174
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/3.0.0...HEAD
175
+ [3.0.0]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/2.5.1...3.0.0
164
176
  [2.5.1]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/2.5.0...2.5.1
165
177
  [2.5.0]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/2.4.2...2.5.0
166
178
  [2.4.2]: https://github.com/sensu-plugins/sensu-plugins-disk-checks/compare/2.4.1...2.4.2
@@ -120,7 +120,7 @@ class CheckDisk < Sensu::Plugin::Check::CLI
120
120
  def fs_mounts
121
121
  begin
122
122
  mounts = Filesystem.mounts
123
- rescue
123
+ rescue StandardError
124
124
  unknown 'An error occured getting the mount info'
125
125
  end
126
126
  mounts.each do |line|
@@ -131,7 +131,7 @@ class CheckDisk < Sensu::Plugin::Check::CLI
131
131
  next if config[:ignorepathre] && config[:ignorepathre].match(line.mount_point)
132
132
  next if config[:ignoreopt] && config[:ignoreopt].include?(line.options)
133
133
  next if config[:includemnt] && !config[:includemnt].include?(line.mount_point)
134
- rescue
134
+ rescue StandardError
135
135
  unknown 'An error occured getting the mount info'
136
136
  end
137
137
  check_mount(line)
@@ -150,7 +150,7 @@ class CheckDisk < Sensu::Plugin::Check::CLI
150
150
  def check_mount(line)
151
151
  begin
152
152
  fs_info = Filesystem.stat(line.mount_point)
153
- rescue
153
+ rescue StandardError
154
154
  @warn_fs << "#{line.mount_point} Unable to read."
155
155
  return
156
156
  end
@@ -174,7 +174,7 @@ class SmartCheckStatus < Sensu::Plugin::Check::CLI
174
174
  unless config[:threshold].nil?
175
175
  thresholds = config[:threshold].split(',')
176
176
  # Check threshold parameter length
177
- raise 'Invalid threshold parameter count' unless thresholds.size % 5 == 0
177
+ raise 'Invalid threshold parameter count' unless (thresholds.size % 5).zero?
178
178
 
179
179
  (0..(thresholds.size / 5 - 1)).each do |i|
180
180
  att_id = @smart_attributes.index { |att| att[:id] == thresholds[i + 0].to_i }
@@ -203,7 +203,8 @@ class SmartCheckStatus < Sensu::Plugin::Check::CLI
203
203
  output = {}
204
204
  warnings = []
205
205
  criticals = []
206
- devices.each do |dev|
206
+ # TODO: refactor me
207
+ devices.each do |dev| # rubocop:disable Metrics/BlockLength
207
208
  puts "#{config[:binary]} #{parameters} #{dev.device_path}" if @smart_debug
208
209
  # check if debug file specified
209
210
  if config[:debug_file].nil?
@@ -59,7 +59,7 @@ class Device
59
59
 
60
60
  def selftest_results
61
61
  results = []
62
- headers = %w(num test_description status remaining lifetime lba_of_first_error)
62
+ headers = %w[num test_description status remaining lifetime lba_of_first_error]
63
63
 
64
64
  `sudo #{@exec} -l selftest #{@name}`.split("\n").grep(/^#/).each do |test|
65
65
  test = test.gsub!(/\s\s+/m, "\t").split("\t")
@@ -146,7 +146,8 @@ class CheckSMARTTests < Sensu::Plugin::Check::CLI
146
146
  end
147
147
  end
148
148
 
149
- unless config[:long_test_interval].nil?
149
+ # TODO: refactor me
150
+ unless config[:long_test_interval].nil? # rubocop:disable Style/GuardClause
150
151
  dev.str.each_with_index do |t, i|
151
152
  if t['test_description'] != 'Extended offline'
152
153
  if i == dev.str.length - 1
@@ -1,5 +1,4 @@
1
1
  #! /usr/bin/env ruby
2
- # encoding: UTF-8
3
2
  #
4
3
  # check-smart
5
4
  #
@@ -110,14 +109,14 @@ class CheckSMART < Sensu::Plugin::Check::CLI
110
109
  description: 'Exit code when SMART is unavailable/disabled on a disk',
111
110
  proc: proc(&:to_sym),
112
111
  default: :unknown,
113
- in: %i(unknown ok warn critical)
112
+ in: %i[unknown ok warn critical]
114
113
 
115
114
  option :no_smart_capable_disks,
116
115
  long: '--no-smart-capable-disks EXIT_CODE',
117
116
  description: 'Exit code when there are no SMART capable disks',
118
117
  proc: proc(&:to_sym),
119
118
  default: :unknown,
120
- in: %i(unknown ok warn critical)
119
+ in: %i[unknown ok warn critical]
121
120
 
122
121
  option :binary,
123
122
  short: '-b path/to/smartctl',
@@ -170,10 +169,12 @@ class CheckSMART < Sensu::Plugin::Check::CLI
170
169
  # Main function
171
170
  #
172
171
  def run
173
- exit_with(
174
- config[:no_smart_capable_disks],
175
- 'No SMART capable devices found'
176
- ) unless @devices.length > 0
172
+ unless @devices.length > 0
173
+ exit_with(
174
+ config[:no_smart_capable_disks],
175
+ 'No SMART capable devices found'
176
+ )
177
+ end
177
178
 
178
179
  unhealthy_disks = @devices.select { |disk| disk.smart_capable? && !disk.healthy? }
179
180
  unknown_disks = @devices.reject(&:smart_capable?)
@@ -1,5 +1,4 @@
1
1
  #! /usr/bin/env ruby
2
- # encoding: UTF-8
3
2
  #
4
3
  # disk-capacity-metrics
5
4
  #
@@ -78,7 +77,7 @@ class DiskCapacity < Sensu::Plugin::Metric::CLI::Graphite
78
77
  end
79
78
  end
80
79
  end
81
- rescue
80
+ rescue StandardError
82
81
  unknown "malformed line from df: #{line}"
83
82
  end
84
83
  end
@@ -104,7 +103,7 @@ class DiskCapacity < Sensu::Plugin::Metric::CLI::Graphite
104
103
  end
105
104
  end
106
105
  end
107
- rescue
106
+ rescue StandardError
108
107
  unknown "malformed line from df: #{line}"
109
108
  end
110
109
  end
@@ -1,5 +1,4 @@
1
1
  #! /usr/bin/env ruby
2
- # encoding: UTF-8
3
2
  #
4
3
  # disk-usage-metrics
5
4
  #
@@ -1,5 +1,4 @@
1
1
  #! /usr/bin/env ruby
2
- # encoding: UTF-8
3
2
  #
4
3
  # disk-metrics
5
4
  #
@@ -66,7 +65,7 @@ class DiskGraphite < Sensu::Plugin::Metric::CLI::Graphite
66
65
  # Main function
67
66
  def run
68
67
  # http://www.kernel.org/doc/Documentation/iostats.txt
69
- metrics = %w(reads readsMerged sectorsRead readTime writes writesMerged sectorsWritten writeTime ioInProgress ioTime ioTimeWeighted)
68
+ metrics = %w[reads readsMerged sectorsRead readTime writes writesMerged sectorsWritten writeTime ioInProgress ioTime ioTimeWeighted]
70
69
 
71
70
  File.open('/proc/diskstats', 'r').each_line do |line|
72
71
  stats = line.strip.split(/\s+/)
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsDiskChecks
2
2
  module Version
3
- MAJOR = 2
4
- MINOR = 5
5
- PATCH = 1
3
+ MAJOR = 3
4
+ MINOR = 0
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-disk-checks
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 3.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: 2017-12-06 00:00:00.000000000 Z
11
+ date: 2018-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.40.0
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: 0.40.0
152
+ version: 0.51.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: yard
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -212,7 +212,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - ">="
214
214
  - !ruby/object:Gem::Version
215
- version: 2.0.0
215
+ version: '2.1'
216
216
  required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  requirements:
218
218
  - - ">="
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  version: '0'
221
221
  requirements: []
222
222
  rubyforge_project:
223
- rubygems_version: 2.7.3
223
+ rubygems_version: 2.7.6
224
224
  signing_key:
225
225
  specification_version: 4
226
226
  summary: Sensu plugins for disk checks