[mrtg] cfgmaker if_is_ciscovlan option

Pavel Ruzicka pavouk at pavouk.org
Sun Dec 24 18:48:25 MET 2006


Hello,

for me cfgmaker doesn't filter "unrouted VLAN" with this option:
--if-filter='$default && !$if_is_ciscovlan'.
(Tested on MRTG 2.14.3 and 2.15.0)

If I understand it correctly, that "if_is_ciscovlan" option
filters all vlans include unrouted vlans.
I look at perl code, and I probably found bad regular expression.
Problem is, that in normal vlans is number directly after word Vlan,
but in unrouted VLAN is one space between word VLAN a their number.

There is output from snmpwalk:
IF-MIB::ifDescr.91 = STRING: Vlan1
IF-MIB::ifDescr.92 = STRING: unrouted VLAN 1
IF-MIB::ifDescr.93 = STRING: unrouted VLAN 1002
IF-MIB::ifDescr.94 = STRING: unrouted VLAN 1004
IF-MIB::ifDescr.95 = STRING: unrouted VLAN 1005
IF-MIB::ifDescr.96 = STRING: unrouted VLAN 1003
IF-MIB::ifDescr.97 = STRING: Vlan2
IF-MIB::ifDescr.98 = STRING: unrouted VLAN 2
IF-MIB::ifDescr.99 = STRING: unrouted VLAN 101

If I change regular expression, that it works for me.
It filters normal and unrouted vlans.
This line I replace:
and $$i{Descr} =~ /^(unrouted )?V(LAN|lan)\d+$/);
With this line:
and $$i{Descr} =~ /^(unrouted )?V(LAN|lan)\s?\d+$/);

You can find it in cfgmaker by searching of "unrouted" word.
I'am not perl expert or programmer. Please comment it ;-)

Best regards,

Pavel Ruzicka

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the mrtg mailing list