]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Configure smartd to monitor disks behind Adaptec controllers
[chef.git] / cookbooks / hardware / recipes / default.rb
index 914ff6d73e183c73bb958d5d41d92f2e27f626ae..92abdf65dfdc0c1665f0a346662a6105cb42f73d 100644 (file)
@@ -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"