PHP to track bandwidth

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

PHP to track bandwidth

Post 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 ;)
tomtomtom
Forum Newbie
Posts: 8
Joined: Tue Dec 28, 2004 12:39 pm

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

pssst - ipconfig doesn't have packet count information...
Post Reply