]> git.openstreetmap.org Git - chef.git/commitdiff
Handle smartd for older Fusion-MPT controllers
authorTom Hughes <tom@compton.nu>
Sat, 14 Mar 2015 00:31:55 +0000 (00:31 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 14 Mar 2015 00:31:55 +0000 (00:31 +0000)
cookbooks/hardware/recipes/default.rb

index 29a1fcd1eb3d2ce35a00cc76fe2a6573fbb58a93..d4c8d047037dc6650c7c52c1c7a90620cfd61dcb 100644 (file)
@@ -306,6 +306,20 @@ if status_packages["megaclisas-status"]
   end
 end
 
+if tools_packages.include?("lsiutil")
+  Dir.glob("/sys/class/scsi_host/host*") do |host|
+    driver = File.new("#{host}/proc_name").read.chomp
+
+    next unless driver == "mptsas"
+
+    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 status_packages["sas2ircu-status"]
   Dir.glob("/sys/class/scsi_host/host*") do |host|
     driver = File.new("#{host}/proc_name").read.chomp