From: Tom Hughes Date: Wed, 22 Jan 2014 00:41:00 +0000 (+0000) Subject: Configure HDD temperature monitoring for all directly attached disks X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/c6737f1aca60955a8081e7e94969a21de73a589f?ds=sidebyside Configure HDD temperature monitoring for all directly attached disks --- diff --git a/cookbooks/munin/recipes/default.rb b/cookbooks/munin/recipes/default.rb index e83cac6f6..0f6c67d86 100644 --- a/cookbooks/munin/recipes/default.rb +++ b/cookbooks/munin/recipes/default.rb @@ -124,7 +124,20 @@ else end end -# hddtemp_smartctl +disks = node[:block_device].select do |name,attributes| + [ "ATA", "FUJITSU", "SEAGATE", "DELL", "COMPAQ", "IBM-ESXS" ].include?(attributes[:vendor]) +end + +if disks.empty? + munin_plugin "hddtemp_smartctl" do + action :delete + end +else + munin_plugin "hddtemp_smartctl" do + conf "hddtemp.erb" + conf_variables :disks => disks + end +end if File.exists?("/sbin/hpasmcli") munin_plugin "hpasmcli_temp" diff --git a/cookbooks/munin/templates/default/hddtemp.erb b/cookbooks/munin/templates/default/hddtemp.erb new file mode 100644 index 000000000..36a8bb5fb --- /dev/null +++ b/cookbooks/munin/templates/default/hddtemp.erb @@ -0,0 +1,4 @@ +# DO NOT EDIT - This file is being maintained by Chef + +[hddtemp_smartctl] +env.drives <%= @disks.keys.sort.join(" ") %>