From owner-freebsd-pf@FreeBSD.ORG Sat Jul 8 09:03:54 2006 Return-Path: X-Original-To: freebsd-pf@freebsd.org Delivered-To: freebsd-pf@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E7D8B16A4DD; Sat, 8 Jul 2006 09:03:54 +0000 (UTC) (envelope-from dhartmei@insomnia.benzedrine.cx) Received: from insomnia.benzedrine.cx (insomnia.benzedrine.cx [62.65.145.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36F8443D5A; Sat, 8 Jul 2006 09:03:46 +0000 (GMT) (envelope-from dhartmei@insomnia.benzedrine.cx) Received: from insomnia.benzedrine.cx (dhartmei@localhost [127.0.0.1]) by insomnia.benzedrine.cx (8.13.4/8.13.4) with ESMTP id k6893PSu001343 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Sat, 8 Jul 2006 11:03:25 +0200 (MEST) Received: (from dhartmei@localhost) by insomnia.benzedrine.cx (8.13.4/8.12.10/Submit) id k6892oUs009931; Sat, 8 Jul 2006 11:02:50 +0200 (MEST) Date: Sat, 8 Jul 2006 11:02:49 +0200 From: Daniel Hartmeier To: "J. Buck Caldwell" Message-ID: <20060708090249.GB32262@insomnia.benzedrine.cx> References: <44AF5C34.8000801@bitparts.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44AF5C34.8000801@bitparts.org> User-Agent: Mutt/1.5.10i Cc: Philip Paeps , freebsd-pf@freebsd.org Subject: Re: SNMP access to pf ALTQ data? X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jul 2006 09:03:55 -0000 On Sat, Jul 08, 2006 at 02:18:12AM -0500, J. Buck Caldwell wrote: > Is it possible to track pf ALTQ usage with MRTG? I notice that FreeBSD's > built-in bsnmpd has a module and mibs to support pf, but I know too > little about SNMP to figure out how to access the queue stats. > > Specifically, I'm looking to make a series of MRTG graphs that show the > total bytes that pass through each queue. I figure if worst comes to > worst, I can work out a separate program that parses the output of > 'pfctl -vsq' and returns that as MRTG-readable input, but it would be > much smoother to get it via SNMP, if it can be done. Some queue related values are available, take a look at http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/bsnmpd/modules/snmp_pf/ especially the BEGEMOT-PF-MIB.txt file. But pf_snmp.c doesn't use the DIOCGETQSTATS ioctl to fetch those byte counters you're looking for. Maybe Philip can add them. One example of how to fetch the queue stats is pfctl itself, another is pfstat-2.2 pf.c query_queues(), see http://www.benzedrine.cx/pfstat.html (make sure to grab pfstat-2.2.tar.gz, older versions didn't fetch queue stats, either) It's basically just doing DIOCGETQSTATS after DIOCGETALTQ and reading the counters, somewhat depending on queue type. Daniel