From 41140b569c7401130afc08c91554e57688ef9b91 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 29 Jan 2015 20:46:04 +0000 Subject: [PATCH] Manage all ethernet interfaces for munin, regardless of name --- cookbooks/munin/recipes/default.rb | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/cookbooks/munin/recipes/default.rb b/cookbooks/munin/recipes/default.rb index 847425e53..ac6c4d843 100644 --- a/cookbooks/munin/recipes/default.rb +++ b/cookbooks/munin/recipes/default.rb @@ -173,23 +173,21 @@ munin_plugin "http_loadtime" do end node[:network][:interfaces].each do |ifname,ifattr| - if ifname =~ /^eth\d+$/ - if ifattr[:flags] and ifattr[:flags].include?("UP") - munin_plugin "if_err_#{ifname}" do - target "if_err_" - end + if ifattr[:encapsulation] == "Ethernet" and ifattr[:state] == "up" + munin_plugin "if_err_#{ifname}" do + target "if_err_" + end - munin_plugin "if_#{ifname}" do - target "if_" - end - else - munin_plugin "if_err_#{ifname}" do - action :delete - end + munin_plugin "if_#{ifname}" do + target "if_" + end + else + munin_plugin "if_err_#{ifname}" do + action :delete + end - munin_plugin "if_#{ifname}" do - action :delete - end + munin_plugin "if_#{ifname}" do + action :delete end end end -- 2.43.2