From: Tom Hughes Date: Fri, 31 May 2013 18:06:58 +0000 (+0100) Subject: Configure munin monitoring of sensors X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/7254fd5015a4c44b364202985bcbbd0ccca810f3 Configure munin monitoring of sensors --- diff --git a/cookbooks/munin/recipes/default.rb b/cookbooks/munin/recipes/default.rb index 775acc095..fca04dfeb 100644 --- a/cookbooks/munin/recipes/default.rb +++ b/cookbooks/munin/recipes/default.rb @@ -231,7 +231,41 @@ munin_plugin "processes" munin_plugin "proc_pri" # renderd_ # replication_delay -# sensors_ + +Dir.glob("/sys/class/hwmon/hwmon*").each do |hwmon| + hwmon = "#{hwmon}/device" unless File.exists?("#{hwmon}/name") + + if Dir.glob("#{hwmon}/fan*_input").empty? + munin_plugin "sensors_fan" do + action :delete + end + else + munin_plugin "sensors_fan" do + target "sensors_" + end + end + + if Dir.glob("#{hwmon}/temp*_input").empty? + munin_plugin "sensors_temp" do + action :delete + end + else + munin_plugin "sensors_temp" do + target "sensors_" + end + end + + if Dir.glob("#{hwmon}/in*_input").empty? + munin_plugin "sensors_volt" do + action :delete + end + else + munin_plugin "sensors_volt" do + target "sensors_" + end + end +end + # smart_ # squid_ munin_plugin "swap"