[rancid] small 6500/7600 ShowVersion bug in bin/rancid

Yuval Ben-Ari yuvalba at netvision.net.il
Sat Dec 23 22:54:11 UTC 2006


sorry, not sure if this was already noted.
I had few Catalyst 6500/7600 routers that rancid was missing the IOS
image line. the show ver output is like this:
IOS (tm) s72033_rp Software (s72033_rp-ADVIPSERVICESK9_WAN-M), Version
12.2(18)SXF4, RELEASE SOFTWARE (fc1)

the reason for the problem is the underscore sign inside the brackets.
(the regexp was looking for [A-Za-z-0-9])

my fix:

@@ -160,7 +160,7 @@
        # PIX fail-over license
        /^This PIX has an?\s+(.*)$/ &&
            ProcessHistory("COMMENTS","keysort","C1", "!$_") && next;
-       /^(Cisco )?IOS .* Software,? \(([A-Za-z-0-9]*)\),
.*Version\s+(.*)$/ &&
+       /^(Cisco )?IOS .* Software,? \((.*)\), .*Version\s+(.*)$/ &&


I have a feeling that we are playing a game here with Cisco developers,
they want to test how complex does one regexp should be in order to
match all show version possible outputs.

Yuval
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20061224/5f51bc62/attachment.html 


More information about the Rancid-discuss mailing list