Apache Bytecounter script (perl)
The following script monitors an apache access logfile, extracts the transferred bytes and offers the current counter as a TCP Server.
It’s no big deal. But is a good example of using IO::Socket and threads in Perl. It’s not a good example of how to work with integers ;-)
I used it on a shared webhost account with shell access (Dreamhost) as input source for cacti.
Enjoy.