From owner-freebsd-questions@FreeBSD.ORG Fri Jan 30 07:03:17 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDDDC1065675 for ; Fri, 30 Jan 2009 07:03:17 +0000 (UTC) (envelope-from D.Forsyth@ru.ac.za) Received: from b.mail.ru.ac.za (b.mail.ru.ac.za [IPv6:2001:4200:1010::25:2]) by mx1.freebsd.org (Postfix) with ESMTP id 191868FC1D for ; Fri, 30 Jan 2009 07:03:17 +0000 (UTC) (envelope-from D.Forsyth@ru.ac.za) Received: from iwr.ru.ac.za ([146.231.64.249]:59263) by b.mail.ru.ac.za with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LSnPF-000BUS-3g; Fri, 30 Jan 2009 09:03:13 +0200 Received: from iwr61.iwr.ru.ac.za ([146.231.64.161]) by iwr.ru.ac.za with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LSnPF-0003gY-2f; Fri, 30 Jan 2009 09:03:13 +0200 From: "DA Forsyth" Organization: IWR To: freebsd-questions@freebsd.org Date: Fri, 30 Jan 2009 09:03:13 +0200 MIME-Version: 1.0 Message-ID: <4982C251.27467.D92C92A@d.forsyth.ru.ac.za> Priority: normal In-reply-to: <20090129164452.D34311065795@hub.freebsd.org> References: <20090129164452.D34311065795@hub.freebsd.org> X-mailer: Pegasus Mail for Windows (4.41) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Virus-Scanned: b.mail.ru.ac.za (146.231.129.34) Cc: gunther.mayer@googlemail.com Subject: Re:Saving pf state for accounting X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d.forsyth@ru.ac.za List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2009 07:03:18 -0000 On 29 Jan 2009 , freebsd-questions-request@freebsd.org entreated about "freebsd-questions Digest, Vol 246, Issue 69": > Date: Thu, 29 Jan 2009 14:47:51 +0200 > Subject: Saving pf state for accounting > > Hi guys, > > My server uses up tons of bandwidth every month and I'd like to start > recording what traffic volumes my different services chew up on a > monthly basis. My firewall utility of choice is pf and I've recently > come across its neat "label" facility so that I can do a simple "pfctl > -sl" to get the latest readings. > > That's all fair and well but I lose all that lovely accounting > information upon reboot so how do I go about saving this? I've googled > quite a bit to look for a solution but have found nothing useful so far, > just unanswered posts in the past. > > From what I can tell so far I'd have to write a custom rc script which > redirects "pfctl -sl" into some sort of logfile which then may be > retrieved at a later stage (and added to current counter output). Is > there an easier way perhaps? I'd use MRTG to store the numbers continuously, viewable as graphs. -- DA Fo rsyth Network Supervisor Principal Technical Officer -- Institute for Water Research http://www.ru.ac.za/institutes/iwr/