[mrtg] Need help trying to figure out how to filter out a certain type of interface

Steve Shipway s.shipway at auckland.ac.nz
Mon Apr 20 22:19:56 CEST 2015

You need to modify your if-filter option.

--if-filter=(($if_is_ethernet || $if_is_ciscovlan) && $if_admin && $if_oper)"

To exclude interfaces with a description starting NDE_, do something like:

--if-filter=(($if_is_ethernet || $if_is_ciscovlan) && $if_admin && $if_oper && ($if_description !~ /^NDE_/))"

There are a number of other variables available for testing in the filter.  The filter should be a Perl code snippet that evaluates to true/false.



Steve Shipway
University of Auckland ITS
UNIX Systems Design Lead
s.shipway at auckland.ac.nz<mailto:s.shipway at auckland.ac.nz>
Ph: +64 9 373 7599 ext 86487

From: mrtg [mrtg-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] on behalf of Stephen D. Rasmussen [srasmussen at sfasu.edu]
Sent: Tuesday, 21 April 2015 3:40 a.m.
To: mrtg at lists.oetiker.ch
Subject: [mrtg] Need help trying to figure out how to filter out a certain type of interface


We are running MRTG and every time we run it the script I am running renders all of the interfaces I WANT it to, but also a couple which I don’t want.  I am hoping someone can tell me how to alter my current cfgmaker script to automatically ignore these interfaces.  My current script looks like this:

perl cfgmaker --ifdesc=alias --global WriteExpires:Yes --global "RunAsDaemon: yes" --global "options[_]: growright,bits" --global "WorkDir: c:\inetpub\wwwroot\mrtg" --output mrtg.cfg --subdirs=HOSTNAME --snmp-options=:::::2 "--if-filter=(($if_is_ethernet || $if_is_ciscovlan) && $if_admin && $if_oper)" XXXXXXXX@##.##.##.##<mailto:XXXXXXXX@##.##.##.##>

What I would like to do is put a filter in which automatically ignores interfaces with a DESCRIPTION like NDE_##.  Can anyone tell me what filter expression I could add to our cfgmaker script to ignore these automatically instead of having to comment them out of the config file after creation?

Thanks in advance,


Stephen Rasmussen
System Network Administrator
Telecommunications and Networking
Stephen F. Austin State University
P.O. Box 6095, SFA Station
Nacogdoches, Texas 75962-6095
srasmussen at sfasu.edu<mailto:srasmussen at sfasu.edu>  |  www.sfasu.edu<http://www.sfasu.edu/>

“The views and opinions expressed in this message are my own and do not necessarily reflect the views and opinions of Stephen F. Austin State University, its Board of Regents, or the State of Texas.”

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.oetiker.ch/pipermail/mrtg/attachments/20150420/2661be2a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 7452 bytes
Desc: image001.png
URL: <http://lists.oetiker.ch/pipermail/mrtg/attachments/20150420/2661be2a/attachment-0001.png>

More information about the mrtg mailing list