21 - 03 - 2003 I screwed up the rights to the files on the site and thus it tried to execute them as perl scripts... sigh. This is fixed now. Also a contributed script by Edward Murray mail at avenuedesign dot net 24 - 02 - 2003 Fixed the onvious total traffic counting error. It reads the right value now. Example output here http://iserv.nl/traffic/Haai/totaal 17 - 02 - 2003 Wow, another update and just 2 years apart. That which is used will never be unmaintained I guess. The newest file is calc.pl and it includes some my latest enhancements. It is obviously broken in slightly but it's erally obvious when you look at it. I have not fixed this yet (obviously). It does work though. I have also a newer cron.tot-stats that I run 12 minutes after the hour to supress bogus counts. I also made it easier to parse a lot of logfiles in one directory to generate totals for which makes it easier for larger sites. An example of this thingie in action is here http://iserv.nl/traffic/Haai and http://iserv.nl/traffic/Haai/totaal 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