Fix for Rancid WARNING Processing

Russell Heilling russell at ccie.org.uk
Sun Feb 9 22:25:40 UTC 2003


Hi All,

The Rancid 2.2.2 code assumes that any WARNING messages in the output of
"show version" will be 2 lines, however there is a warning type which only has
one line.

If you have a GRP in slot 12-15 in a GSR12016 show version recommends that you
should only install RPs in slots 0-11.  The following output illustrates the
two warning types:

--- show version output (snipped for brevity) ---
WARNING: Old Rom Monitor in slot 15
Use "upgrade rom-monitor" command to update the image
WARNING: Recommend RP for 12016 is in slot 0 - 11
rtr12016uktlh1#
--- end output ---

The attached diff modifies the default behaviour to only read a single line
for the "Recommend RP" warning type.

Regards,

Russell Heilling

-- 
Russell Heilling
http://www.ccie.org.uk/
-------------- next part --------------
--- ../rancid-2.2.2/bin/rancid  2003-02-08 20:15:10.699995000 +0000
+++ bin/rancid  2003-02-09 22:09:07.758479000 +0000
@@ -272,9 +272,13 @@
                ProcessHistory("COMMENTS","keysort","I0","!\n");
            }
            ProcessHistory("COMMENTS","keysort","I1","! $_");
-           # The line after the WARNING is what to do about it.
-           $_ = <INPUT>; tr/\015//d;
-           ProcessHistory("COMMENTS","keysort","I1","!          $_");
+            if (/Recommend RP/) { # RP Slot Warning is only single line
+                $_ = "\n";
+            } else {
+                # The line after the WARNING is what to do about it.
+                $_ = <INPUT>; tr/\015//d;
+            }
+            ProcessHistory("COMMENTS","keysort","I1","!          $_");
        }
        if (/^Configuration register is (.*)$/) {
            $config_register=$1;




More information about the Rancid-discuss mailing list