summaryrefslogtreecommitdiffstats
path: root/bin/rancid.in
diff options
context:
space:
mode:
Diffstat (limited to 'bin/rancid.in')
-rwxr-xr-xbin/rancid.in102
1 files changed, 61 insertions, 41 deletions
diff --git a/bin/rancid.in b/bin/rancid.in
index 0948cca..4bd7ee3 100755
--- a/bin/rancid.in
+++ b/bin/rancid.in
@@ -573,10 +573,10 @@ sub ShowDiagbus {
} elsif (/^\s*Slot (\d+) \(virtual\):/i) {
$slot = $1;
next;
- } elsif (/^\s*(.*Processor.*|.*controller|.*Chassis Interface), HW rev (\S+), board revision (\S+)/i) {
+ } elsif (/^\s*(.*Processor.*|.*controller|.*controler|.*Chassis Interface)(, FRU\s?:.*)?, HW rev (\S+), board revision (\S+)/i) {
$board = $1;
- $hwver = $2;
- $boardrev = $3;
+ $hwver = $3;
+ $boardrev = $4;
if ($board =~ /Processor/) {
if ($board =~ /7000 Route\/Switch/) {
$board = "RSP7000";
@@ -626,8 +626,8 @@ sub ShowDiagbus {
}
next;
}
- /\s+(.*) (IP|PA), (\d) ports?, (\S+)/ &&
- ProcessHistory("SLOT","","","!Slot $slot/$board: type $4, $3 ports\n") &&
+ /\s+(.*) (IP|PA), (\d) ports?,( \S+,)? (FRU\s?: )?(\S+)/ &&
+ ProcessHistory("SLOT","","","!Slot $slot/$board: type $6, $3 ports\n") &&
next;
/\s+(.*) (IP|PA)( \(\S+\))?, (\d) ports?/ &&
ProcessHistory("SLOT","","","!Slot $slot/$board: type $1$3, $4 ports\n") &&
@@ -655,53 +655,56 @@ sub ShowDiag {
# return(1) if ($type !~ /^(12[40]|720|36|26)/);
return(-1) if (/command authorization failed/i);
/^$/ && next;
- if (!defined($showdiags)) {$showdiags=1; ProcessHistory("SLOT","","","!\n");}
s/Port Packet Over SONET/POS/;
if (/^\s*SLOT\s+(\d+)\s+\((.*)\): (.*)/) {
$slot = $1;
- ProcessHistory("SLOT","","","!Slot $slot: $3\n");
- # Here we look for boards that don't have DRAM.
- $board = "Other";
- $board = "PS" if (/Power Supply/);
- $board = "RP" if (/Route Processor/);
- $board = "CLK" if (/Clock Scheduler Card/);
- $board = "SFC" if (/Switch Fabric Card/);
+ ProcessHistory("SLOT","","","!\n");
+ ProcessHistory("SLOT","keysort","A","!Slot $slot: $3\n");
next;
}
- if (/^\s+MAIN:\s+ type \d+,\s+(.*)/) {
- ProcessHistory("SLOT","","","!Slot $slot/MAIN: part $1\n") && next;
+ if (/^\s+MAIN:\s* type \d+,\s+(.*)/) {
+ ProcessHistory("SLOT","keysort","AM","!Slot $slot/MAIN: part $1\n") && next;
}
if (/ Engine:\s+(.*)/) {
- ProcessHistory("SLOT","","","!Slot $slot/Engine: $1\n");
+ ProcessHistory("SLOT","keysort","AE","!Slot $slot/Engine: $1\n");
}
if (/^\s+PCA:\s+(.*)/) {
local($part) = $1;
$_ = <INPUT>;
/^\s+HW version (\S+)\s+S\/N (\S+)/ &&
- ProcessHistory("SLOT","","","!Slot $slot/PCA: part $part, serial $2\n") &&
- ProcessHistory("SLOT","","","!Slot $slot/PCA: hvers $1\n");
+ ProcessHistory("SLOT","keysort","C1","!Slot $slot/PCA: part $part, serial $2\n") &&
+ ProcessHistory("SLOT","keysort","C2","!Slot $slot/PCA: hvers $1\n");
next;
}
if (/^\s+MBUS: .*\)\s+(.*)/) {
local($tmp) = "!Slot $slot/MBUS: part $1";
$_ = <INPUT>;
/^\s+HW version (\S+)\s+S\/N (\S+)/ &&
- ProcessHistory("SLOT","","","$tmp, serial $2\n") &&
- ProcessHistory("SLOT","","","!Slot $slot/MBUS: hvers $1\n");
+ ProcessHistory("SLOT","keysort","MB1","$tmp, serial $2\n") &&
+ ProcessHistory("SLOT","keysort","MB2","!Slot $slot/MBUS: hvers $1\n");
next;
}
if (/^\s+MBUS Agent Software version (.*)/) {
- local($sw) = $1;
- local($tail) = "!\n" if ($board ne "Other");
- ProcessHistory("SLOT","","","!Slot $slot/MBUS: software $sw\n$tail");
+ ProcessHistory("SLOT","keysort","MB3","!Slot $slot/MBUS: software $1\n");
+ next;
+ }
+ if (/^\s+ROM Monitor version (.*)/) {
+ ProcessHistory("SLOT","keysort","R","!Slot $slot/ROM Monitor: version $1\n");
+ next;
+ }
+ if (/^\s+Fabric Downloader version used (.*)/) {
+ ProcessHistory("SLOT","keysort","Z","!Slot $slot/Fabric Downloader: version $1\n");
next;
}
if (/^\s+DRAM size: (\d+)/) {
local($dram) = $1 / 1048576;
$_ = <INPUT>;
- /^\s+FrFab SDRAM size: (\d+)/ &&
- ProcessHistory("SLOT","","","!Slot $slot/MBUS: $dram Mbytes DRAM, "
- . $1 / 1024 . " Kbytes SDRAM\n!\n");
+ if (/^\s+FrFab SDRAM size: (\d+)/) {
+ ProcessHistory("SLOT","keysort","MB4","!Slot $slot/MBUS: $dram Mbytes DRAM, "
+ . $1 / 1024 . " Kbytes SDRAM\n");
+ } else {
+ ProcessHistory("SLOT","keysort","MB4","!Slot $slot/MBUS: $dram Mbytes DRAM\n");
+ }
next;
}
# 7200 and 3600 stuff
@@ -721,24 +724,26 @@ sub ShowDiag {
s/ with MII or RJ45/-TX/;
s/Fast-ethernet /100Base/; s/[)(]//g;
+ ProcessHistory("SLOT","","","!\n");
/\s+(.*) port adapter,?\s+(\d+)\s+/i &&
- ProcessHistory("SLOT","","","!Slot $slot: type $1, $2 ports\n");
+ ProcessHistory("SLOT","keysort","B","!Slot $slot: type $1, $2 ports\n");
# I/O controller with no interfaces
/\s+(.*)\s+port adapter\s*$/i &&
- ProcessHistory("SLOT","","","!Slot $slot: type $1, 0 ports\n");
+ ProcessHistory("SLOT","keysort","B","!Slot $slot: type $1, 0 ports\n");
/\s+(.*)\s+daughter card(.*)$/ &&
- ProcessHistory("SLOT","","","!Slot $slot$WIC: type $1$2\n");
+ ProcessHistory("SLOT","keysort","B","!Slot $slot$WIC: type $1$2\n");
/\s+(FT1)$/ &&
- ProcessHistory("SLOT","","","!Slot $slot$WIC: type $1\n");
+ ProcessHistory("SLOT","keysort","B","!Slot $slot$WIC: type $1\n");
next;
}
/revision\s+(\S+).*revision\s+(\S+)/ &&
- ProcessHistory("SLOT","","","!Slot $slot$WIC: hvers $1 rev $2\n") &&
+ ProcessHistory("SLOT","keysort","C","!Slot $slot$WIC: hvers $1 rev $2\n") &&
next;
/number\s+(\S+)\s+Part number\s+(\S+)/ &&
- ProcessHistory("SLOT","","","!Slot $slot$WIC: part $2, serial $1\n!\n") &&
+ ProcessHistory("SLOT","keysort","D","!Slot $slot$WIC: part $2, serial $1\n") &&
next;
}
+ ProcessHistory("SLOT","","","!\n");
return(0);
}
@@ -789,7 +794,7 @@ sub ShowC7200 {
#return(1) if ($type !~ /^72/);
return(-1) if (/command authorization failed/i);
/^$/ && next;
- if (/C7200 Midplane EEPROM:/) {
+ if (/^(C7200 )?Midplane EEPROM:/) {
$_ = <INPUT>;
/revision\s+(\S+).*revision\s+(\S+)/;
ProcessHistory("SLOT","","","!Slot Midplane: hvers $1 rev $2\n");
@@ -799,12 +804,21 @@ sub ShowC7200 {
next;
}
if (/C720\d(VXR)? CPU EEPROM:/) {
- $_ = <INPUT>;
- /revision\s+(\S+).*revision\s+(\S+)/ &&
- ProcessHistory("SLOT","","","!Slot CPU: hvers $1 rev $2\n");
- $_ = <INPUT>;
- /number\s+(\S+)\s+Part number\s+(\S+)/ &&
- ProcessHistory("SLOT","","","!Slot CPU: part $2, serial $1\n!\n");
+ my ($hvers,$rev,$part,$serial);
+ # npe400s report their cpu eeprom info differently w/ 12.0.21S
+ while (<INPUT>) {
+ /Hardware Revision\s+: (\S+)/ && ($hvers = $1) && next;
+ /Board Revision\s+: (\S+)/ && ($rev = $1) && next;
+ /Part Number\s+: (\S+)/ && ($part = $1) && next;
+ /Serial Number\s+: (\S+)/ && ($serial = $1) && next;
+ /revision\s+(\S+).*revision\s+(\S+)/ &&
+ ($hvers = $1, $rev = $2) && next;
+ /number\s+(\S+)\s+Part number\s+(\S+)/ &&
+ ($serial = $1, $part = $2) && next;
+ /^\s*$/ && last;
+ }
+ ProcessHistory("SLOT","","","!Slot CPU: hvers $hvers rev $rev\n");
+ ProcessHistory("SLOT","","","!Slot CPU: part $part, serial $serial\n!\n");
next;
}
}
@@ -904,8 +918,10 @@ sub WriteTerm {
}
next;
}
- if (/^username (\S+)(\s.*)? password /) {
- if ($filter_pwds >= 1) {
+ if (/^username (\S+)(\s.*)? password ((\d) \S+|\S+)/) {
+ if ($filter_pwds == 2) {
+ ProcessHistory("USER","keysort","$1","!username $1$2 password <removed>\n");
+ } elsif ($filter_pwds == 1 && $4 ne "5"){
ProcessHistory("USER","keysort","$1","!username $1$2 password <removed>\n");
} else {
ProcessHistory("USER","keysort","$1","$_");
@@ -1099,6 +1115,8 @@ sub DoNothing {print STDOUT;}
'dir /all disk0:' => "DirSlotN",
'dir /all slot1:' => "DirSlotN",
'dir /all disk1:' => "DirSlotN",
+ 'dir /all slot2:' => "DirSlotN",
+ 'dir /all disk2:' => "DirSlotN",
"dir /all sup-bootflash:"=> "DirSlotN", # cat 6500-ios
"dir /all sup-microcode:"=> "DirSlotN", # cat 6500-ios
'show controllers' => "ShowContAll",
@@ -1128,6 +1146,8 @@ sub DoNothing {print STDOUT;}
"dir /all disk0:",
"dir /all slot1:",
"dir /all disk1:",
+ "dir /all slot2:",
+ "dir /all disk2:",
"dir /all sup-bootflash:",
"dir /all sup-microcode:",
"show controllers",