[mrtg] cfgmaker using selective interface.

Mersberger, Robert robert.mersberger at goldenliving.com
Tue Jul 22 23:58:31 CEST 2008


sub interfaces have the same value 32 and will also be equal to
$if-is_wan.  Cannot eliminate $if_type =32 becaues this would also
eliminate se0/0/0
 

-----Original Message-----
From: Dan [mailto:mrtg at dandoore.com] 
Sent: Tuesday, July 22, 2008 4:17 PM
To: Mersberger, Robert
Cc: mrtg-bounces at lists.oetiker.ch; mrtg at lists.oetiker.ch
Subject: Re: [mrtg] cfgmaker using selective interface.

Mersberger, Robert wrote:
> Is it possible to setup cfgmaker to only poll specific interfaces? 
> Example: I have routers with multiple subinterface but I only want to 
> poll the primary interfaces like fa0/0, fa0/1 and se0/0/0.  I would 
> like to be able to do this with cfgmaker because right now I run 
> cfgmaker then edit the created cfg file and either remove or comment 
> out the interface I do not want to monitor.  This creates problems 
> when I have to recreate the cfg file after a routers configuration 
> changes, like when a port speed in up dated.

There's two ways of doing this that I've used:

1. Use filters with cfgmaker - use something like
'--if-filter=($default_iftype && ($if_is_ethernet || ($if_is_wan &&
$if_type!=44)))'

2. Use a template with cfgmaker and put a condition on target processing
to match the above criteria with a Perl expression - I do this to filter
out interfaces that I'm not bothered about and tweak parameters on
others so it's more flexible than a filter.

See the template section of the cfgmaker docs and look at 'Template
Example 1' and you can add an extra condition to the section under
if(not $problem_lines) to match or reject interfaces that you wish to
have - I've used a string match on part of the interface name to
explicitly reject things like vlan interfaces and virtual bits that
cfgmaker picks up off some cisco routers.

It's all in http://oss.oetiker.ch/mrtg/doc/cfgmaker.en.html though so
have a dig.

Dan.



Please consider the environment before printing this e-mail.

CONFIDENTIAL NOTICE:
This e-mail message and any attachment(s) (collectively, this 'Email') are intended
only for the confidential use of the recipient(s) named above. If the reader of this
message is not the intended recipient named above or an agent responsible for
delivering it to the intended recipient named above, you have received this Email in error.
Please notify the sender immediately and permanently delete this Email and any copies thereof.



More information about the mrtg mailing list