From: Tom Hughes Date: Sat, 14 Mar 2015 00:31:55 +0000 (+0000) Subject: Handle smartd for older Fusion-MPT controllers X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/6a91072ee77724069f37eefdde66fd50bfa9da00 Handle smartd for older Fusion-MPT controllers --- diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 29a1fcd1e..d4c8d0470 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -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