Nortel Passport
Tony Tauber
ttauber at 1-4-5.net
Thu Jul 22 18:20:22 UTC 2004
Hi all,
I'm finally making use of this fine tool. I needed to be able to
collect configs from Nortel Passport switches and found some
discussion in the archives about this topic but nothing definitive.
We also have a few Nortel Bay routers for which blogin and brancid
work fine.
I found I had to make the following modifications for Passports:
copy blogin and brancid to passlogin and passrancid, respectively.
Diffs of these files are at the bottom but the changes are:
In passlogin,
- disable paging with "config cli more false".
In passrancid,
- change the commands to ones that work for Passports
- fix the logic which searches for the end of file to look for
a line beginning with the word "back"
- fix internal references to "blogin" to say "passlogin"
- look for prompts ending in "#" rather than ">"
(I don't know this gear so well, these prompts may be
specific to our deployment.)
In rancid-fe, add this line for the new device type:
elsif ($vendor =~ /^passport$/i) { exec('passrancid', $router); }
Hope this info can help others.
Sorry if it has actually been covered before.
Don't know if it makes sense to include in a future rev. of the tool.
Tony
diff blogin passlogin
440c440,441
< send "more off\r"
---
> #send "more off\r"
> send "config cli more false\r"
492,493c493
< #set prompt "#"
< set prompt ">"
---
> set prompt "#"
499,500c499
< #set prompt "#"
< set prompt ">"
---
> set prompt "#"
610c609,610
< send "more off\r"
---
> #send "more off\r"
> send "config cli more false\r"
3c3
diff brancid passrancid
35c35
< $timeo = 90; # blogin timeout in seconds
---
> $timeo = 90; # passlogin timeout in seconds
142d141
<
156a156,161
> if (/^(exit|back)$/) {
> #if (/^exit$/) {
> $found_end = 1;
> ProcessHistory("","","","$_");
> return(1);
> }
160,163d164
< if (/exit$/) {
< $found_end = 1;
< return(1);
< }
190,193c191
< 'bcc' => "RunCommand",
< 'show config' => "ShowConfig",
< 'show config -all' => "ShowConfig",
< 'exit' => "RunCommand"
---
> 'show config' => "ShowConfig"
198,201c196
< "bcc",
< "show config",
< "show config -all",
< "exit"
---
> "show config"
216,217c211,212
< print STDERR "executing blogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($debug);
< print STDOUT "executing blogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($log);
---
> print STDERR "executing passlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($debug);
> print STDOUT "executing passlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($log);
219,220c214,215
< system "blogin -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "blogin failed for $host: $!\n";
< open(INPUT, "< $host.raw") || die "blogin failed for $host: $!\n";
---
> system "passlogin -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "passlogin failed for $host: $!\n";
> open(INPUT, "< $host.raw") || die "passlogin failed for $host: $!\n";
222c217
< open(INPUT,"blogin -t $timeo -c \"$cisco_cmds\" $host </dev/null |") || die "blogin failed for $host: $!\n";
---
> open(INPUT,"passlogin -t $timeo -c \"$cisco_cmds\" $host </dev/null |") || die "passlogin failed for $host: $!\n";
238c233
< if ( (/\>\s?logout$/) || $found_end ) {
---
> if ( (/\#\s?logout$/) || $found_end ) {
243,244c238,239
< print STDOUT ("$host blogin error: $_");
< print STDERR ("$host blogin error: $_") if ($debug);
---
> print STDOUT ("$host passlogin error: $_");
> print STDERR ("$host passlogin error: $_") if ($debug);
248c243
< while (/>\s*($cmds_regexp)\s*$/) {
---
> while (/#\s*($cmds_regexp)\s*$/) {
251c246
< $prompt = ($_ =~ /^([^>]+>)/)[0];
---
> $prompt = ($_ =~ /^([^#]+#)/)[0];
More information about the Rancid-discuss
mailing list