Mack, David A (Dave)
2009-05-15 14:32:06 UTC
Hello!
We are current running rancid version, rancid-2.3.2a7 and have
run into a parsing issue for JunOSE devices (ERX-1440s and E320s). It
appears that certain slots are being excluded from the parsed output of
sh version and we have a need to see those slots. Details are provided
below:
Raw output from show version:
BLTMMD-VFTTP-37#sh ver
Juniper Edge Routing Switch E320
Copyright (c) 1999-2008 Juniper Networks, Inc. All rights reserved.
System Release: e320_9-0-1p0-7-3.rel
Version: 9.0.1 patch-0.7.3 [BuildId 10622] (March 8, 2009
21:10)
System running for: 352 days, 19 hours, 13 minutes, 28 seconds
(since TUE MAY 27 2008 18:15:28 UTC)
slot state type admin spare running release slot uptime
---- -------- ------- ------- ----- -------------------- --------------
0 standby LM-10 enabled spare e320_9-0-1p0-7-3.rel ---
1 online LM-4 enabled --- e320_9-0-1p0-7-3.rel 16d08h:14m:38s
2 --- --- --- --- --- ---
3 online LM-10 enabled --- e320_9-0-1p0-7-3.rel 16d08h:00m:20s
4 --- --- --- --- --- ---
5 online LM-10 enabled --- e320_9-0-1p0-7-3.rel 16d07h:59m:56s
6 standby SRP-320 enabled --- e320_9-0-1p0-7-3.rel ---
6 online SFM-320 enabled --- --- 16d08h:31m:30s
7 online SRP-320 enabled --- e320_9-0-1p0-7-3.rel 16d08h:31m:38s
7 online SFM-320 enabled --- --- 16d08h:31m:18s
8 online SFM-320 enabled --- --- 16d08h:31m:24s
9 online SFM-320 enabled --- --- 16d08h:31m:11s
10 online SFM-320 enabled --- --- 16d08h:31m:15s
11 online LM-10 enabled spare e320_9-0-1p0-7-3.rel 10d04h:36m:12s
12 online LM-10 enabled --- e320_9-0-1p0-7-3.rel 16d07h:53m:10s
13 online LM-10 enabled --- e320_9-0-1p0-7-3.rel 16d07h:52m:17s
14 online LM-10 enabled --- e320_9-0-1p0-7-3.rel 16d08h:08m:49s
15 online LM-10 enabled --- e320_9-0-1p0-7-3.rel 16d07h:57m:12s
16 inactive LM-10 enabled --- e320_9-0-1p0-7-3.rel ---
BLTMMD-VFTTP-37#
Here is the parsed output:
!RANCID-CONTENT-TYPE: Juniper_ERX
!
!Chassis type: E320 - a Juniper Edge Routing Switch E320
!
!System Release: e320_9-0-1p0-7-3.rel
!System Version: 9.0.1 patch-0.7.3 [BuildId 10622] (March 8, 2009
21:10)
!
! slot state type admin spare running release
! ---- -------- ------- ------- ----- --------------------
! 1 online LM-4 enabled --- e320_9-0-1p0-7-3.rel
! 3 online LM-10 enabled --- e320_9-0-1p0-7-3.rel
! 5 online LM-10 enabled --- e320_9-0-1p0-7-3.rel
! 6 online SFM-320 enabled --- ---
! 7 online SRP-320 enabled --- e320_9-0-1p0-7-3.rel
! 7 online SFM-320 enabled --- ---
! 8 online SFM-320 enabled --- ---
! 9 online SFM-320 enabled --- ---
! 10 online SFM-320 enabled --- ---
! 12 online LM-10 enabled --- e320_9-0-1p0-7-3.rel
! 13 online LM-10 enabled --- e320_9-0-1p0-7-3.rel
! 14 online LM-10 enabled --- e320_9-0-1p0-7-3.rel
! 15 online LM-10 enabled --- e320_9-0-1p0-7-3.rel
!
Here is the section of code that I believe that is responsible for
parsing:
# This routine parses "show version"
sub ShowVersion {
print STDERR " In ShowVersion: $_" if ($debug);
my($slots);
while (<INPUT>) {
tr/\015//d;
last if(/^$prompt/);
next if(/^(\s*|\s*$cmd\s*)$/);
next if (/^Please wait/i);
return(-1) if (/command authorization failed/i);
/^Juniper Edge .* (\S+)$/ &&
ProcessHistory("COMMENTS","keysort","A1",
"!Chassis type: $1 - a $_") && next;
/^System Release: / &&
ProcessHistory("COMMENTS","keysort","B1", "!$_") &&
next;
/^\s+(Version: .*)$/ &&
ProcessHistory("COMMENTS","keysort","B1", "!System
$1\n") &&
next;
if (/^(slot .*)\s+slot uptime/i) {
($slots++);
ProcessHistory("COMMENTS","keysort","B2", "!\n! $1\n");
next;
}
/^(--.*) --+$/ && $slots &&
ProcessHistory("COMMENTS","keysort","B2", "! $1\n") &&
next;
if (/^(\d+ +\S+ +(\S+).*) \S+$/ && $slots) {
my($line) = $1;
if ($2 != /--+/) {
ProcessHistory("COMMENTS","keysort","B3", "! $line\n");
}
next;
}
}
ProcessHistory("COMMENTS","keysort","B4","!\n");
return(0);
}
We are current running rancid version, rancid-2.3.2a7 and have
run into a parsing issue for JunOSE devices (ERX-1440s and E320s). It
appears that certain slots are being excluded from the parsed output of
sh version and we have a need to see those slots. Details are provided
below:
Raw output from show version:
BLTMMD-VFTTP-37#sh ver
Juniper Edge Routing Switch E320
Copyright (c) 1999-2008 Juniper Networks, Inc. All rights reserved.
System Release: e320_9-0-1p0-7-3.rel
Version: 9.0.1 patch-0.7.3 [BuildId 10622] (March 8, 2009
21:10)
System running for: 352 days, 19 hours, 13 minutes, 28 seconds
(since TUE MAY 27 2008 18:15:28 UTC)
slot state type admin spare running release slot uptime
---- -------- ------- ------- ----- -------------------- --------------
0 standby LM-10 enabled spare e320_9-0-1p0-7-3.rel ---
1 online LM-4 enabled --- e320_9-0-1p0-7-3.rel 16d08h:14m:38s
2 --- --- --- --- --- ---
3 online LM-10 enabled --- e320_9-0-1p0-7-3.rel 16d08h:00m:20s
4 --- --- --- --- --- ---
5 online LM-10 enabled --- e320_9-0-1p0-7-3.rel 16d07h:59m:56s
6 standby SRP-320 enabled --- e320_9-0-1p0-7-3.rel ---
6 online SFM-320 enabled --- --- 16d08h:31m:30s
7 online SRP-320 enabled --- e320_9-0-1p0-7-3.rel 16d08h:31m:38s
7 online SFM-320 enabled --- --- 16d08h:31m:18s
8 online SFM-320 enabled --- --- 16d08h:31m:24s
9 online SFM-320 enabled --- --- 16d08h:31m:11s
10 online SFM-320 enabled --- --- 16d08h:31m:15s
11 online LM-10 enabled spare e320_9-0-1p0-7-3.rel 10d04h:36m:12s
12 online LM-10 enabled --- e320_9-0-1p0-7-3.rel 16d07h:53m:10s
13 online LM-10 enabled --- e320_9-0-1p0-7-3.rel 16d07h:52m:17s
14 online LM-10 enabled --- e320_9-0-1p0-7-3.rel 16d08h:08m:49s
15 online LM-10 enabled --- e320_9-0-1p0-7-3.rel 16d07h:57m:12s
16 inactive LM-10 enabled --- e320_9-0-1p0-7-3.rel ---
BLTMMD-VFTTP-37#
Here is the parsed output:
!RANCID-CONTENT-TYPE: Juniper_ERX
!
!Chassis type: E320 - a Juniper Edge Routing Switch E320
!
!System Release: e320_9-0-1p0-7-3.rel
!System Version: 9.0.1 patch-0.7.3 [BuildId 10622] (March 8, 2009
21:10)
!
! slot state type admin spare running release
! ---- -------- ------- ------- ----- --------------------
! 1 online LM-4 enabled --- e320_9-0-1p0-7-3.rel
! 3 online LM-10 enabled --- e320_9-0-1p0-7-3.rel
! 5 online LM-10 enabled --- e320_9-0-1p0-7-3.rel
! 6 online SFM-320 enabled --- ---
! 7 online SRP-320 enabled --- e320_9-0-1p0-7-3.rel
! 7 online SFM-320 enabled --- ---
! 8 online SFM-320 enabled --- ---
! 9 online SFM-320 enabled --- ---
! 10 online SFM-320 enabled --- ---
! 12 online LM-10 enabled --- e320_9-0-1p0-7-3.rel
! 13 online LM-10 enabled --- e320_9-0-1p0-7-3.rel
! 14 online LM-10 enabled --- e320_9-0-1p0-7-3.rel
! 15 online LM-10 enabled --- e320_9-0-1p0-7-3.rel
!
Here is the section of code that I believe that is responsible for
parsing:
# This routine parses "show version"
sub ShowVersion {
print STDERR " In ShowVersion: $_" if ($debug);
my($slots);
while (<INPUT>) {
tr/\015//d;
last if(/^$prompt/);
next if(/^(\s*|\s*$cmd\s*)$/);
next if (/^Please wait/i);
return(-1) if (/command authorization failed/i);
/^Juniper Edge .* (\S+)$/ &&
ProcessHistory("COMMENTS","keysort","A1",
"!Chassis type: $1 - a $_") && next;
/^System Release: / &&
ProcessHistory("COMMENTS","keysort","B1", "!$_") &&
next;
/^\s+(Version: .*)$/ &&
ProcessHistory("COMMENTS","keysort","B1", "!System
$1\n") &&
next;
if (/^(slot .*)\s+slot uptime/i) {
($slots++);
ProcessHistory("COMMENTS","keysort","B2", "!\n! $1\n");
next;
}
/^(--.*) --+$/ && $slots &&
ProcessHistory("COMMENTS","keysort","B2", "! $1\n") &&
next;
if (/^(\d+ +\S+ +(\S+).*) \S+$/ && $slots) {
my($line) = $1;
if ($2 != /--+/) {
ProcessHistory("COMMENTS","keysort","B3", "! $line\n");
}
next;
}
}
ProcessHistory("COMMENTS","keysort","B4","!\n");
return(0);
}