From fdd1bdfdaf34a4915e79aad85ad87c0f783e425a Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 13 Mar 2015 17:22:09 +0000 Subject: [PATCH] Configure smartd to monitor disks behind Adaptec controllers --- cookbooks/hardware/recipes/default.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 914ff6d73..92abdf65d 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -302,6 +302,20 @@ if status_packages["sas2ircu-status"] end end +if status_packages["aacraid-status"] + Dir.glob("/sys/class/scsi_host/host*") do |host| + driver = File.new("#{host}/proc_name").read.chomp + + next unless driver == "aacraid" + + bus = host.sub("/sys/class/scsi_host/host", "") + + Dir.glob("/sys/bus/scsi/devices/#{bus}:1:*/scsi_generic/*").each do |sg| + disks << { :device => File.basename(sg) } + end + end +end + if disks.count > 0 package "smartmontools" -- 2.39.5