Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My Environment:

Apache 2.2.9, Ubuntu 8.10

I am trying to find a way to monitor the bandwidth usage on my server broken out by each virtualhost WITHOUT installing something like PLESK, CPanel, or ISPConfig that is capable of modifying my server. I guess I am looking for a READ-ONLY solution. Since I manually administrate my servers I don't like the idea of installing a web accessible third party administration panel.

I am not even interested (necessarily) in getting graphical data out of the system, just so long as I can see bandwidth usage numbers by domain (preferably sub-domain as well) in some useful time increments like week/month/day. In the absence of time increments I will just run it in cron and manually capture the necessary time based increases.

I currently run Cacti as a system monitor but have been unable to find anything that I can add to Cacti that will gather the data I am needing. I did have a look at AWStats, but from what I could tell it only gave whole system bandwith usage by device and not by VHost (please correct if I am mistaken there).

So, is there a package I can install that already does just this?

Can I modify Cacti to show this information?

If no to the above, is there some bash script that I can run that will give me this output that I can later integrate into my own code?

Thanks in advance!

share|improve this question
up vote 5 down vote accepted

What you are looking for is: mod_logio

This will allow the logging of input and output number of bytes received/sent per request. You would then pull it from your logs of a particular vhost. I believe apps like Webalizer will read the log then for you and give you a good usage picture.

Some references:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.