[mrtg] excluding int types with "cfgmaker --if-filter"

Greg.Volk at edwardjones.com Greg.Volk at edwardjones.com
Wed Dec 19 18:12:34 MET 2001

I've been experimenting with the --if-filter option in cfgmaker
for a while now and am confused as to how to get it to evaluate
negative expressions.

For instance I want to have the following types of interfaces 
excluded from my config files:
28 (slip)
1 (other)
24 (softwareLoopback)
vlans (but not all type 53-propVirtual interfaces, I want configs
for port-channels etc)

So I think I can accomplish this with the following cfgmaker 

/usr/local/bin/cfgmaker --ifref=name --ifdesc=descr --no-down \
--subdirs=HOSTNAME '--if-filter=$default && $if_type!=28 && \
$if_type!=1 && $if_type!=24' public at test-switch > test-switch.cfg

The above line works in that it comments out Nulls, consoles, 
loopbacks, etc. However, I didn't address the exclusion of vlans 
in the filter so they are all still there. 

So how do I get rid of the vlans?

If I add "&& $if_type!=53" I exclude the vlans, but the port channel 
configs also go with them which is not good. I'm thinking I can use 
a negated form of the $if_is_ciscovlan predefined var, but haven't 
been able to figure out the syntax of the negation.

I'm sure someone out there is doing this kind of thing, and I'm
probably just going about it the wrong way. Any examples? 

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