sensu-plugins-raid-checks 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/bin/check-megaraid-sas-status.rb +13 -4
- data/lib/sensu-plugins-raid-checks/version.rb +1 -1
- metadata +11 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ceab50cad9486cfca8dec249de788cfc0da6a02e5d4011caf1b252264410c420
|
4
|
+
data.tar.gz: ecd2efa942a99f8999fdd4a8c8ef2351205eb75f95073bde27d4fa50b4327fc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cb3f077d5fcc1780435d7a9cc07b5e32a4adca07b4b0b7568b3aa3a89d153754e4063c2067c9ac5683ef2406aa6eab4dd35a54a01e46873c3ae6f7f072a7778
|
7
|
+
data.tar.gz: e31065cab845fcbb406d21ba6c88f7cae17b2d7c2210f9c8f79a244de85f7cc3e71ca6402114550ac5dff2f09d0693fe79f9881014fd81fa9baf24006c67f944
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [2.0.3] - 2019-02-17
|
10
|
+
### Fixed
|
11
|
+
- `check-megaraid-sas-status.rb`: Fixed logic error in which it was assumed that all virtual drives were in sequential order. Also fixed pattern matching when parsing individual drive status. (@SeanSith)
|
12
|
+
|
9
13
|
## [2.0.2] - 2018-04-18
|
10
14
|
### Fixed
|
11
15
|
- fixed software raid check (@corro)
|
@@ -66,7 +70,8 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
|
66
70
|
### Added
|
67
71
|
- initial release
|
68
72
|
|
69
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-raid-checks/compare/2.0.
|
73
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-raid-checks/compare/2.0.3...HEAD
|
74
|
+
[2.0.3]: https://github.com/sensu-plugins/sensu-plugins-raid-checks/compare/2.0.2...2.0.3
|
70
75
|
[2.0.2]: https://github.com/sensu-plugins/sensu-plugins-raid-checks/compare/2.0.1...2.0.2
|
71
76
|
[2.0.1]: https://github.com/sensu-plugins/sensu-plugins-raid-checks/compare/2.0.0...2.0.1
|
72
77
|
[2.0.0]: https://github.com/sensu-plugins/sensu-plugins-raid-checks/compare/1.0.0...2.0.0
|
@@ -53,12 +53,21 @@ class CheckMegaRAID < Sensu::Plugin::Check::CLI
|
|
53
53
|
def run
|
54
54
|
have_error = false
|
55
55
|
error = ''
|
56
|
-
# get
|
57
|
-
`#{config[:megaraidcmd]} -
|
58
|
-
|
56
|
+
# get list of virtual drives
|
57
|
+
stdout = `#{config[:megaraidcmd]} -LDInfo -LALL -a#{config[:controller]} `.split("\n")
|
58
|
+
virtual_drives = []
|
59
|
+
stdout.each do |line|
|
60
|
+
if line =~ /^Virtual Drive:/
|
61
|
+
virtual_drives << line.gsub(/^Virtual Drive: (\d+) .*$/, '\1')
|
62
|
+
end
|
63
|
+
end
|
64
|
+
virtual_drives.each do |i|
|
59
65
|
# and check them in turn
|
60
66
|
stdout = `#{config[:megaraidcmd]} -LDInfo -L#{i} -a#{config[:controller]} `
|
61
|
-
|
67
|
+
# TODO: once we drop ruby 2.3 support change this to `.match?(stdout)`
|
68
|
+
# this reduces memory consumption as we don't care about the output in this conditional just whether or not it matches.
|
69
|
+
# The `.match?()` function was introduced in 2.4
|
70
|
+
unless Regexp.new(/State\s+:\s+Optimal/).match(stdout)
|
62
71
|
error = sprintf '%svirtual drive %d: %s ', error, i, stdout[/State\s*:\s*.*/].split(':')[1] # rubocop:disable Style/FormatString
|
63
72
|
have_error = true
|
64
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-raid-checks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
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:
|
11
|
+
date: 2019-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: english
|
@@ -58,28 +58,28 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0
|
61
|
+
version: '1.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0
|
68
|
+
version: '1.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: github-markup
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '3.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '3.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: pry
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '12.3'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '12.3'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: redcarpet
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,11 +170,11 @@ description: |-
|
|
170
170
|
controller/array health
|
171
171
|
email: "<sensu-users@googlegroups.com>"
|
172
172
|
executables:
|
173
|
+
- check-mpt2sas-status.rb
|
173
174
|
- check-3ware-status.rb
|
175
|
+
- check-smart-array-status.rb
|
174
176
|
- check-megaraid-sas-status.rb
|
175
|
-
- check-mpt2sas-status.rb
|
176
177
|
- check-raid.rb
|
177
|
-
- check-smart-array-status.rb
|
178
178
|
extensions: []
|
179
179
|
extra_rdoc_files: []
|
180
180
|
files:
|
@@ -213,8 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
213
|
- !ruby/object:Gem::Version
|
214
214
|
version: '0'
|
215
215
|
requirements: []
|
216
|
-
|
217
|
-
rubygems_version: 2.7.6
|
216
|
+
rubygems_version: 3.0.2
|
218
217
|
signing_key:
|
219
218
|
specification_version: 4
|
220
219
|
summary: Sensu plugins for working with raid evices
|