Hawaiʻi's Technology Community

Anyone know how to best track bandwidth usage for a particular directory in a website? I've read that Wireshark can do this. Can anyone point me to instructions on how best to do that and then use a PHP script to read the bandwidth usage daily or monthly?

I also came across an interesting of the top 100 network security tools in case anyone is interested.

Views: 49

Replies to This Discussion

If you're interested in per-directory traffic for a web application, it sounds like you want an application layer tool like webalizer that creates stats from apache logs. It won't give you a complete bit count, but it will be close, modulo network layer headers. I thought that Wireshark worked at the network layer, so it wouldn't know much about directories or other application layer structure.
Thanks for your reply, Ken. I finally came to that same conclusion about Wireshark after researching it some more. I'm glad that you confirmed it for me.
I haven't tried it myself, but I suspect Google Analytic may be configured/hacked to do what you want. I don't know any free web analytic tools that would track bandwidth usage by directory (recursive?)... There are plenty of free apache log analyzers out there, you might be able to embed in your PHP code some kind of bandwidth usage stat and stick it in the apache log, or plot it to MRTG.

You _could_ run Wireshark to look at your traffic, you'd see all the HTTP headers and theoretically you can parse our the directory/file that's being hit/accessed... but Wireshark is meant to be a network sniffer, and this would be too inefficient (and resource intensive) to be practical.
You can also use a little script magic on your log file to pull out the date and bytes transferred for the directory in question, then total by day. But a web analytics tool will give you that and more.



web design, web development, localization

© 2024   Created by Daniel Leuck.   Powered by

Badges  |  Report an Issue  |  Terms of Service