next unless driver == "megaraid_sas"
- device = host.sub("/sys/class/scsi_host/host", "bus/")
+ bus = host.sub("/sys/class/scsi_host/host", "")
+ device = File.basename(Dir.glob("/sys/bus/scsi/devices/#{bus}:*/scsi_generic/*").first)
IO.popen(["megacli", "-PDList", "-a#{controller}", "-NoLog"]).each do |line|
disks << { :device => device, :driver => "megaraid", :id => Regexp.last_match[1] } if line =~ /^Device Id: ([0-9]+)$/
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"