display network traffic on an interface

Eon Works | Scripts | Demo | About | Links

img
script: bytetraf (download)
purpose: display network traffic on an interface
requires: standard GNU commands, /proc fs
version: 1.0
usage: bytetraf [-hml] <n>s|m|h|d <interface>
options:
 

     <n>s|m|h|d, n is an integer referring to time interval in

                 seconds|minutes|hours|days which refers to the frequency of how

                 often to display traffic info

     <interface>, is the name of network interface as found in /proc/net/dev file

     -h, usage and options (this help)

     -m, manual

     -l, see this script"

manual:
 



DESCRIPTION



    Output format example:



    13:53:21 int: ppp0 recv: [+6270] 5.789.621  tran: [+393] 537.478  rate: 6663 b/s



    Output explanation for each column:



    13:53:21 - time

    int: - short for interface

    ppp0 - interface type

    recv: - marks received bytes start

    [+6270] - received 6270 bytes since last time interval specified as <n>s|m|h|d

    5.789.621 - received 5.789.621 bytes since the interface has been up

    tran: - marks transferred bytes start

    [+393] - transferred 393 bytes since last time interval specified as <n>s|m|h|d

    537.478 - transferred 537.478 bytes since the interface has been up

    rate: - speed in bytes/s of the total traffic

    6663 b/s - 6663 bytes/s



NOTE



    This script relies on the structure of the output generated by kernels 2.2.x and

    2.4.x in /proc/net/dev file.