Page 1 of 1

PHP to track bandwidth

Posted: Thu Dec 30, 2004 1:18 pm
by infolock
I was doing some reading up on tracking bandwidth usage, and I wondered, can php track MY bandwidth usage?

So, if I spend x amount of hours on the net, can php tell me just how long i've been online, how much bandwidth i've used, and what sites i've accessed?

Surely there is a way.. I know of MRTG and PRTG, but they are either perl-based or c-based apps. And yeah, this would be for a windows xp box... Just wish it was for linux then it would be simple...

Just wondering if were possible to get windows to dump bw usage to a log file, database, or maybe even straight to php...

Would be fun at least to try it ;)

Posted: Thu Dec 30, 2004 3:19 pm
by tomtomtom
I imagine you could write a simple HTTP proxy in PHP, which could record bandwidth usage. That would only record your web traffic though of course.

Posted: Thu Dec 30, 2004 4:01 pm
by feyd
might be able to tap into the network systems, as they already track the time you've been online and packet counts in each direction... msdn may be of some help here.

Posted: Thu Dec 30, 2004 4:02 pm
by kettle_drum
Once you have the log file listing what you requested, how big it was etc then you can with ease. You would probably just need to find an app to create that log file.

You could maybe hack something together with ipconfig and such to run it every x minutes and record how much data it says has been transfered.

Posted: Thu Dec 30, 2004 4:07 pm
by feyd
pssst - ipconfig doesn't have packet count information...