Weblogs for jamshid
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!