sensu-plugins-raid-checks 2.0.0 → 2.0.1
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 +5 -5
- data/CHANGELOG.md +8 -0
- data/bin/check-3ware-status.rb +4 -2
- data/bin/check-megaraid-sas-status.rb +3 -1
- data/bin/check-mpt2sas-status.rb +2 -0
- data/bin/check-raid.rb +61 -64
- data/bin/check-smart-array-status.rb +3 -1
- data/lib/sensu-plugins-raid-checks.rb +2 -0
- data/lib/sensu-plugins-raid-checks/version.rb +3 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5a807491188351610c1d92f61ffdf6453c34c51de3bd1d73f68d15a1dcb00a82
|
4
|
+
data.tar.gz: 42e2aa80eb09c459902a41d6c8359666b5a43e37436b44b9759e41a95eec73e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e63a5f13dcac901435fb91f7a64e72d07caf8eed21f1813c6d579f322050b39f0747eec11e8e64227299306260738c5e7b36fd77fcd5d1a37629f266f36d96f0
|
7
|
+
data.tar.gz: c9d7eed41e4372d708693bf39f6954ba7374642770d9ae973b184c5ad5f103adfac9049f1bcbdd28360753de01b495148300cb83b6dcd6171010828809e4f682
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,13 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [2.0.1] - 2017-01-31
|
10
|
+
### Security
|
11
|
+
- updated rubocop dependency to `~> 0.51.0` per: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8418. (@majormoses)
|
12
|
+
|
13
|
+
### Changed
|
14
|
+
- appeased the cops (@majormoses)
|
15
|
+
|
9
16
|
## [2.0.0] - 2017-12-28
|
10
17
|
### Breaking Change
|
11
18
|
- `check-raid.rb`: added option `--log` with a default of `false` to prevent it default creating a log which is frequently being written to and filling up the disk. This does the *opposite* of what the vendor defaults are but due to the nature of those running it through a monitoring solution like sensu the defaults do not make sense in this use case. If you are wanting those logs you can change this to `true` to keep existing behavior. (@dhpowrhost) (@smbambling)
|
@@ -56,6 +63,7 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
|
56
63
|
- initial release
|
57
64
|
|
58
65
|
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-raid-checks/compare/2.0.0...HEAD
|
66
|
+
[2.0.1]: https://github.com/sensu-plugins/sensu-plugins-raid-checks/compare/2.0.0...2.0.1
|
59
67
|
[2.0.0]: https://github.com/sensu-plugins/sensu-plugins-raid-checks/compare/1.0.0...2.0.0
|
60
68
|
[1.0.0]: https://github.com/sensu-plugins/sensu-plugins-raid-checks/compare/0.1.0...1.0.0
|
61
69
|
[0.1.0]: https://github.com/sensu-plugins/sensu-plugins-raid-checks/compare/0.0.4...0.1.0
|
data/bin/check-3ware-status.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# check-raid
|
4
6
|
#
|
@@ -82,7 +84,7 @@ class Check3wareStatus < Sensu::Plugin::Check::CLI
|
|
82
84
|
data.lines.each do |line|
|
83
85
|
unless line.empty?
|
84
86
|
controller = line.split[0]
|
85
|
-
@controllers << controller if /^c[0-9]+$/
|
87
|
+
@controllers << controller if controller.match?(/^c[0-9]+$/)
|
86
88
|
end
|
87
89
|
end
|
88
90
|
end
|
@@ -97,7 +99,7 @@ class Check3wareStatus < Sensu::Plugin::Check::CLI
|
|
97
99
|
data.lines.each do |line|
|
98
100
|
unless line.empty?
|
99
101
|
splitted = line.split
|
100
|
-
if /^[p][0-9]+$/
|
102
|
+
if splitted.first.match?(/^[p][0-9]+$/)
|
101
103
|
# '-' means the drive doesn't belong to any array
|
102
104
|
# If is NOT PRESENT too, it just means this is an empty port
|
103
105
|
status = splitted[1]
|
@@ -1,4 +1,6 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# check-raid
|
4
6
|
#
|
@@ -56,7 +58,7 @@ class CheckMegaRAID < Sensu::Plugin::Check::CLI
|
|
56
58
|
(0..$CHILD_STATUS.exitstatus - 1).each do |i|
|
57
59
|
# and check them in turn
|
58
60
|
stdout = `#{config[:megaraidcmd]} -LDInfo -L#{i} -a#{config[:controller]} `
|
59
|
-
unless Regexp.new('State\s*:\s*Optimal').match(stdout)
|
61
|
+
unless Regexp.new('State\s*:\s*Optimal').match?(stdout)
|
60
62
|
error = sprintf '%svirtual drive %d: %s ', error, i, stdout[/State\s*:\s*.*/].split(':')[1] # rubocop:disable Style/FormatString
|
61
63
|
have_error = true
|
62
64
|
end
|
data/bin/check-mpt2sas-status.rb
CHANGED
data/bin/check-raid.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# check-raid
|
4
6
|
#
|
@@ -38,97 +40,92 @@ class CheckRaid < Sensu::Plugin::Check::CLI
|
|
38
40
|
default: false
|
39
41
|
# Check software raid
|
40
42
|
#
|
41
|
-
def
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
end
|
52
|
-
end
|
43
|
+
def check_software_raid
|
44
|
+
return unless File.exist?('/proc/mdstat')
|
45
|
+
contents = File.read('/proc/mdstat')
|
46
|
+
mg = contents.lines.grep(/active|blocks/)
|
47
|
+
return unless mg.empty?
|
48
|
+
sg = mg.to_s.lines.grep(/\]\(F\)|[\[U]_/)
|
49
|
+
if sg.empty?
|
50
|
+
ok 'Software RAID OK'
|
51
|
+
else
|
52
|
+
warning 'Software RAID warning'
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
56
|
# Check HP raid
|
57
57
|
#
|
58
58
|
def check_hp
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
end
|
59
|
+
return unless File.exist?('/usr/bin/cciss_vol_status')
|
60
|
+
contents = `/usr/bin/cciss_vol_status /dev/sg0`
|
61
|
+
c = contents.lines.grep(/status\: OK\./)
|
62
|
+
# #YELLOW
|
63
|
+
if c.empty?
|
64
|
+
warning 'HP RAID warning'
|
65
|
+
else
|
66
|
+
ok 'HP RAID OK'
|
68
67
|
end
|
69
68
|
end
|
70
69
|
|
71
70
|
# Check Adaptec raid controllers
|
72
71
|
#
|
73
72
|
def check_adaptec
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
mg = contents.lines.grep(/Controller Status/)
|
78
|
-
# #YELLOW
|
79
|
-
unless mg.empty? # rubocop:disable UnlessElse
|
80
|
-
sg = mg.to_s.lines.grep(/Optimal/)
|
81
|
-
warning 'Adaptec Physical RAID Controller Failure' if sg.empty?
|
82
|
-
else
|
83
|
-
warning 'Adaptec Physical RAID Controller Status Read Failure'
|
84
|
-
end
|
73
|
+
return unless File.exist?('/usr/StorMan/arcconf')
|
74
|
+
contents = `/usr/StorMan/arcconf GETCONFIG 1 AL`
|
85
75
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
76
|
+
mg = contents.lines.grep(/Controller Status/)
|
77
|
+
# #YELLOW
|
78
|
+
if mg.empty?
|
79
|
+
warning 'Adaptec Physical RAID Controller Status Read Failure'
|
80
|
+
else
|
81
|
+
sg = mg.to_s.lines.grep(/Optimal/)
|
82
|
+
warning 'Adaptec Physical RAID Controller Failure' if sg.empty?
|
83
|
+
end
|
94
84
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
85
|
+
mg = contents.lines.grep(/Status of logical device/)
|
86
|
+
# #YELLOW
|
87
|
+
if mg.empty?
|
88
|
+
warning 'Adaptec Logical RAID Controller Status Read Failure'
|
89
|
+
else
|
90
|
+
sg = mg.to_s.lines.grep(/Optimal/)
|
91
|
+
warning 'Adaptec Logical RAID Controller Failure' if sg.empty?
|
92
|
+
end
|
103
93
|
|
104
|
-
|
94
|
+
mg = contents.lines.grep(/S\.M\.A\.R\.T\. /)
|
95
|
+
# #YELLOW
|
96
|
+
if mg.empty?
|
97
|
+
warning 'Adaptec S.M.A.R.T. Status Read Failure'
|
98
|
+
else
|
99
|
+
sg = mg.to_s.lines.grep(/No/)
|
100
|
+
warning 'Adaptec S.M.A.R.T. Disk Failed' if sg.empty?
|
105
101
|
end
|
102
|
+
|
103
|
+
ok 'Adaptec RAID OK'
|
106
104
|
end
|
107
105
|
|
108
106
|
# Check Megaraid
|
109
107
|
#
|
110
108
|
def check_mega_raid
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
end
|
109
|
+
return unless File.exist?('/usr/sbin/megacli')
|
110
|
+
contents = if config[:log]
|
111
|
+
`/usr/sbin/megacli -AdpAllInfo -aALL`
|
112
|
+
else
|
113
|
+
`/usr/sbin/megacli -AdpAllInfo -aALL -NoLog`
|
114
|
+
end
|
115
|
+
failed = contents.lines.grep(/(Critical|Failed) Disks\s+\: 0/)
|
116
|
+
degraded = contents.lines.grep(/Degraded\s+\: 0/)
|
117
|
+
# #YELLOW
|
118
|
+
if failed.empty? || degraded.empty?
|
119
|
+
warning 'MegaRaid RAID warning'
|
120
|
+
else
|
121
|
+
ok 'MegaRaid RAID OK'
|
125
122
|
end
|
126
123
|
end
|
127
124
|
|
128
125
|
# Main function
|
129
126
|
#
|
130
127
|
def run
|
131
|
-
|
128
|
+
check_software_raid
|
132
129
|
unless `lspci`.lines.grep(/RAID/).empty?
|
133
130
|
check_hp
|
134
131
|
check_adaptec
|
@@ -1,4 +1,6 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# check-smart-array-status
|
4
6
|
#
|
@@ -85,7 +87,7 @@ class CheckSmartArrayStatus < Sensu::Plugin::Check::CLI
|
|
85
87
|
data.lines.each do |line|
|
86
88
|
unless line.empty?
|
87
89
|
splitted = line.split
|
88
|
-
if /^physicaldrive$/
|
90
|
+
if splitted.first.match?(/^physicaldrive$/)
|
89
91
|
status = splitted[-1]
|
90
92
|
disk = 'ctrl ' + controller + ' ' + line.strip
|
91
93
|
if status == 'OK'
|
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.1
|
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: 2018-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: english
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 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.
|
152
|
+
version: 0.51.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: yard
|
155
155
|
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-smart-array-status.rb
|
174
|
-
- check-mpt2sas-status.rb
|
175
|
-
- check-megaraid-sas-status.rb
|
176
173
|
- check-3ware-status.rb
|
174
|
+
- check-megaraid-sas-status.rb
|
175
|
+
- check-mpt2sas-status.rb
|
177
176
|
- check-raid.rb
|
177
|
+
- check-smart-array-status.rb
|
178
178
|
extensions: []
|
179
179
|
extra_rdoc_files: []
|
180
180
|
files:
|
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
214
214
|
version: '0'
|
215
215
|
requirements: []
|
216
216
|
rubyforge_project:
|
217
|
-
rubygems_version: 2.
|
217
|
+
rubygems_version: 2.7.4
|
218
218
|
signing_key:
|
219
219
|
specification_version: 4
|
220
220
|
summary: Sensu plugins for working with raid evices
|