Measuring data transferred through an interface?

Jonathan Belson jon at witchspace.com
Sat Feb 22 13:50:41 GMT 2003


Hiya


 >If all you want is the total number of bytes transferred, you can run:
 >
 >    % netstat -ib
 >
 >to get packet and byte IO counts since the last reboot.  A script to
 >convert that into daily usage is left as an exercise for the student.

I was just about to bash a cgi script together to display my daily
usage when I noticed the following:

jon at dookie:~/projects/traffic# netstat -ib
Name  Mtu   Network       Address            Ipkts Ierrs     Ibytes    Opkts Oerrs     Obytes  Coll
fxp0  1500  <Link#1>    00:a0:c9:4b:f1:d1  1338614     0  288456851  1594383     2 1395070738     0
fxp0  1500  192.168.0     dookie            545200     -  182806557   720803     -  575157882     -
xl0   1500  <Link#2>    00:60:08:4f:f6:f8  5305296   182 1511513823  1790630     5  834108098     0
xl0   1500  pc2-rdng1-4-c pc2-rdng1-4-cus   910272     -  459643920  1790514     -  809033696     -
ppp0* 1500  <Link#3>                             0     0          0        0     0          0     0
lo0   16384 <Link#4>                        222481     0   44749326   222481     0   44749326     0
lo0   16384 your-net      localhost         195212     -   35658820   195220     -   35659674     -

Each network interface appears twice, with different ibytes/obytes.  What is
the significance of the two values?


--Jon

http://www.witchspace.com






More information about the Ukfreebsd mailing list