Ett perl script som räknar ut för apache, borde gå att göra för andra respektive mjukvaror också...
Du verkar ju inte behöva någon live lösning, dock kanske någon annan har nått bra förslag...
Citat:
#!/usr/bin/perl -w
use strict;
my $access_log = $ARGV[0];
my $total = 0;
my @chunks;
open(LOGFILE, $access_log) or die "Could not open $access_log $!";
# count amount of data.
while(<logfile>)
{
@chunks = split();
if($chunks[9] =~ /\d/)
{ $total += $chunks[9]; }
}
close(LOGFILE);
# convert to human readable; 1024 * 1024 = 1048576.
$total /= 1048576;
print "Amount of bandwidth : $total MB\n";
|
(Taget från ht tp:// w ww.schwer.us/journal/2005/09/03/count-bandwidth/)