X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/a68415b8f2bf106b6ea5948b0605c897b516ef4f..0a97a0dc8db53359fee0af041c4608a212b0c30f:/cookbooks/munin/recipes/default.rb diff --git a/cookbooks/munin/recipes/default.rb b/cookbooks/munin/recipes/default.rb index bcd9dd07e..1b4ae6d75 100644 --- a/cookbooks/munin/recipes/default.rb +++ b/cookbooks/munin/recipes/default.rb @@ -17,8 +17,6 @@ # limitations under the License. # -include_recipe "networking" - package "munin-node" service "munin-node" do @@ -164,6 +162,17 @@ end node[:network][:interfaces].each do |ifname, ifattr| if ifattr[:encapsulation] == "Ethernet" && ifattr[:state] == "up" + if node[:hardware] && node[:hardware][:network][ifname][:device] =~ /^virtio/ + munin_plugin_conf "if_#{ifname}" do + template "if.erb" + variables :ifname => ifname + end + else + munin_plugin_conf "if_#{ifname}" do + action :delete + end + end + munin_plugin "if_err_#{ifname}" do target "if_err_" end @@ -282,9 +291,7 @@ Dir.glob("/sys/class/hwmon/hwmon*").each do |hwmon| sensors_volt = true unless Dir.glob("#{hwmon}/in*_input").empty? end -if sensors_fan || sensors_temp || sensors_volt - package "lm-sensors" -end +package "lm-sensors" if sensors_fan || sensors_temp || sensors_volt if sensors_fan munin_plugin "sensors_fan" do