[rancid] exos.pm: patch to gather stack information
James Andrewartha
jandrewartha at ccgs.wa.edu.au
Thu Jan 2 05:39:20 UTC 2020
Hi,
The patch below adds extra parsing to ShowVersion in exos.pm, to print
out the individual device serial numbers, bootrom and image version.
Mostly I wanted the serial number, since the others are normally the
same across a stack.
Here's two examples of output, for a standalone switch, and a stack:
#Switch: Serial 1638N-41359, BootROM 1.0.1.8, IMG 22.6.1.4
#Slot-1: Serial 1637N-41621, BootROM 1.0.1.8, IMG 22.6.1.4
#Slot-2: Serial 1638N-41448, BootROM 1.0.1.8, IMG 22.6.1.4
#Slot-3: Serial 1638N-41354, BootROM 1.0.1.8, IMG 22.6.1.4
#Slot-4: Serial 1638N-41318, BootROM 1.0.1.8, IMG 22.6.1.4
#Slot-5: Serial 1638N-41357, BootROM 1.0.1.8, IMG 22.6.1.4
This patch might be fuzzy since I generated it against upstream but I'm
running 3.9-1~bpo9+1 from Debian. Also I only have X440-G2s to test against.
--- exos.pm.in 2020-01-02 13:30:04.000000000 +0800
+++ /usr/share/perl5/rancid/exos.pm 2020-01-02 12:09:27.000000000 +0800
@@ -106,6 +149,9 @@
/^bootrom\s+:\s+(.*)/i &&
ProcessHistory("COMMENTS","keysort","D1","#\n#Bootrom: $1\n")
&& next;
+ /^(Slot-\d|Switch)\s+:\s+[^\s]+\s+([^\s]+).*BootROM:
([^\s]+)\s+IMG: ([^\s]+)/i &&
+ ProcessHistory("COMMENTS","keysort","D2","#$1: Serial $2,
BootROM $3, IMG $4\n")
+ && next;
#XXX: need to collect this from show vers for ShowSlot where rev #s are
excluded
#SLOT 1 : 702005-06 0025S-00877 CPLD Rev <FF>
Thanks,
--
James Andrewartha
Network & Projects Engineer
Christ Church Grammar School
Claremont, Western Australia
Ph. (08) 9442 1757
Mob. 0424 160 877
More information about the Rancid-discuss
mailing list