4 - 12 - 2000
renamed the .pl files because this server happens to like executing perl files ;-)
Nothing really changed, rename where you see fit..

9 - 5 - 2000
Put a new calc.pl in place.
This one also calculates average workday traffic (8 hour workday and asumming 22 days in a month)
This also generates the averages with the right scale (Kbps and Mbps and that sort of things)
I have cut the floating point number by showing just the first 2 decimals, that should make it much more readable.
It doesn't quite resemble the original script anymore but it still works.
The tot-stats script gives a division by zero on the first of the month because it doesn't have any data yet.
It also gives completely bogus results on the first calculation of the hour, 5 minutes after that it will be OK.
You can work around this by making sure that the hourly script get run at least 6 past the hour (it does depend on how long it takes to run all the mrtg scripts).

3 - 12 - 1999
I dropped the bytes and kbytes and just print out the megabytes.
I am already getting close to measuring in GB :-)

-------

The calc-reverse.pl and calc.pl script are adapted perl scripts 
from the original calculate_traffic.pl written by 
Matt Petach - mattp@Internex.NET
Since I hardly know _any_ perl I thank him for the initial perl script.
Sorry for littering your perl script Matt ;-)

It uses the mrtg logfiles from your mrtg traffic logging
pages and generates an monthly total report based on that data.

The calc.pl is the "normal" script for processing log files.
However it is possible that the in and out data are logged the 
other way around. For you there is calc-reverse.pl that switches the 
fields while reading the log.

They both give some extra output in both bytes, kilobytes and
megabytes. They also make the output an html page (although not fancy).

Installation instructions

The tot-stats script can be copied to /etc/cron.hourly for hourly processing.
and also saving you to make enormous entries in your crontab.
It saves the monthly totals as an separate file and most options like dirs 
can be easily adjusted in the shell script.

The perl scripts can be saved anywhere you want although I have just put them 
in the same webdir. It is not an neccesity, just lazy ;-)

Just read through the shell script and you'll see.

Seth Mos
seth@iserv.nl

