diff options
author | bouyer <bouyer> | 2001-06-21 16:44:35 +0000 |
---|---|---|
committer | bouyer <bouyer> | 2001-06-21 16:44:35 +0000 |
commit | 6d71fadf9ccb8dccfd9c2f5e7fc8980168795dec (patch) | |
tree | 67ac5cb499fac9eccd6151ff14492e685e9876a9 /net/mrtg/files | |
parent | 4a9b82959df1f5edd6d1ac52aff5685692f9cd5e (diff) | |
download | pkgsrc-6d71fadf9ccb8dccfd9c2f5e7fc8980168795dec.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/files')
-rw-r--r-- | net/mrtg/files/netstat2mrtg | 9 |
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); |