bsdar/netstat issue

Maxim Ianoglo dotnox at gmail.com
Tue Jan 12 13:24:58 UTC 2010


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 at gmail.com )


More information about the freebsd-questions mailing list