CIR bandwidth monitoring tool for virtual hosts
David Thorne
clug at the-thornes.co.uk
Wed Feb 18 14:01:23 CET 2009
Thanks Dom,
I've got SNMP on there monitoring the total bandwidth already - I now
need to break it down to individual hosts so I know which client is
going over more accurately than "Yes well the only site receving traffic
at this time was X" as funnily enough that didn't wash with our clients
billing depts (As I told my bosses it wouldn't!)
Thanks for the awk script will try it out and see if I can see what's
what with regards the CIR rate on the machine and the vhosts - thanks.
Dave
Dom Latter wrote:
> On Wednesday 18 February 2009 10:56:36 David Thorne wrote:
>
>
>> Does anyone know of a monitoring tool, SNMP based or otherwise to help
>> me work out exactly which vhost on the machien is using all the
>> bandwidth.
>
> MRTG might be able to help; AIUI it is very adaptable:
> http://oss.oetiker.ch/mrtg/
>
> Failing that, every network monitoring tool in the history of networking:
> http://www.slac.stanford.edu/xorg/nmtf/nmtf-tools.html
> starting with the piece of notched wood used at Stonehenge.
>
> Somebody might have more specific and useful advice regarding vhosts.
>
> If you are logging your traffic into separate log files for each:
> e.g. /var/log/apache2/www.latter.org-access_log then a script to parse
> out and total your bytes is simple. I'd use awk:
>
> awk '
> BEGIN { n = sum = 0 }
> { ++n; sum += $10;
> #printf "%d\n", $10
> }
> END { printf "n = %d, sum = %d\n", n, sum }
> '
>
> and then grep "18/Feb/2009:12" /var/log/apache2/www.whitelamp.com |
> ./weblog_totaller.awk
> is a quick hack to show that we've not had any honest visitors
> recently <grin>.
>
> A slighly more complicated script could parse the dates and times and
> collate
> things like that.
>
> NB your $10 in the awk script is logfile dependent; uncomment the
> printf line to see what values it is retrieving.
>
More information about the CLUG
mailing list