From owner-freebsd-net@FreeBSD.ORG Sat Nov 29 20:55:25 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA0041065789 for ; Sat, 29 Nov 2008 20:55:25 +0000 (UTC) (envelope-from Mykel@mWare.ca) Received: from ox.eicat.ca (ox.eicat.ca [66.96.30.35]) by mx1.freebsd.org (Postfix) with ESMTP id C84EF8FC18 for ; Sat, 29 Nov 2008 20:55:25 +0000 (UTC) (envelope-from Mykel@mWare.ca) Received: from fulgidous.condor.lan (radix.mWare.ca [72.0.75.75]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ox.eicat.ca (Postfix) with ESMTP id 9CE00B998 for ; Sat, 29 Nov 2008 15:27:35 -0500 (EST) Message-ID: <4931A5B6.1060000@mWare.ca> Date: Sat, 29 Nov 2008 15:27:34 -0500 From: Mykel User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Determining counts or size of routing table? (netstat performance?) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Nov 2008 20:55:26 -0000 Got a few 6.x machines running OpenBGPd with a few BGP full-feeds and a handful of peers... I'd like to determine the size of the FIB/kernel routing table. OpenBGPd does not give me this data, and on my duallie-Xeon 2.8s, it takes quite a while to use netstat & wc to count. I'm not looking for exact numbers, just something I can poll via NetSNMP and plot in cacti... I looked though netstat, route, sysctl, vmstat, even pored over an snmpwalk... can't find anything. Been asking around, and the only suggestion I've received was to write a daemon that dumps the table and then monitors the changes, but I'm not a programmer, nor could I find any tool in ports that might assist in this. I'd be happy with almost any metric that gives me some absolute reference as to how big my routing table is so I can get some nice pretty graphs done up. Not pounding the system every 60-300 seconds would be very nice. Any suggestions? Or does everyone just pipe netstat? Is there a MIB for sysctl or NetSNMP I'm missing? Myke [root@jigsaw ~]# time route -vnd flush | wc -l 1121977 real 0m6.681s user 0m3.910s sys 0m2.351s [root@jigsaw ~]# time netstat -rnf inet | wc -l 280479 real 0m12.982s user 0m2.713s sys 0m9.609s [root@jigsaw ~]#