Cisco 1900s, fru, AS5300s and AS5400s...

Andre van der Merwe andre at is.co.za
Fri Feb 11 14:51:55 UTC 2005


Hi

NOTE:
This is for -test- purpose only please don't patch your
live systems...

We have added the following to the version RANCID (2.3.1) we run.

 - fru / product code support
 - 1900 improved support, (I hope :) )
 - Cisco AS5300, AS5400 basic "Slot" support

FRU/product code.

The additional field within the "Slot" field has been added and called
"fru" for now, this is the product "fru" code. The ability for 
RANCID to pick this up is based on the IOS you run and the age 
of the PA/NM cards. As usual Cisco does not have a standard way of 
doing this, so there a bit of kludging to make it work. 

Here is the "fru" field as shown in the sample below.

!RANCID-CONTENT-TYPE: Cisco
!
!Chassis type: 7206VXR - a 7200 router
!CPU: NPE-G1, SB-1 CPU at 700Mhz, impl 1025, Rev 0.2, 512KB L2 Cache
!
<snip>
!     
!Slot 1: fru PA-A3-OC3SMI=
!Slot 1: type ATM WAN OC3 SMI, 1 ports
!Slot 1: hvers 2.0 rev A0             
!Slot 1: part 73-2427-04, serial xxxxxxx
!
!Slot 2: fru PA-2E3=
!Slot 2: type E3 PA, 2 ports
!Slot 2: hvers 1.1 rev C0   
!Slot 2: part 73-2324-03, serial xxxxxxxx
!
!Slot 3: fru PA-8T-X21=
!Slot 3: type Mx serial X.21, 8 ports
!Slot 3: hvers 1.13 rev A0           
!Slot 3: part 73-1582-05, serial xxxxxx
!
!Slot 4: fru PA-MC-8TE1+
!Slot 4: type PA-MC-8TE1 Plus, 8 ports
!Slot 4: hvers 2.0 rev A0             
!Slot 4: part 800-19387-02, serial xxxxxxx
!
!Slot 6: fru PA-MC-8TE1+
!Slot 6: type PA-MC-8TE1 Plus, 8 ports
!Slot 6: hvers 2.0 rev A0       
!Slot 4: part 800-19387-02, serial xxxxxxx
!
!Slot 6: fru PA-MC-8TE1+
!Slot 6: type PA-MC-8TE1 Plus, 8 ports
!Slot 6: hvers 2.0 rev A0             
!Slot 6: part 800-19387-02, serial xxxxxxx
!
!Slot Midplane: hvers 2.8 rev B0
!Slot Midplane: part 73-3223-11, serial xxxxxxx
!
!Slot CPU: hvers 2.0 rev A0
!Slot CPU: part 28-5082-09, serial xxxxxxx
!

Here is the basic mod to "rancid" to get it all in.

-------
>           } elsif ( $proc =~ /^AS5300/) {
>                 $type = "AS5300";
>           } elsif ( $proc =~ /^AS5350/) {    
>                 $type = "AS5350";
>           } elsif ( $proc =~ /^AS5400/) {
>                 $type = "AS5400";
843a850,857
>       #
>       # For getting FRU part numbers from 7200's, not yet tested much.
>       #
>         if (/FRU\s+Part\s+Number:\s+(.*)/) {
>             ProcessHistory("SLOT","keysort","AF","!Slot $slot$WIC: fru $1\n");
>             next;
>       }
>       #
918a933,939
>           #
>           # AS5300/5400 handling
>           /^Hardware is\s+(.*)$/i &&
>                 ProcessHistory("SLOT","keysort","B","!Slot $slot: type $1\n") && next;
>           /^DFC type is\s+(.*)$/i &&
>                 ProcessHistory("SLOT","keysort","B","!Slot $slot: type $1\n") && next;
>           #
960a982,986
>                 # fru bits
>               if (/product \(fru\) number\s+:\s+(\S+)/i) { $fn = $1; }
>               if (/product number\s+:\s+(\S+)/i) { $fn = $1; }
>               #
> 
962a989,991
>           # fru bits
>           ProcessHistory("SLOT","keysort","AF","!Slot $slot$WIC: fru $fn\n");
>             #
971a1001,1010
>       # AS5x00 bits
>       /^\ Board Revision\s+(\S+),\s+Serial Number\s+(\S+),/ &&
>             ProcessHistory("SLOT","keysort","D","!Slot $slot$WIC: rev $1, serial $2\n") &&
>             next;
>       /^\ Board Hardware Version\s+(\S+),\s+Item Number\s+(\S+),/ &&
>             ProcessHistory("SLOT","keysort","D","!Slot $slot$WIC: hvers $1, part $2\n") &&
>             next;
>       /^Motherboard Info:/ &&
>             ProcessHistory("SLOT","keysort","D","!Slot $slot$WIC: Motherboard\n") &&
>             next;
1157a1197,1203
> 
>       # 1900's have spaces in the config which move around when
>       # changes are made, this get rid of them...
>       if ($type =~ /^1900$/ && /^$/) { 
>               next;
>       }
--------

The other thing we have done is hopefully improve the Cat 1900 support by adding
some pager handling stuff to clogin, we are now able to use RANCID collect       
configs from our group of 1900's they don't support "term length 0" as far as I can
see.

Here is the basic mod to "clogin".

--------
531a532,535
>               # 1900 pager sucks
>               -re "^\[\n\r]*^--More--\[\n\r\]*" { send " "
>                                                 exp_continue}
>               #
561a566,569      
>               # 1900 Pager sucks
>               -re "^\[\n\r]*^--More--\[\n\r]*" { send " "
>                                                 exp_continue}
>               #
--------         

Hope this helps.


André van der Merwe


More information about the Rancid-discuss mailing list