X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/6a91072ee77724069f37eefdde66fd50bfa9da00..10e1976e6e9fd98e058831e93fbec2eafd9c8167:/cookbooks/hardware/recipes/default.rb?ds=sidebyside diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index d4c8d0470..d95825669 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -368,7 +368,7 @@ if tools_packages.include?("areca") end disks.each do |disk| - if disk[:device] =~ /^cciss\/(.*)$/ + if disk[:device] =~ %r{^cciss/(.*)$} id = File.read("/sys/bus/cciss/devices/#{Regexp.last_match[1]}/unique_id").chomp disk[:munin] = "cciss-3#{id.downcase}" @@ -405,6 +405,7 @@ if disks.count > 0 service "smartmontools" do action [:enable, :start] + supports :status => true, :restart => true, :reload => true end disks.each do |disk| @@ -430,7 +431,7 @@ else end plugins = Dir.glob("/etc/munin/plugins/smart_*").map { |p| File.basename(p) } - - disks.map { |d| "smart_#{d[:munin_name]}" } + disks.map { |d| "smart_#{d[:munin]}" } plugins.each do |plugin| munin_plugin plugin do