[mrtg] Re: option to bind MRTG to a specific interface

Daniel J McDonald dan.mcdonald at austinenergy.com
Mon Jun 2 22:11:21 MEST 2003

On Mon, 2003-06-02 at 14:31, james wrote:
> Is there a switch or flag that I can start MRTG with to bind to a
> specific ethernet interface ?

Sort of, you can specify the source interface in the snmp queries.  The
syntax for this is not documented in the mrtg manuals - it's in the
SNMP_util.pm README file...

The port parameter was recently augmented to allow the specification of
the IP address (or hostname) and port of the machine doing the query in
addition to the IP address (or hostname) and port of the machine being
queried.  Some machines have additional security features that only allow
SNMP queries to come from certain IP addresses.  If the host doing the
query has multiple interface, it may be necessary to specify the interface
the query should come from.  The port parameter is further broken down
into "remote_port!local_address!local_port".  Here are some examples:

    somehost:161!!4000  use and port 4000 as source
    somehost:!          use as source
    somehost:!!4000                use port 4000 as source

Most people will only need to use the first form ("somehost").
So, taking the mrtg manual statement:
Extended Host Name Syntax.

        In all places where ``community at router'' is accepted, you can
        add additional parameters for the SNMP communication using
        colon-separated suffixes. The full syntax is as follows:
         community at router[:[port][:[timeout][:[retries][:[backoff][:version]]]]]
        where the meaning of each parameter is as follows:
                the UDP port under which to contact the SNMP agent
                (default: 161)
                initial timeout for SNMP queries, in seconds (default:
                number of times a timed-out request will be retried
                (default: 5)
                factor by which the timeout is multiplied on every retry
                (default: 1.0).
                for SNMP version. If you have a fast router you might
                want to put a '2' here. This will make mrtg try to poll
                the 64 bit counters and thus prevent excessive counter
                wrapping. Not all routers support this though.
                 3:public at router1:::::2

The "port" section can be extended to specify the source address (and,
if truly needed, the source port).  Something like:
3:public at router1:!

That might make a good manual addition.
Daniel J McDonald, CCIE 2495, CNX
Austin Energy

Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the mrtg mailing list