Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'd like to monitor bandwith on my VPS. I think that the easiest way is to parse http-logs (%bytes-send% value). Are there any scripts or software (freeware) that does bandwidth usage graphs like (example) cpanel? Thanks a lot.

PS of course, i can write it, but i don`t want to invent a bicycle :)

share|improve this question

4 Answers 4

I use AWStats to do some analytics data including data transfer stats. For Apache it will support those logs out of the box. For nginx I am unsure, but you can always write custom rules for a log (For example, I wrote one for HAProxy logs).

I would this reporting and not monitoring myself. For monitoring I would monitor/graph network usage with something like Monit, Cacti, or Nagios. Although this would include other data as well.

share|improve this answer

For monitoring logs - Analog: www.analog.cx. It's a bit heavy to set up (lots of config options) but pretty powerful. You can set it up to write small, machine readable files that feed in to your stats server (such as Zabbix or Nagios).

Bear in mind, though, that your web logs might not report the bytes served, they might just report the size of the file requested. (Not used nginx, but I know apache does this.) If you serve a lot of big downloads, then this can lead to an enormous over-estimation of bandwidth, if you consider many download managers will fire off 16 or 32 requests for the same file...

Apache has a logio module, which sacrifices some of the immediacy of logging for a true count of bytes served.

share|improve this answer

You can also use the apache mod_status module and query it with any of the tools mentioned above, but the stats are pretty generalized.

share|improve this answer
    
My tool of choice is Zenoss Core :) –  SpacemanSpiff Nov 19 '10 at 16:10

From the best I can tell, Apache does log partial transfers, it logs them as 206 and gives a byte count. I just had to update my (this) bandwidth script a few weeks ago.

http://crunchtools.com/software/crunchtools/racecar/

This will give you real quick and dirty reporting, but no breakdowns per domain. I am working on a solution for that now. It is not a trivial problem. I use awstats for analyzing how my content is doing, but there is no way (that I know of) to calculate bandwidth in a report format.

share|improve this answer

Your Answer

 
discard

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.