Prompt issues on Bay routers.

Mark Cooper mcooper at blueyonder.co.uk
Fri Sep 26 04:08:47 UTC 2003


James Kilton wrote:
> Sorry for the delay on this, I was out of town.  My versions of brancid and blogin are attached. 
> You should be able to run 'diff' to see what I changed.
<SNIP>

OK, as I see it ( and please dont take this the wrong way, I'm jut 
trying to work out what the differences are ) ....

[root at dire new]# diff -b blogin blogin.james
441a443
 >                 -re "bcc>"                      {}
449a452
 >                 -re "bcc>"                      {}
483c486
<           set prompt "#"
---
 >             set prompt {TN}
486c489
<           set prompt "$"
---
 >             set prompt ">"

You've added a prompt condition check for "bcc>" in the run_commands 
function. I'm sure blogin should handle the reprompt normally, but thats 
probably if it already has the prompt using a ">".

You've changed the prompt in the enabled ( # to {TN} ) and non-enabled ( 
$ to > ) states. This seems strange as the Bay's don't have an 'enabled' 
state?

If you could post the session details of a full login to bcc and back 
out I would appreciate it :)

[root at dire new]# diff -b brancid brancid.james
147c147
<       next if (/^\# *uptime +\d+\s*$/);
---
 >         next if (/^\# *uptime +-?\d+\s*$/);
188d187
<       'show config'           => "ShowConfig",
196d194
<       "show config",
235c233
<     if ( (/\>\s?logout$/) || $found_end ) {
---
 >     if ( (/>\s?exit$/) || $found_end ) {
245c243
<     while (/>\s*($cmds_regexp)\s*$/) {
---
 >     while (/>\s*($cmds_regexp)\s*$/ | /\$\s*($cmds_regexp)\s*$/) {
262a261,263
 >         if ( (/>\s?exit$/) || $found_end ) {
 >             $clean_run=1;
 >     }
287a289
 >

You've made a change to the parsing of the uptime section of the config, 
no problem. You've removed the first "show config" command to just leave 
the "show config -all", no problem. You've changed the check for the 
successful end of the session from looking for the "logout" command to 
looking for an "exit" command. I don't think this is right, as you will 
be catching the exit from bcc and not fully logging out. Carnt work out 
line 245 ( it's five am in the morning and I'm very tired ) but it looks 
like you've added a check for prompts containing "$"??

Could you tell me what piece of bay kit your trying to login to and what 
the OS version is?

I think this all comes down to revision's of OS and the type of kit 
involved, for example ( taken from the mail archives ):-

My original:-
Kit: ASN/AN Router
OS: ?
Login prompt: login:
Initial prompt: $
BCC prompt: bcc>
Show config: show config
pager: more off

Fergus Roche:-
Kit: Accelar
OS: ?
Login prompt: Login:
Initial prompt: $
BCC prompt: N/A
show config: show config verbose
pager: config cli more false

James Kilton:-
Kit: ?
OS: ?
Login prompt: Login:
Initial prompt: $
BCC prompt: bcc>
show config: show config -all
pager: more off

stefmit:-
Kit: ?
OS: ?
Login prompt: Login:
Initial prompt: $
BCC prompt: bcc>
show config: show config
pager: more off

If people could fill in the missing blanks for kit/os, that would be 
helpful :)

At the minimum, the login prompt needs fixing! This can be fixed like this:-

[root at dire new]# diff -b blogin.orig blogin.new
540c540
<       set u_prompt "(Username|login|user name):"
---
 >       set u_prompt "(Username|\[Ll]ogin|user name):"

It seems that the initial prompt is always "$" which is what blogin 
originally expected so I'm not sure why this is giving a problem? Again, 
  copies of a typical full login ( through to bcc ) would be be helpful, 
as well as the output from the following:-

blogin -c 'bcc; show config' routername
setenv NOPIPE=YES;brancid -d routername ( post the .raw file left behind )

Hope that all helps :)

-- 

Mark Cooper
http://netmangler.sourceforge.net - Network Management with Attitude
http://pvrhw.goldfish.org - Open Source PVR Hardware Database




More information about the Rancid-discuss mailing list