From owner-freebsd-questions@FreeBSD.ORG Wed Jul 16 04:59:50 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8BECC37B401 for ; Wed, 16 Jul 2003 04:59:50 -0700 (PDT) Received: from relay1.ntu-kpi.kiev.ua (oberon.ntu-kpi.kiev.ua [195.245.194.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 69A5B43F3F for ; Wed, 16 Jul 2003 04:59:47 -0700 (PDT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from comsys.ntu-kpi.kiev.ua (eth0.comsys.ntu-kpi.kiev.ua [10.0.1.184]) by relay1.ntu-kpi.kiev.ua (Postfix) with ESMTP id 70DDC199D9; Wed, 16 Jul 2003 14:59:35 +0300 (EEST) Received: from pm514-9.comsys.ntu-kpi.kiev.ua (pm514-9.comsys.ntu-kpi.kiev.ua [10.18.54.109]) by comsys.ntu-kpi.kiev.ua (8.11.6/8.11.6) with ESMTP id h6GC4Pr04624; Wed, 16 Jul 2003 15:04:26 +0300 (EEST) Received: by pm514-9.comsys.ntu-kpi.kiev.ua (Postfix, from userid 1000) id 079CA234; Wed, 16 Jul 2003 14:58:41 +0300 (EEST) From: Andrey Simonenko To: David Loszewski In-Reply-To: <1058279163.193.2.camel@hades.bsdadmins.net.lucky.freebsd.questions> X-Newsgroups: lucky.freebsd.questions User-Agent: tin/1.5.18-20030602 ("Darts") (UNIX) (FreeBSD/4.8-STABLE (i386)) Message-Id: <20030716115841.079CA234@pm514-9.comsys.ntu-kpi.kiev.ua> Date: Wed, 16 Jul 2003 14:58:41 +0300 (EEST) cc: freebsd-questions@freebsd.org Subject: Re: Bandwidth Monitoring X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2003 11:59:50 -0000 On Tue, 15 Jul 2003 13:32:26 +0000 (UTC) in lucky.freebsd.questions, David Loszewski wrote: > Say I have a 20GB Data Transfer limit per month, is there a way to > monitor how much of that limit I've used up? MRTG doesn't seem to do the > job. > sysutils/ipa from the Ports Collection can do it. I even can try to write ipa.conf (but didn't test it), let 100, 200, 300 be IP Firewall rules which counts ingoing traffic from ISP: rule isp-ingoing { ipfw = 100 200 300 info = Ingoing traffic from ISP maxchunk = 1G # This allows to monitor traffic before limit 20G. # limit 10G { # byte_limit = 10G # zero_time = +M # reach { # exec = /bin/echo "10G reached" | /usr/bin/mail admin # } # expire { # expire_time = 0s # } # } # # This is 20G/month limit. limit 20G { byte_limit = 20G zero_time = +M reach { exec = /sbin/ipfw add 10 deny all from me to my-isp exec = /bin/echo "20G reached" | /usr/bin/mail admin } expire { expire_time = +M exec = /sbin/ipfw del 10 exec = /bin/echo "20G reached limit expired" | /usr/bin/mail admin } startup { if_limit_is_reached { exec = /sbin/ipfw add 10 deny all from me to my-isp } } } } I didn't test this config and it can contain errors! More information in IPA manual pages (also available on http://ipa-system.sourceforge.net/).