vnStat PHP Frontend – Install & Config Webinterface for vnStat

March 17, 2008 · Filed Under vnStat Bandwidth Monitoring 


B. Dijkstra at SQWEEK.com has written a simple PHP web frontend for vnStat. The latest stable version is 1.4.1 and is available for download here

vnStat PHP Frontend requires

Apache Webserver (use Apache2.2.3 here)

PHP (use PHP5.2.0-8)

GD Image librariesvnStat already installed

So lets get the prerequisites install.

Install PHP5

DebianSystem# aptitude install php5

Install GD Image Libraries

DebianSystem# aptitude install php5-gd

Install Apache2 Webserver

DebianSystem# aptitude install apache2

Now, the pre-requisites are installed. You need to have a functional vnStat running on the system. For install instructions click here

Download vnStat PHP Frontend

Download the vnStat PHP Frontend from here

DebianSystem# wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.4.1.tar.gz

Unzip & Untar the files

DebianSystem# tar -zxvf vnstat_php_frontend-1.4.1.tar.gz

Move the files to Apache Webserver Root

DebianSystem# mv vnstat_php_frontend-1.4.1 /var/www/vnstat

Edit Config file for the Interfaces

DebianSystem# vi config.php

Look for

$iface_list = array(’eth0′);

and

$iface_title['eth0'] = ‘Internal’;
//$iface_title['eth1'] = ‘Internet’;
//$iface_title['sixxs'] = ‘SixXS IPv6′;

and alter it to your systems requirement acfordingly (say change name of interfaces or add multiple interfaces)

Example

$iface_list = array(’eth0′ , ‘eth1′);

Now, that all is done, simply access the site and you can see the vnStat stats with graphs that you would otherwise see only in console.

Comments

4 Responses to “vnStat PHP Frontend – Install & Config Webinterface for vnStat”

  1. John on June 12th, 2009 5:42 am

    I’m did everything on this site. vnstat is working perfectly on the console. But, when I tried the frontend. No data avaible is display on the screen. What am I doing wrong?

    John

  2. Shinzies on August 12th, 2009 10:20 pm

    You got to make sure you set path to your vnstat binary, as well path to vnstat interface dump..

    /usr/bin/vnstat
    /var/lib/vnstat/vnstat_dump_eth0 for example

    read the info in your config.php file…

    It works fine for me..

  3. Shinzies on August 12th, 2009 10:22 pm

    Author of this post should change the link pointing to version 1.3 and put 1.4.1 as this release fixes bugs and issues found in earlier versions.

  4. Siva on October 13th, 2009 8:14 pm

    Hi,
    I could see the vnstat data through vnstat_frontend but not the images. Could you please aid me in this to view the image in vnstat_frontend…
    Thanks in advance…..!!

Leave a Reply