Sunday, July 27, 2008

vnstat -- internet traffic monitor

vnstat [link] is a cool console based(yet easy to use) tool which I use to monitor my bandwidth usage in Linux.

Please Note : It does not start monitoring right away. Once you install you have to run

vnstat -u -i interface

(as it says in the man page) (for me the interface is eth0 the name of my Ethernet port that ifconfig command throws out). Also to be noted is – vnstat does not automatically update the transfer statistics. Entering the command manually is a chore so I added the following line to crontab (as root/su i.e the roots' crontab)


*/5 * * * * vnstat -u


It updates the vnstat database every 5 minutes (you can give a suitable interval).

Disclaimer : I being a noob when it comes to Linux got the script form somewhere else (on the broad internet) but now that I search for the source site I cannot find it and hence cannot acknowledge the source : to the anonymous source – thanks a lot.

No comments: