The repositories include a nice little program to monitor your bandwidth usage. Very useful if you have a restriction on your bandwidth and you want to track your daily bandwidth usage.
The program is called bwbar. It generates a graphical readout of the bandwidth usage locally in a .png and a .txt file.
$ sudo apt-get install bwbar
$ sudo yum install bwbar
When installed, you need to modify the configuration file:
$ sudo emacs -nw /etc/default/bwbar
And uncomment the lines:
removing the # from the beginning of the line (it should change color from red when you do), and change the values depending on the directory you want the logs saved in, the user you want the program to run as, and other options you want to include when you run bwbar.
Then, you need to change the permissions, as following (if you kept the same folder):
$ sudo chown -R www-data:www-data /var/www/bwbar/
And then you can start the daemon by typing:
$ sudo /etc/init.d/bwbar start
You can see the bandwidth bar on http://[your-server-ip]/bwba.
If you want to track traffic, check out the package darkstat.