Monitor all interfaces that are up and aren't the loopback interface
authorTom Hughes <tom@compton.nu>
Sat, 16 Feb 2019 12:45:46 +0000 (12:45 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 16 Feb 2019 12:45:46 +0000 (12:45 +0000)
cookbooks/munin/recipes/default.rb

index 677a62b..df7bfbe 100644 (file)
@@ -160,7 +160,7 @@ munin_plugin "http_loadtime" do
 end
 
 node[:network][:interfaces].each do |ifname, ifattr|
-  if ifattr[:encapsulation] == "Ethernet" && ifattr[:state] == "up"
+  if ifattr[:flags].include?("UP") && !ifattr[:flags].include?("LOOPBACK")
     if node[:hardware] &&
        node[:hardware][:network] &&
        node[:hardware][:network][ifname][:device] =~ /^virtio/