projects
/
chef.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d888767
)
Detect unconfigured and failed disks on megaraid controllers
author
Tom Hughes
<tom@compton.nu>
Wed, 2 Jan 2019 18:15:35 +0000
(18:15 +0000)
committer
Tom Hughes
<tom@compton.nu>
Wed, 2 Jan 2019 18:40:11 +0000
(18:40 +0000)
cookbooks/hardware/templates/default/ohai.rb.erb
patch
|
blob
|
history
diff --git
a/cookbooks/hardware/templates/default/ohai.rb.erb
b/cookbooks/hardware/templates/default/ohai.rb.erb
index 7757dca80d0f70f9132d02a00048eab2462a385e..074f5cbf6e35c624ecda8fe39e7dc3a922df02e2 100644
(file)
--- a/
cookbooks/hardware/templates/default/ohai.rb.erb
+++ b/
cookbooks/hardware/templates/default/ohai.rb.erb
@@
-440,8
+440,10
@@
Ohai.plugin(:Hardware) do
elsif disk && line =~ /^Firmware state:\s+(.*\S)\s*$/
Regexp.last_match(1).split(/,\s*/).each do |state|
case state
elsif disk && line =~ /^Firmware state:\s+(.*\S)\s*$/
Regexp.last_match(1).split(/,\s*/).each do |state|
case state
+ when "Unconfigured(bad)" then disk[:status] = "unconfigured"
when "Online" then disk[:status] = "online"
when "Hotspare" then disk[:status] = "hotspare"
when "Online" then disk[:status] = "online"
when "Hotspare" then disk[:status] = "hotspare"
+ when "Failed" then disk[:status] = "failed"
when "Spun Up" then disk[:spun_down] = false
when "Spun down" then disk[:spun_down] = true
end
when "Spun Up" then disk[:spun_down] = false
when "Spun down" then disk[:spun_down] = true
end
@@
-479,8
+481,10
@@
Ohai.plugin(:Hardware) do
elsif disk && line =~ /^Firmware state:\s+(.*\S)\s*$/
Regexp.last_match(1).split(/,\s*/).each do |state|
case state
elsif disk && line =~ /^Firmware state:\s+(.*\S)\s*$/
Regexp.last_match(1).split(/,\s*/).each do |state|
case state
+ when "Unconfigured(bad)" then disk[:status] = "unconfigured"
when "Online" then disk[:status] = "online"
when "Hotspare" then disk[:status] = "hotspare"
when "Online" then disk[:status] = "online"
when "Hotspare" then disk[:status] = "hotspare"
+ when "Failed" then disk[:status] = "failed"
when "Spun Up" then disk[:state] = "spun_up"
when "Spun down" then disk[:state] = "spun_down"
end
when "Spun Up" then disk[:state] = "spun_up"
when "Spun down" then disk[:state] = "spun_down"
end