From owner-freebsd-jail@FreeBSD.ORG Thu Mar 21 18:19:05 2013 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DA03DAA1 for ; Thu, 21 Mar 2013 18:19:05 +0000 (UTC) (envelope-from lambert@lambertfam.org) Received: from www.jail.lambertfam.org (atom1.lambertfam.org [69.153.112.46]) by mx1.freebsd.org (Postfix) with ESMTP id BE9761EE for ; Thu, 21 Mar 2013 18:19:05 +0000 (UTC) Received: by www.jail.lambertfam.org (Postfix, from userid 999) id 350A712883; Thu, 21 Mar 2013 13:12:01 -0500 (CDT) Date: Thu, 21 Mar 2013 13:12:00 -0500 From: Scott Lambert To: freebsd-jail@freebsd.org Subject: Re: how to measure bandwidth per jail Message-ID: <20130321181200.GG94452@www.jail.lambertfam.org> Mail-Followup-To: freebsd-jail@freebsd.org References: <6C05923E-61FE-46BF-B006-DB078AAAFAA4@inbox.im> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6C05923E-61FE-46BF-B006-DB078AAAFAA4@inbox.im> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Mar 2013 18:19:05 -0000 On Thu, Mar 21, 2013 at 01:26:13AM +0000, Nicolas de Bari Embriz Garcia Rojas wrote: > Hi, any tool, idea or method for measuring the bandwidth consumed per > jail ? (or by IP) > > What about using pflow ( pseudo-device pflow) any advice ? I found a thread about this topic yesterday via Google. It was on the FreeBSD-ISP@frebbsd.org mailing list sometime in 2005 if I remember correctly. They came up with a few options netflow, counting rules in IPFW/pf/ipf netstat -rni ( which gets you packet counts, -rnbi gives you in-bytes and out-bytes) bandwidthd (in ports I believe) I suppose ntop could do similar things. My favorite option was netstat -rnbi | awk '{print $8,$11}' and feeding that to MRTG. I have not gotten it implemented yet. One consideration is that on FreeBSD 8 and older, you don't get out traffic per IP address with netstat, as far as I can tell. We're moving to FreeBSD 9 pretty quickly anyway. -- Scott Lambert KC5MLE Unix SysAdmin lambert@lambertfam.org