Tool to track bandwidth by domain name? [duplicate]
Possible Duplicate:
How can I monitor bandwidth usage by Virtual Host in Apache on Ubuntu
I'm running an Ubuntu 10.04 server that hosts several domain names. All domains point to the same IP address and use the same network interface. I'm really only concerned with the main domain name such as my-domain1.com
and my-domain2.com
. It should include subdomains such as www.my-domain1.com
with the totals for my-domain1.com
. Is there a tool out there that is configurable to track bandwidth usage on a per-domain name basis?
Edit: I'm not looking for only web usage. I'm looking for all traffic.
There is no way of monitoring traffic for all services using a domain name. You would need to have an IP for each domain name to do that. You could potentially monitor the usage for given services depending on if those services maintain information in requests that preserve the domain name. One such service is a web server doing virtual hosting. Web servers doing virtual hosts need to know the domain name to resolve virtual hosts.
You can use the server logs to determine how much bandwidth you are serving up. A tool like awstats will report the bandwidth served. Incoming bandwidth is not reported, but is usually significantly less the outgoing bandwidth.