Install vnstat on Centos at to monitor the traffic

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

wget<br />
tar xzvf vnstat-1.11.tar.gz<br />
cd vnstat-1.11<br />
make<br />
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

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

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

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

Add following into scheduled cron job to every hours

<br />
/bin/sh /var/lib/vnstat/<br />

Then the report will come like this when enter the address