Bandwidth Stats

Jonathan McDowell noodles at earth.li
Tue May 27 17:43:05 BST 2003


On Tue, May 27, 2003 at 05:37:30PM +0100, Dominic Mitchell wrote:
> On Tue, May 27, 2003 at 05:16:41PM +0100, Jonathan McDowell wrote:
> > I always feel using SNMP to access data on the local machine is a waste
> > of resources. I run MRTG on a few Linux boxes and just pull the data
> > from /proc to feed to MRTG without the need for another daemon running.
> > 
> > On my FreeBSD box I'm using rrdtool with something along the lines of:
> > 
> > for i in fxp0 vr0 wi0; do
> > 	DATA=`netstat -b -I $i | awk '/Link#/ { print "N:" $7 ":" $10}'`
> > 	rrdtool update $i.rrd $DATA
> > done
> > 
> > to actually capture the data rather than bothering with SNMP.
> 
> Really?  The cost of the 9 forks is probably a lot highter than just
> asking the snmpd which is already resident.

Oh, it absolutely needs rewritten; I should only need to call netstat
once rather than 3 times. It was my first effort at playing with rrdtool
(I keep getting told it's better than MRTG's backend) and I just wanted
some data. :)

J.

-- 
                 /------------------------------------\
                 |     Orc, the other white meat.     |
                 | http://www.blackcatnetworks.co.uk/ |
                 \------------------------------------/




More information about the Ukfreebsd mailing list