Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Feb 2000 01:46:12 -0500 (EST)
From:      "Joe \"Marcus\" Clarke" <marcus@miami.edu>
To:        Sean-Paul Rees <sean@dreamfire.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Monitoring internet traffic on one interface
Message-ID:  <Pine.OSF.4.21.0002020141030.26160-100000@jaguar.ir.miami.edu>
In-Reply-To: <3897C305.B121A9DC@dreamfire.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <community>@<ip address> > mrtg.cfg

Where <community> is the read-only community string you configured in
ucd-snmp, and <ip address> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.4.21.0002020141030.26160-100000>