Add netbw option to systat

Bryan Venteicher bryanv at daemoninthecloset.org
Wed Jul 2 23:50:41 UTC 2014


Awhile back, DragonlyFlyBSD added a netbw option to systat that I've ported
to FreeBSD and found handy at various times:

   netbw      Display aggregate and per-connection TCP receive and transmit
                      rates.  Only active TCP connections are shown.

Leading to output such as:

tcp accepts        connects                 rcv 1.192G snd 15.77K rexmit

  192.168.10.80:22      192.168.10.20:23103 rcv        snd 415.7  [  NTSX ]
  192.168.10.80:22      192.168.10.20:46560 rcv 19.80M snd 14.47K [  NTSX ]
  192.168.10.80:22      192.168.10.20:60699 rcv        snd 886.3  [  NTSX ]
  192.168.10.81:5201    192.168.10.51:60844 rcv 293.2M snd        [R  TSX ]
  192.168.10.81:5201    192.168.10.51:60845 rcv 293.5M snd        [R  TSX ]
  192.168.10.81:5201    192.168.10.51:60846 rcv 293.2M snd        [R  TSX ]
  192.168.10.81:5201    192.168.10.51:60847 rcv 292.9M snd        [R  TSX ]

It uses the sequences number from the 'struct tcpcb' to derive the rates,
which is usually good but certainly not perfect (i.e., don't set the
interval too long).

I'd like to commit this if anybody else thinks they'd find it useful.

http://people.freebsd.org/~bryanv/patches/systat-netbw.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: systat-netbw.patch
Type: text/x-patch
Size: 17442 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-net/attachments/20140702/71274b7d/attachment.bin>


More information about the freebsd-net mailing list