summaryrefslogtreecommitdiff
path: root/net/mrtg
diff options
context:
space:
mode:
authorbouyer <bouyer@pkgsrc.org>2001-06-21 16:44:35 +0000
committerbouyer <bouyer@pkgsrc.org>2001-06-21 16:44:35 +0000
commit2d181d7feba616dda3188db5ade3c7978bb8a8b8 (patch)
tree67ac5cb499fac9eccd6151ff14492e685e9876a9 /net/mrtg
parent1cbae43bbc9ebedae4aa2f583f492365b182683f (diff)
downloadpkgsrc-2d181d7feba616dda3188db5ade3c7978bb8a8b8.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);