From owner-freebsd-questions Tue Feb 1 22:46:20 2000 Delivered-To: freebsd-questions@freebsd.org Received: from jaguar.ir.miami.edu (jaguar.ir.miami.edu [129.171.32.10]) by builder.freebsd.org (Postfix) with ESMTP id 45F513E01 for ; Tue, 1 Feb 2000 22:46:17 -0800 (PST) Received: from jaguar.ir.miami.edu ("port 1916"@jaguar.ir.miami.edu [129.171.32.10]) by jaguar.ir.miami.edu (PMDF V5.2-32 #40232) with ESMTP id <0FPA0013JIT0KA@jaguar.ir.miami.edu> for freebsd-questions@FreeBSD.ORG; Wed, 2 Feb 2000 01:46:12 -0500 (EST) Date: Wed, 02 Feb 2000 01:46:12 -0500 (EST) From: "Joe \"Marcus\" Clarke" Subject: Re: Monitoring internet traffic on one interface In-reply-to: <3897C305.B121A9DC@dreamfire.net> To: Sean-Paul Rees Cc: freebsd-questions@FreeBSD.ORG Message-id: MIME-version: 1.0 Content-type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Sure, it's pretty easy. First, you need to compile and install /usr/ports/net/ucd-snmp. This will give you SNMPv1, v2, and v3 support. That's somewhat of an over-kill if all you're interested in is ifIn/OutOctets, but it does the job. Next, install mrtg. Then, just run cfgmaker @ > mrtg.cfg Where is the read-only community string you configured in ucd-snmp, and is the ip address on your machine (either one of them). Now, edit mrtg.cfg to add a WorkDir parameter at the top. After that, you can add a crontab entry that looks like: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * root /usr/local/bin/mrtg /usr/local/etc/mrtg/mrtg.cfg >/dev/null 2>&1 And you're set. every five minutes MRTG will snapshot ifInOctets and ifOutOctets on each interface on your box, and create HTML for them. You aren't limited to In and Out Octets either. You can configure MRTG to poll all sorts of variables from RFC1213, the TCP-MIB, UDP-MIB, and IF-MIB (as well as private UCDavis OIDs). Joe Clarke On Tue, 1 Feb 2000, Sean-Paul Rees wrote: > I've read about, and seen graphs produced by MRTG. To say the least, I > was very impressed with the product :-) > > I run FreeBSD on a machine with 2 NIC cards. It runs NAT for my cable > modem here at home. I'm wondering if & how it is possible to setup MRTG > and SNMP in such a way that it could monitor the bandwidth going in/out > my cable modem and produce those lovely graphs. > > My network interfaces are setup like this: > > 192.168.10.x <-> xl0 <-> FreeBSD+NATD <-> lnc1 <-> Cable Modem > > The cable modem is plugged directly into lnc1. > > Thanks, > Sean > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message