We all live in a world surrounded by networks. The most important among them, and no doubt in that, is internet technology. When we relate networks to the computer systems, it is GNU/Linux dominating this particular field (again no doubt). Organizations working under computer networks usually run on GNU/Linux environment. So there is a great need for monitoring the network traffic. vnStat arrives in such a situation rendering a great help towards the network world. It is a console-based network traffic monitor. It keeps a log of hourly, daily and monthly network traffic for the selected interface(s). vnStat can be used even without root permission on most systems. It will be helpful for some of you for accounting the amount of data being transfered from our system to the outside world. I will brief some basic command-line options to start with. Install the utility from your distro’s default package manager.
The basic format for vnStat is
For creating a new database for a particular interface
sudo vnstat -u -i <interface>
Ex:- sudo vnstat -u -i eth0
Now inorder to get the details after the data transfer run
sudo vnstat -u -i eth0 and then
vnstat -i eth0
Output displays data transfer amount, rate etc on hourly, daily, weekly, monthly basis. -h for hours, -d for days,-w for weeks -m for months. -u option is used to update the database and -i for specifying the interface. In order to delete and stop monitoring an interface use
sudo vnstat –delete –force -i <interface>
I think it is enough for all to play around with vnStat. More details will be available to you after installing the package through the man page, as usual.