[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...
[blockquote]
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
somehost:161
somehost:161!192.168.2.4!4000 use 192.168.2.4 and port 4000 as source
somehost:!192.168.2.4 use 192.168.2.4 as source
somehost:!!4000 use port 4000 as source
Most people will only need to use the first form ("somehost").
[/blockquote]
So, taking the mrtg manual statement:
[blockquote]
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:
port
the UDP port under which to contact the SNMP agent
(default: 161)
timeout
initial timeout for SNMP queries, in seconds (default:
2.0)
retries
number of times a timed-out request will be retried
(default: 5)
backoff
factor by which the timeout is multiplied on every retry
(default: 1.0).
version
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.
Example:
3:public at router1:::::2
[/blockquote]
The "port" section can be extended to specify the source address (and,
if truly needed, the source port). Something like:
3:public at router1:!10.10.10.1::::2
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