monitoring a dynamic ip interface with mrtg

I setup MRTG to monitor my ADSL connection, but what I was really watching was the network card on the pc with the pppoe client. Unfortunatly mrtg doesn’t seem to have a way of monitoring an ip that can change, you have to go on MAC address (pppoe mac is undefined), or interface number (which increases every time you connect).

So I’ve written a script that takes an ip address regular expression, and will report statistics on the first interface found that matches. Basic usage example:

Target[myrouter]: `/usr/local/bin/netstat-snmp-regex public myrouter ’10\.10\.’`

will report on the first interface that matches 10.10.*.* on myrouter.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>