Sunday, 13 April 2014

iftop : bandwidth monitoring tool


'iftop' is a great tool for monitoring Bandwidth usage. Like the classic process monitoring tool 'top' it allows you to monitor bandwidth usage by hosts. Iftop displays a table of current bandwidth usage by pairs of hosts and has many configuration options.

The hosts with the highest bandwidth usage data is at the top.


Installation


  • On Linux Mint/Ubuntu the install is  
  $ sudo apt-get -y install iftop

Running the Tool


  • Require root access :
$ sudo iftop 
  •  Uses the first interface by default but can specify the interface
$ sudo iftop -i eth0 
  • iftop looks up the hostnames associated with addresses it finds in packets. This can cause substantial traffic so can be good to disable
 $ sudo iftop -i eth0 -n
  • Show ports as well as hosts
$ sudo iftop -i eth0 -n -P
  • Don't convert port numbers to services e.g. 80 to http
$ sudo iftop -i eth0 -n -P -N
  •  Display Bandwidth in Bytes
 $ sudo iftop -i eth0 -n -P -N


Statistics Explained


  • Statistics output above from left to right is for data rate (both sent and received) for the last
    • 2 seconds
    • 10 seconds
    • 40 seconds

  • Cumulative and peak data above displays
    • Received
    • Transmitted
    • Total

2 comments:

  1. Don't you think people who are new to Linux or are trying to adapt it will find little difficult to use command line usage monitor application ?

    I wanted a graphical interface internet usage monitor for linux, I searched a lot but found that most of the applications were terminal based, then I discovered this kool application called NTM.

    Try that, it's small, simple yet efficient :)

    ReplyDelete
    Replies
    1. Hi Avinesh, thanks for the feedback. I will check out NTM!

      Delete