The traffic graphic on portal is not correct. It is what support stuff said. So I would like to install my own traffic monitoring service to track home much I use during the month.

vnStat is the one we are going to go through the installation.

The screen shot below is the report I have for last two weeks.


1) Install vnstat

tar xzvf vnstat-1.11.tar.gz
cd vnstat-1.11
make install

Until now, vnstat is installed, but it has no GUI for easily viewing.
So step 2 is install vnstat php frontend

2) Install vnstat php frontend

tar xzvf vnstat_php_frontend-1.5.1.tar.gz
cd vnstat_php_frontend-1.5.1
mkdir /home/yourname/yoursite/vnstat
cp -r . /home/yourname/yoursite/vnstat/
cd /home/yourname/yoursite/vnstat/
vi config.php

Edit config.php, change network interface to venet0
change data folder to $data_dir = ‘/var/lib/vnstat/’;

3) Add scheduled cron job to update the log database

cd /var/lib/vnstat
Add following into
<pre class="brush:shell">
vnstat -u -i venet0
vnstat -dumpdb -i venet0 &gt;/var/lib/vnstat/vnstat_dump_venet0

Add following into scheduled cron job to every hours

/bin/sh /var/lib/vnstat/

Then the report will come like this when enter the address

David Yin

David is a blogger, geek, and web developer — founder of If you like his post, you can say thank you here

One Reply to “Install vnstat on Centos at to monitor the traffic”

Leave a Reply

Your email address will not be published. Required fields are marked *