$OpenBSD: patch-plugins_node_d_openbsd_if_errcoll__in,v 1.1 2010/10/23 15:52:23 sthen Exp $
--- plugins/node.d.openbsd/if_errcoll_.in.orig	Fri Oct 15 00:03:18 2010
+++ plugins/node.d.openbsd/if_errcoll_.in	Fri Oct 15 00:04:55 2010
@@ -3,9 +3,9 @@
 # Wildcard-plugin to monitor network interfaces. To monitor an
 # interface, link if_<interface> to this file. E.g.
 #
-#    ln -s /usr/share/munin/node/plugins-auto/if_ /etc/munin/node.d/if_eth0
+#    ln -s /usr/share/munin/node/plugins-auto/if_errcoll_ /etc/munin/node.d/if_errcoll_em0
 #
-# ...will monitor eth0.
+# ...will monitor em0.
 #
 # Any device found in /usr/bin/netstat can be monitored.
 #
@@ -30,7 +30,7 @@ fi
 
 if [ "$1" = "suggest" ]; then
 	if [ -x /usr/bin/netstat ]; then
-		netstat -i -b -n | sed -n -e '/^faith/d' -e '/^lo[0-9]/d' -e '/^pflog/d' -e '/<Link#[0-9]*>/s/\** .*//p'
+		netstat -i -b -n | sed -n -e '/^faith/d' -e '/^lo[0-9]/d' -e '/^pflog/d' -e '/<Link>/s/\** .*//p'
 		exit 0
 	else
 		exit 1
@@ -53,15 +53,15 @@ if [ "$1" = "config" ]; then
 	exit 0
 fi;
 
-/usr/bin/netstat -i -b -n -I $INTERFACE | awk '
-/<Link#[0-9]*>/ {
-	if (NF == 10) {
+/usr/bin/netstat -i -n -I $INTERFACE | awk '
+/<Link>/ {
+	if (NF == 8) {
 		print "ierrors.value", $5;
-		print "oerrors.value", $8;
-		print "collisions.value", $10;
+		print "oerrors.value", $7;
+		print "collisions.value", $8;
 	} else {
 		print "ierrors.value", $6;
-		print "oerrors.value", $9;
-		print "collisions.value", $11;
+		print "oerrors.value", $8;
+		print "collisions.value", $9;
 	}
 }'
