This script is for the Cobalt Raq4 (although I would love to know if it works with the Raq3 too??). It uses the internally generated /home/.cobalt/report/stats.tab file to display the bandwith used by each virtual site on the server even if your virtual sites are on the same IP address. The stats.tab file is generated by the Raq when it splits the log files up for each site. A total is kept for Web, FTP & E-mail by month showing the number of hits, transfers & mails as well as the total amount of bandwidth used for each one. This script displays that data with some nifty additions…
What it does
At it’s basic level this script displays the data in the stats.tab file in a webpage but it also…
- The script is password protected by default. If “admin” logs in they will see a summary for all sites. If a standard user logs in they will only see details of their own site. This means you can publish the URL and siteadmins can check their own sites usage.
- Add extra data to the stats. e.g. I run a Helix streaming server and split the logs in the same way to create my own stats.tab file for helix. This script will merge data from both.
- Two warning levels. If the usage for a site is over a two bandwidth levels it will be highlighted. These levels can be configured by you.
- Easy control over look and feel
The setup should be pretty easy…
- Download the script from the site (‘wget URL’).
- Put the download where you want it.
- Extract the compressed tar using ‘tar zxvf raq-bandwidth.tar.gz’.
- Check the file permissions for the directory & files
- Check that the script runs first by browsing to the …./bandwidth/ directory.
- If it works the change any setup you wish to change in the top if the index.cgi script.
I would love feedback on this script, good and bad. Thank you.
- 1.04 – 30 Sep 2004
- Release to public
- Pre 1.04
- Beta Testing. Thank you Thom LaCosta & Florian Arzberger
Simply download the file, change the directory path at the top of the file if required and execute.