[mrtg] Ignoring certain types of interfaces

Patrick Topping ptopping at pobox.com
Mon Oct 20 16:34:22 CEST 2008


Steve,

I have updated my cfgmaker with your filter suggestion and I am still 
getting the l2vlan interfaces in the CFG files.  The ifType shows the 
l2vlan as 135.  I wrote the filter to include $default and 
gigabitEthernet (117) but still no joy.  Any ideas?

-Patrick

-------------------------------

cfgmaker  --if-template=/etc/mrtg/Templates/routers2.tp 
--output=/etc/mrtg/fsigt-001-eqla3.stk.cfg --global "workdir: 
/var/www/mrtg/rrd" --ifref=descr --ifdesc=alias --global 'options[_]: 
growright,bits' ubaVcj8PYF at fsigt-001-eqla3.stk:::::2 --no-down 
'--if-filter=$default or ($if_type==117)'

[root at bandit mrtg]#  snmpwalk -c ubaVcj8PYF -v 2c 10.0.0.248 ifType

IF-MIB::ifType.65 = INTEGER: gigabitEthernet(117)
IF-MIB::ifType.66 = INTEGER: gigabitEthernet(117)

IF-MIB::ifType.265 = INTEGER: l2vlan(135)
IF-MIB::ifType.411 = INTEGER: l2vlan(135)
IF-MIB::ifType.431 = INTEGER: l2vlan(135)
IF-MIB::ifType.432 = INTEGER: l2vlan(135)

------------------------------

Steve Shipway wrote:
>> '--if-filter=$default && $if_type!=28 && $if_type!=1 && $if_type!=24 && $if_type!=135'
>>
>> The VE interfaces show up in ifType as 135 so I thought this would work.
>>     
>
> That filter will not work - the filter is supposed to evaluate to 'true' if you want to KEEP the interface, not if you want to remove it.  Also, this is Perl, so use 'and' and 'or' and not '&&' and '||' (as you would in C).  So you need something like:
>
> --if-filter='$default or ($if_type==28) or ($if_type==1) or ($if_type==24) or ($if_type==135)'
>
> Put brackets around the tests if it makes you feel more comfortable.
>
> Steve
>
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/mrtg/attachments/20081020/2d66c4b1/attachment.html 


More information about the mrtg mailing list