]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/munin/recipes/default.rb
Override network speed to virtio interfaces
[chef.git] / cookbooks / munin / recipes / default.rb
index 677d79d5ea3a1cb8e148df88df3bda1c58f44fc4..fb98079315f593c6c5a70350ad3e54815067a2be 100644 (file)
@@ -162,6 +162,17 @@ end
 
 node[:network][:interfaces].each do |ifname, ifattr|
   if ifattr[:encapsulation] == "Ethernet" && ifattr[:state] == "up"
 
 node[:network][:interfaces].each do |ifname, ifattr|
   if ifattr[:encapsulation] == "Ethernet" && ifattr[:state] == "up"
+    if 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
     munin_plugin "if_err_#{ifname}" do
       target "if_err_"
     end