dotwaffle / rancid-git

DEPRECATED -- Strongly consider using the upstream, the version here is very out of date and a poor place to start from!
http://www.shrubbery.net/rancid/
Other
218 stars 92 forks source link

Virtual-Access interfaces should be skipped #19

Closed jeremyvisser closed 9 years ago

jeremyvisser commented 10 years ago

Inside /usr/lib/rancid/bin/rancid, I have commented out the following parameters to @commandtable, because they were very noisy:

#{'show snmp mib ifmib ifindex'  => 'ShowIfIndex'},
#{'show interface'      => 'ShowInterface'},

(I also commented out the show shun line too due to noise, but that is beyond the scope of this report.)

In my circumstance, the routers with the noise operate as LNS'es — i.e. terminating PPPoE or L2TP sessions, with dozens of Virtual-Access interfaces appearing and/or disappearing every hour.

However, I can see why it is useful to have the output. To reach a compromise, it may be useful to test for and skip Virtual-Access interfaces, which only last for the lifetime of the PPP session.

For example, in sub ShowInterface, the following line appears in two places:

ProcessHistory("INT","keysort",$interface->{'name'},"!Interface: " . PrintInterface($interface) . "\n") if (defined $interface);

Perhaps it would be possible to skip Virtual-Access interfaces (please excuse me, this is literally the first line of Perl I have ever written, which may not actually work):

ProcessHistory("INT","keysort",$interface->{'name'},"!Interface: " . PrintInterface($interface) . "\n") if (defined $interface && !($interface->{'name'} =~ /^Virtual-Access/));

With something similar in sub ShowIfIndex to skip Virtual-Access indexes.

Thoughts?

dotwaffle commented 10 years ago

I haven't got anything to test this with -- I don't work for an access ISP. Perhaps this is worth contributing to rancid-discuss? http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss

jeremyvisser commented 10 years ago

This is not applicable to upstream RANCID, because this is a feature added by Stefan Kublik in 7c024be3868d4451982a61d2a0b8d0efdac97c8e.

Pretty sure if upstream RANCID added this feature, all hell would break loose. ;-)

dotwaffle commented 10 years ago

Point taken ;)

Can you test it? I'm a bit hesitant to include code that hasn't been tested in a live environment. If you're able to do a pull request too, I'd be happy to merge it!

jeremyvisser commented 10 years ago

Wasn't expecting you to add the code willy-nilly — was just throwing it out there for the possibility of comments if you have any. :-)

Likely I'll run the code (and any other modifications I need) for a few weeks and let you know a final result.

dotwaffle commented 10 years ago

Marvellous =)

jnorell commented 9 years ago

An afterthought is this could be made a config file variable, to enable/disable as needed. Might be overkill though, I'm happy with "ignore all Virtual-Access" in our environment (isp router terminating dsl connections).