Date: Sun, 10 Apr 2005 11:37:45 -0500 From: Dan Nelson <dnelson@allantgroup.com> To: Angelin Lalev <lalev@sv-bg.com> Cc: freebsd-questions@freebsd.org Subject: Re: net-snmp and mrtg question Message-ID: <20050410163745.GB284@dan.emsphone.com> In-Reply-To: <4258FDF0.40102@sv-bg.com> References: <4258FDF0.40102@sv-bg.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050410163745.GB284>