summaryrefslogtreecommitdiff
path: root/net/mrtg
diff options
context:
space:
mode:
authorbouyer <bouyer>2001-06-21 16:44:35 +0000
committerbouyer <bouyer>2001-06-21 16:44:35 +0000
commitfbcaabf5f5101c9dee24536b14d38ebeabf51c0e (patch)
tree67ac5cb499fac9eccd6151ff14492e685e9876a9 /net/mrtg
parent383f8b07706cf53f70bab415bc564f69907ddd22 (diff)
downloadpkgsrc-fbcaabf5f5101c9dee24536b14d38ebeabf51c0e.tar.gz
Make netstat2mrtg work also on interfaces without link-layer address
(e.g. lo0, gif0, ...). From Takahiro Hayashi in pkg/13206.
Diffstat (limited to 'net/mrtg')
-rw-r--r--net/mrtg/files/netstat2mrtg9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/mrtg/files/netstat2mrtg b/net/mrtg/files/netstat2mrtg
index e2e9fd253a1..8982c10a268 100644
--- a/net/mrtg/files/netstat2mrtg
+++ b/net/mrtg/files/netstat2mrtg
@@ -1,8 +1,8 @@
#! @PREFIX@/bin/perl
-# $NetBSD: netstat2mrtg,v 1.2 2001/06/19 12:32:18 hubertf Exp $
+# $NetBSD: netstat2mrtg,v 1.3 2001/06/21 16:44:35 bouyer Exp $
$if = $ARGV[0];
-open(NET, "netstat -I $if -b|");
+open(NET, "netstat -I $if -bn|");
while ($line = <NET>)
{
chop $line;
@@ -11,6 +11,11 @@ while ($line = <NET>)
print "$1\n";
print "$2\n";
}
+ elsif ($line =~ m|^.+<Link>[\s\t]+(\w+)[\s\t]+(\w+)$|)
+ {
+ print "$1\n";
+ print "$2\n";
+ }
}
close(NET);