projects
/
chef.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5772f3e
)
Configure smartd for LSI FusionMPT disks
author
Tom Hughes
<tom@compton.nu>
Fri, 13 Mar 2015 10:57:59 +0000
(10:57 +0000)
committer
Tom Hughes
<tom@compton.nu>
Fri, 13 Mar 2015 10:57:59 +0000
(10:57 +0000)
cookbooks/hardware/recipes/default.rb
patch
|
blob
|
history
diff --git
a/cookbooks/hardware/recipes/default.rb
b/cookbooks/hardware/recipes/default.rb
index eac54e7648043b006d0aa39b2009a43529cfd4d0..80473f779e1f36a8395ca1f0d4799f81b033a2f2 100644
(file)
--- a/
cookbooks/hardware/recipes/default.rb
+++ b/
cookbooks/hardware/recipes/default.rb
@@
-285,6
+285,20
@@
if status_packages["megaclisas-status"]
end
end
+if status_packages["sas2ircu-status"]
+ Dir.glob("/sys/class/scsi_host/host*") do |host|
+ driver = File.new("#{host}/proc_name").read.chomp
+
+ next unless driver == "mpt2sas"
+
+ bus = host.sub("/sys/class/scsi_host/host", "")
+
+ Dir.glob("/sys/bus/scsi/devices/#{bus}:0:*/scsi_generic/*").each do |sg|
+ disks << { :device => File.basename(sg) }
+ end
+ end
+end
+
if disks.count > 0
package "smartmontools"