From: Tom Hughes Date: Sun, 9 Oct 2016 21:25:49 +0000 (+0100) Subject: Override network speed to virtio interfaces X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/45479cd73476809c38704ab5f221c16c86504f2f Override network speed to virtio interfaces --- diff --git a/cookbooks/munin/recipes/default.rb b/cookbooks/munin/recipes/default.rb index 677d79d5e..fb9807931 100644 --- a/cookbooks/munin/recipes/default.rb +++ b/cookbooks/munin/recipes/default.rb @@ -162,6 +162,17 @@ end 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 diff --git a/cookbooks/munin/templates/default/if.erb b/cookbooks/munin/templates/default/if.erb new file mode 100644 index 000000000..1f36d5042 --- /dev/null +++ b/cookbooks/munin/templates/default/if.erb @@ -0,0 +1,4 @@ +# DO NOT EDIT - This file is being maintained by Chef + +[if_<%= @ifname %>] +env.speed 1000