projects
/
chef.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
75df66b
)
Configure smartd to monitor disks behind Adaptec controllers
author
Tom Hughes
<tom@compton.nu>
Fri, 13 Mar 2015 17:22:09 +0000
(17:22 +0000)
committer
Tom Hughes
<tom@compton.nu>
Fri, 13 Mar 2015 17:22:09 +0000
(17:22 +0000)
cookbooks/hardware/recipes/default.rb
patch
|
blob
|
history
diff --git
a/cookbooks/hardware/recipes/default.rb
b/cookbooks/hardware/recipes/default.rb
index 914ff6d73e183c73bb958d5d41d92f2e27f626ae..92abdf65dfdc0c1665f0a346662a6105cb42f73d 100644
(file)
--- 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"