Date: Tue, 12 Jan 2010 14:58:06 +0200 From: Maxim Ianoglo <dotnox@gmail.com> To: freebsd-questions@freebsd.org Subject: bsdar/netstat issue Message-ID: <20100112145806.1de591f3@gmail.com>
next in thread | raw e-mail | index | archive | help
Hello,
Got an issue.
On FreBSD amd64 bsdsar dows not works properly because of netstat -b -i
-n
shows one extra column "Idrop"
$ uname -m
amd64
$ netstat -b -i -n
Name Mtu Network Address Ipkts Ierrs Idrop Ibytes Opkts Oerrs Obytes Coll
bge0 1500 <Link#1> 00:00:1a:19:3b:69 722511 0 0 413208866 447516 0 63777493 0
$ uname -imprs
FreeBSD 8.0-STABLE amd64 amd64 GENERIC
In i386 netstat output is as was before
$ uname -m
i386
$ netstat -b -i -n
Name Mtu Network Address Ipkts Ierrs Ibytes Opkts Oerrs Obytes Coll
wpi0* 2290 <Link#1> 00:1b:77:d3:75:5e 0 0 0 0 0 0 0
$ uname -imprs
FreeBSD 8.0-STABLE i386 i386 NAFNOTE
To make bsdsar work properly I have modified it
here is the diff:
$ diff -u /usr/local/bin/bsdsar_gather /usr/local/bin/bsdsar_gather.new
--- /usr/local/bin/bsdsar_gather 2010-01-12 14:19:09.000000000 +0200
+++ /usr/local/bin/bsdsar_gather.new 2010-01-12 14:18:13.000000000 +0200
@@ -91,11 +91,11 @@
# now lets pull data from netstatlist
foreach $ifaceline (@netstatlist) {
chomp $ifaceline;
- ($ifacename, $Mtu, $Network, $Address, $inpkts, $inerrs, $inbytes, $outpkts, $outerrs, $outbytes, $coll) = split/\s+/,$ifaceline;
+ ($ifacename, $Mtu, $Network, $Address, $inpkts, $inerrs, $idrops, $inbytes, $outpkts, $outerrs, $outbytes, $coll) = split/\s+/,$ifaceline;
if ( $coll eq "") {
# $coll is empty because of a blank column, assume this is Address
# so try again wthout it
- ($ifacename, $Mtu, $Network, $inpkts, $inerrs, $inbytes, $outpkts, $outerrs, $outbytes, $coll) = split/\s+/,$ifaceline;
+ ($ifacename, $Mtu, $Network, $inpkts, $inerrs, $idrops, $inbytes, $outpkts, $outerrs, $outbytes, $coll) = split/\s+/,$ifaceline;
}
$ifaceinfo .= "$ifacename,$inpkts,$inerrs,$inbytes,$outpkts,$outerrs,$outbytes,$coll\|";
Did anyone faced such issue before ? Or thie is not a bug with netstat/bsdsar.
Thank you.
--
Maxim Ianoglo a.k.a dotNox ( dotNox@gmail.com )
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100112145806.1de591f3>
