From owner-freebsd-questions@FreeBSD.ORG Sun Apr 10 16:37:46 2005 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 64B6116A4CE for ; Sun, 10 Apr 2005 16:37:46 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 081A343D1D for ; Sun, 10 Apr 2005 16:37:46 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j3AGbjbw065369; Sun, 10 Apr 2005 11:37:45 -0500 (CDT) (envelope-from dan) Date: Sun, 10 Apr 2005 11:37:45 -0500 From: Dan Nelson To: Angelin Lalev Message-ID: <20050410163745.GB284@dan.emsphone.com> References: <4258FDF0.40102@sv-bg.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4258FDF0.40102@sv-bg.com> X-OS: FreeBSD 5.4-PRERELEASE X-message-flag: Outlook Error User-Agent: Mutt/1.5.8i cc: freebsd-questions@freebsd.org Subject: Re: net-snmp and mrtg question 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: Sun, 10 Apr 2005 16:37:46 -0000 In the last episode (Apr 10), Angelin Lalev said: > I have FreeBSD router with two interfaces. Every interface has > several networks. The basic configuration of snmpd and mrtg allow me > to monitor the load only on per-interface basis, but I need to be > able to monitor the traffic on each network separately. Is there a > way to do it via net-snmp / mrtg? Are there orther tools with output > similar to mrtg (prefferably the same), which can do this? Try this. Add some ipfw count rules, two per network you want to monitor: add 1000 count ip from any to network1/mask out add 1001 count ip from network1/mask to any in , create a shell script called /usr/local/bin/get-ipfw-stats: #! /bin/sh inrule=$1 outrule=$2 set -- $(ipfw show $inrule) echo $3 set -- $(ipfw show $outrule) echo $3 uptime hostname , and use this in your Target line in your mrtg config file: Target[net1]: `/usr/local/bin/get-ipfw-stats 1000 1001` -- Dan Nelson dnelson@allantgroup.com