Weblog entry #1 for jamshid

vnStat PHP frontend: New Way to See vnStat Output
Posted by jamshid on Tue 3 Jul 2007 at 19:39
Tags:
vnstat php frontend

As a vnStat user you might be interested to know that, provided you run a webserver, you now have another option to view the vnstat output. For those of you who haven't heard about it, vnStat is a console-based network monitoring tool which collects, stores and displays statistics on the volume of traffic entering and leaving network interfaces. Check out a previous article Monitoring your bandwidth usage with vnstat for more information.

vnStat PHP frontend is basically a number of php scripts which use the GD libraries to transform the numerical data gathered by vnStat into nice and clean bar graphs. Same as vnStat, vnStat PHP frontend is small, efficient and quick to install. The latest version and link to a demo are available from www.sqweek.com.

Configuring vnStat PHP frontend is staright-forward. The README file is short but then again you don't need much information to complete the setup. The configuration file is commented well and has only six lines of code, three of which I modified. My server has only one active network interface so I edited config.php accordingly.

$iface_list = array('eth1');
$iface_title['eth1'] = 'Ethernet 1'; 
$vnstat_bin = '/usr/bin/vnstat';

The last variable in normally unset and could be either left as it is or set to the path of vnstat on your system. When set, vnStat PHP frontend will source its data by invoking vnstat directly. if unset then you need to provide a separate source by designating a directory and creating a vnstat cronjob to periodically dump data into it. See config.php for full explanation.

That's about it. Now fire up your browser and check out the hourly, daily and monthly graphs. Be warned though. Chances are, once you see the graphs you get totally hooked and may never want to go back to the console!

 

Comments on this Entry

Posted by Alucard (24.147.xx.xx) on Wed 4 Jul 2007 at 03:58
[ Send Message | View Weblogs ]
Thanks, I am now using this.

[ Parent | Reply to this comment ]

Posted by itsec (85.177.xx.xx) on Sat 7 Jul 2007 at 21:02
[ Send Message | View Weblogs ]
Great!

Just added to crontab:

1 0 1 * * /reporting/monthly.sh

monthly.sh:
/usr/bin/vnstat -m | mail -s "monthly traffic" admin@our.net

[ Parent | Reply to this comment ]

Posted by Anonymous (80.100.xx.xx) on Wed 14 Nov 2007 at 21:53
can't find it online vnstat php frontend
site seems to be down
please send me a copy to
olaf_s
at
hccnet.nl

[ Parent | Reply to this comment ]

Posted by Anonymous (202.152.xx.xx) on Sat 8 Dec 2007 at 20:38
Cacti already done this.

Tony @ InfoKarTu.Com

[ Parent | Reply to this comment ]

Posted by Anonymous (220.233.xx.xx) on Mon 10 Dec 2007 at 11:18
I know Cacti shows traffic rate, but will it show traffic volume?

[ Parent | Reply to this comment ]

Posted by Anonymous (64.56.xx.xx) on Wed 12 Dec 2007 at 15:20
yes it does, see Total Bandwidth

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search