Handle smartd for older Fusion-MPT controllers
[chef.git] / 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