How to monitor network traffic on Ubuntu using vnStat

Monitoring network traffic or bandwitdh usage is a must in a SysAdmin tasks. There are many differents tools to manage this monitoring, but one of my favorites is vnStat. The main advantage of this tool is the simplicity of its usage.

Installation

With Ubuntu, the way to install this tool is with apt.

sudo apt-get install vnstat

First steps

Once installed, it is important to know which interfaces are going to be monitoried. For this, you can use next command

netstat -i

In my case, I have 2 interfaces (eth0, wlan0). The lo interface is the loopback interface, and this is not monitored.

yvoictra|zoar:~$ netstat -i
Kernel Interface table
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 0 0 0 0 0 0 0 BMU
lo 65536 58 0 0 0 58 0 0 0 LRU
wlan0 1500 12521 0 1 0 1962 0 0 0 BMRU
Continue reading How to monitor network traffic on Ubuntu using vnStat