Click to See Complete Forum and Search --> : Tracking virtual host bandwith


PegLegBoy
04-09-2001, 04:09 PM
Are there any utilities out there that allow me to track the monthly bandwith of my virtual hosts? Also, is there a way that I can limit the amount of bandwith transfered? Ideally, I would like to have my clients be able to see how much bandwith they have used, and how much they have left.

TIA

Craig McPherson
04-10-2001, 03:58 AM
Webalizer will generate a stats report for a virtual domain, and make a page with nice pretty tables for it, which includes kbytes transferred.

Here's the trick to get it to work for multiple domains, though. Webalizer first scans /etc/webalizer.conf, to see if it exists. Make sure it does NOT exist. Then set up a hierarchy of Webalizer configuration files, like this:

/etc/webalizer/domain1/webalizer.conf
/etc/webalizer/domain2/webalizer.conf
...

You'll need to configure all the webalizer.conf files seperately for each domain. You'll need to point each configuration file at each domain's log files.

If Webalizer can't find /etc/webalizer.conf, it looks in the CURRENT DIRECTORY for a webalizer.conf file. To get it to compile stats for all your domain, you need to set up a script that does something like this:

cd /etc/webalizer/domain1
webalizer
cd /etc/webalizer/domain2
webalizer
cd /etc/webalizer/domain3
webalizer
...

The script will enter each of those directories and run webalizer in them, webalizer will find the configuration files in those directories, and will compile stats based on each of those configuration files, each of which will be configured to analyze the logs of a different domain.

Make sure the domains all log to seperate log files, and make sure you keep at least a month's worth of log files. Set a cron script to run your webalizer script on a regular basis to keep the stats up to date.

Hope that helps.

Sweede
04-12-2001, 01:35 AM
This rocks, uses MRTG
http://home.gallatinriver.net/~sweede/traffic.tar.gz

if you need help installing it and configuring (a good change you probably will), msg me on irc.openprojects.net , im sweede on #linuxsphere