Network Traffic Counters Like vnstat And ntop

vnstat

Install the command line program vnstat, a network traffic counter, on Ubuntu:

sudo aptitude install vnstat

Set up vnstat for your (e.g. dial-up: ppp0) internet connection:

sudo vnstat -u -i ppp0

View traffic:

vnstat

Set up a PHP based vnstat frontend

http://www.sqweek.com/sqweek/index.php?p=1

install:

cd ~/Downloads
git clone git://github.com/bjd/vnstat-php-frontend.git
sudo cp -R vnstat-php-frontend /var/www/vnstat

change the configuration file config.php

  • language: en
  • interfaces...
  • vnstat binary...

If something has changed, update like this (you have to do the setup again):

cd ~/Downloads/vnstat-php-frontend
git pull origin master
sudo rm -rf /var/www/vnstat
sudo cp -R ./ /var/www/vnstat

ntop

ntop is a network monitoring tool with extensive log transfer depending on adapter, destination, type of traffic etc. Includes a web server.

Set up according to:

Installation:

sudo apt-get install ntop
# set the admin password:
sudo ntop -A
# change settings (like nic to monitor):
sudo dpkg-reconfigure ntop
# restart ntop with new settings:
sudo /etc/init.d/ntop restart

Then goto http://localhost:3000/ to access the stats.

alternatives

  • gkrellm: GUI that logs traffic for days, week & months.
  • KNemo Traffic monitor on KDE.

Comments