From: Tom Hughes Date: Fri, 13 Mar 2015 10:57:59 +0000 (+0000) Subject: Configure smartd for LSI FusionMPT disks X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/a3e9ec2a022dffc1afaceeaa6993ec3d3c814086?ds=sidebyside Configure smartd for LSI FusionMPT disks --- diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index eac54e764..80473f779 100644 --- 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"