Mailing List Archive

Prompt issues on Bay routers.
Hi,

I'm new to Rancid and not familiar with Tcl, so forgive the newbieness -

I'm unable to run commands in BCC on Bay routers and I think it's because of prompt issues. When
you first log in to a Bay router, you're in TI instead of BCC. The prompt is [1:TN]$. I can get
Rancid to recognize this by doing 'set prompt "TN"' in blogin. Rancid then executes the 'bcc'
command to get into BCC. BCC uses a totally different prompt, however (bcc>), and I'm wondering
how to get Rancid to "switch" to that prompt so that commands can be run in BCC. I've tried stuff
like 'set prompt "TN|bcc"' or 'set prompt (TN|bcc)' all to no avail.

If anyone has any ideas I'd appreciate hearing them.

Thanks,
James



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Prompt issues on Bay routers. [ In reply to ]
Wed, Sep 03, 2003 at 12:28:41PM -0700, James Kilton:
> Hi,
>
> I'm new to Rancid and not familiar with Tcl, so forgive the newbieness -
>
> I'm unable to run commands in BCC on Bay routers and I think it's because of prompt issues. When
> you first log in to a Bay router, you're in TI instead of BCC. The prompt is [1:TN]$. I can get
> Rancid to recognize this by doing 'set prompt "TN"' in blogin. Rancid then executes the 'bcc'
> command to get into BCC. BCC uses a totally different prompt, however (bcc>), and I'm wondering
> how to get Rancid to "switch" to that prompt so that commands can be run in BCC. I've tried stuff
> like 'set prompt "TN|bcc"' or 'set prompt (TN|bcc)' all to no avail.
>
> If anyone has any ideas I'd appreciate hearing them.

I think that someone explained this to me before, but I must have purged it.
blogin has a comment which reads:

# Unlike the Cisco's, there is no enable function on the Bay's.
# Instead there are seperate User and Manager accounts. A 'system' command
# exists, which i am told does nothing.

so, what is bcc? for that matter, what is "TI"? is the prompt configurable?

an example of non-privileged and privileged logins (and perhaps a few random
commands) performed manually from the bay/nortel would be helpful.
Prompt issues on Bay routers. [ In reply to ]
I have raised this issue before, but I had never dared to go any further,
knowing how hard it is for someone to create a program, then having to deal
with all possible questions and issues raised by everyone, about every flavor
of equipment that could possibly exist ... I have made myself some changes to
the script, but have failed to properly login all the way into the "bcc". I
will thus take advantage right now of this kind and direct offer from John,
to help in resolving the Bays, and prodiving him with the info:

TI = technician interface - a rudimentary management interface into the
Bay/Nortel routers, with some (limited) capabilities. Unlike a regular CLI
(command line interface), the TI has some scripting capabilities

BCC = Bay Command Console - next level into the "guts" of the router. This has
two modes: command mode and configuration mode.

NOTE: before showing you a simple login session through all layers, I feel we
need to specify something here: the majority of items to be set on Bay
routers are reachable only via their corresponding MIB entity names/numbers,
which is a PITA!!!

And now a session - consisting in login to the TI (first level), then issuing
the bcc command (second level, and first of the bcc, the command mode), then
typing config (this is probably the equivalent of enable in cisco - second
level for bcc)

[scm at Crypto]$ telnet x.y.z.w
Trying x.y.w.z...
Connected to bcn (x.y.w.z).
Escape character is '^]'.


Bay Networks, Inc. and its Licensors.
Copyright 1992,1993,1994,1995,1996,1997,1998,1999. All rights reserved.



Login: Manager

Password: [hidden]

Mounting new volume...
Device label:
Directory: 1:
New Present Working Directory: 1:


Welcome to the Backbone Technician Interface


[us-head-bcn]$bcc

Welcome to the Bay Command Console!

* To enter configuration mode, type config

* To list all system commands, type ?

* To exit the BCC, type exit


Reading configuration information, please wait . . . done.

box#

... that's all that is to it.

Thank you, John!

Stef

On Thursday 11 September 2003 01:23 pm, john heasley wrote:
> Wed, Sep 03, 2003 at 12:28:41PM -0700, James Kilton:
> > Hi,
> >
> > I'm new to Rancid and not familiar with Tcl, so forgive the newbieness -
> >
> > I'm unable to run commands in BCC on Bay routers and I think it's because
> > of prompt issues. When you first log in to a Bay router, you're in TI
> > instead of BCC. The prompt is [1:TN]$. I can get Rancid to recognize
> > this by doing 'set prompt "TN"' in blogin. Rancid then executes the
> > 'bcc' command to get into BCC. BCC uses a totally different prompt,
> > however (bcc>), and I'm wondering how to get Rancid to "switch" to that
> > prompt so that commands can be run in BCC. I've tried stuff like 'set
> > prompt "TN|bcc"' or 'set prompt (TN|bcc)' all to no avail.
> >
> > If anyone has any ideas I'd appreciate hearing them.
>
> I think that someone explained this to me before, but I must have purged
> it. blogin has a comment which reads:
>
> # Unlike the Cisco's, there is no enable function on the Bay's.
> # Instead there are seperate User and Manager accounts. A 'system' command
> # exists, which i am told does nothing.
>
> so, what is bcc? for that matter, what is "TI"? is the prompt
> configurable?
>
> an example of non-privileged and privileged logins (and perhaps a few
> random commands) performed manually from the bay/nortel would be helpful.
Prompt issues on Bay routers. [ In reply to ]
Thanks guys.

I managed to fix this via some minor script hacking earlier in the week. I doubt it's pretty as
I'm not a programmer (I know a bit of Perl and had never worked with TCL), and it may have the
potential to cause other problems that I haven't run into yet, but as of now I can have Rancid log
into bcc and do a 'show config -all' with success. I believe I ended up adding a handful of lines
total to blogin and brancid, but I can't recall specifically since I tried about 100 things before
I had success.

I don't have access to the changes I made right this instant but I can get them to you guys if you
want them.

Thanks,
James

--- stefmit <stefmit at comcast.net> wrote:
> I have raised this issue before, but I had never dared to go any further,
> knowing how hard it is for someone to create a program, then having to deal
> with all possible questions and issues raised by everyone, about every flavor
> of equipment that could possibly exist ... I have made myself some changes to
> the script, but have failed to properly login all the way into the "bcc". I
> will thus take advantage right now of this kind and direct offer from John,
> to help in resolving the Bays, and prodiving him with the info:
>
> TI = technician interface - a rudimentary management interface into the
> Bay/Nortel routers, with some (limited) capabilities. Unlike a regular CLI
> (command line interface), the TI has some scripting capabilities
>
> BCC = Bay Command Console - next level into the "guts" of the router. This has
> two modes: command mode and configuration mode.
>
> NOTE: before showing you a simple login session through all layers, I feel we
> need to specify something here: the majority of items to be set on Bay
> routers are reachable only via their corresponding MIB entity names/numbers,
> which is a PITA!!!
>
> And now a session - consisting in login to the TI (first level), then issuing
> the bcc command (second level, and first of the bcc, the command mode), then
> typing config (this is probably the equivalent of enable in cisco - second
> level for bcc)
>
> [scm at Crypto]$ telnet x.y.z.w
> Trying x.y.w.z...
> Connected to bcn (x.y.w.z).
> Escape character is '^]'.
>
>
> Bay Networks, Inc. and its Licensors.
> Copyright 1992,1993,1994,1995,1996,1997,1998,1999. All rights reserved.
>
>
>
> Login: Manager
>
> Password: [hidden]
>
> Mounting new volume...
> Device label:
> Directory: 1:
> New Present Working Directory: 1:
>
>
> Welcome to the Backbone Technician Interface
>
>
> [us-head-bcn]$bcc
>
> Welcome to the Bay Command Console!
>
> * To enter configuration mode, type config
>
> * To list all system commands, type ?
>
> * To exit the BCC, type exit
>
> bcc> config
>
> Reading configuration information, please wait . . . done.
>
> box#
>
> ... that's all that is to it.
>
> Thank you, John!
>
> Stef
>
> On Thursday 11 September 2003 01:23 pm, john heasley wrote:
> > Wed, Sep 03, 2003 at 12:28:41PM -0700, James Kilton:
> > > Hi,
> > >
> > > I'm new to Rancid and not familiar with Tcl, so forgive the newbieness -
> > >
> > > I'm unable to run commands in BCC on Bay routers and I think it's because
> > > of prompt issues. When you first log in to a Bay router, you're in TI
> > > instead of BCC. The prompt is [1:TN]$. I can get Rancid to recognize
> > > this by doing 'set prompt "TN"' in blogin. Rancid then executes the
> > > 'bcc' command to get into BCC. BCC uses a totally different prompt,
> > > however (bcc>), and I'm wondering how to get Rancid to "switch" to that
> > > prompt so that commands can be run in BCC. I've tried stuff like 'set
> > > prompt "TN|bcc"' or 'set prompt (TN|bcc)' all to no avail.
> > >
> > > If anyone has any ideas I'd appreciate hearing them.
> >
> > I think that someone explained this to me before, but I must have purged
> > it. blogin has a comment which reads:
> >
> > # Unlike the Cisco's, there is no enable function on the Bay's.
> > # Instead there are seperate User and Manager accounts. A 'system' command
> > # exists, which i am told does nothing.
> >
> > so, what is bcc? for that matter, what is "TI"? is the prompt
> > configurable?
> >
> > an example of non-privileged and privileged logins (and perhaps a few
> > random commands) performed manually from the bay/nortel would be helpful.
>


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Prompt issues on Bay routers. [ In reply to ]
>>Wed, Sep 03, 2003 at 12:28:41PM -0700, James Kilton:
<SNIP>
>>>this by doing 'set prompt "TN"' in blogin. Rancid then executes the
>>>'bcc' command to get into BCC. BCC uses a totally different prompt,
>>>however (bcc>), and I'm wondering how to get Rancid to "switch" to

You shouldn't need to use set prompt as it should automatically
recognize the prompt when you login. If it doesn't then you its probably
down to the prompt or a banner having some 'invalid' characters in it.


> On Thursday 11 September 2003 01:23 pm, john heasley wrote:
>
>>
>>I think that someone explained this to me before, but I must have purged
>>it. blogin has a comment which reads:
>>
>># Unlike the Cisco's, there is no enable function on the Bay's.
>># Instead there are seperate User and Manager accounts. A 'system'
command
>># exists, which i am told does nothing.

That comment still stands and I think stefmit has posted a good example
of a normal login.


stefmit wrote:

<SNIP>
> And now a session - consisting in login to the TI (first level), then
issuing
> the bcc command (second level, and first of the bcc, the command
mode), then
> typing config (this is probably the equivalent of enable in cisco -
second
> level for bcc)
<SNIP>

This is a normal login session which blogin and brancid should handle
fine. Unfortunately I no longer work for the company that used the bay
kit so I carnt test it right at the moment.


James Kilton wrote:
> Thanks guys.
>
> I managed to fix this via some minor script hacking earlier in the
>week. I doubt it's pretty as

I would certainly be interested to know what you changed :)


--

Mark Cooper
http://netmangler.sourceforge.net - Network Management with Attitude
http://pvrhw.goldfish.org - Open Source PVR Hardware Database
Prompt issues on Bay routers. [ In reply to ]
On Saturday 13 September 2003 02:43 am, Mark Cooper wrote:

> stefmit wrote:
>
> <SNIP>
>
> > And now a session - consisting in login to the TI (first level), then
>
> issuing
>
> > the bcc command (second level, and first of the bcc, the command
>
> mode), then
>
> > typing config (this is probably the equivalent of enable in cisco -
>
> second
>
> > level for bcc)
>
> <SNIP>
>
> This is a normal login session which blogin and brancid should handle
> fine.

It definitely does not. Even minor changes to get the first level (TI) were
needed, compared to the original. I never pursued it any further, as -
somehow - I couldn't log out of routers after, logging in using the modified
blogin ...

> James Kilton wrote:
> > Thanks guys.
> >
> > I managed to fix this via some minor script hacking earlier in the
> >week. I doubt it's pretty as
>
> I would certainly be interested to know what you changed :)

Me too. TIA.

Stef
Prompt issues on Bay routers. [ In reply to ]
Fri, Sep 12, 2003 at 07:58:16AM -0500, stefmit:
> I have raised this issue before, but I had never dared to go any further,
> knowing how hard it is for someone to create a program, then having to deal
> with all possible questions and issues raised by everyone, about every flavor
> of equipment that could possibly exist ... I have made myself some changes to
> the script, but have failed to properly login all the way into the "bcc". I
> will thus take advantage right now of this kind and direct offer from John,
> to help in resolving the Bays, and prodiving him with the info:
>
> TI = technician interface - a rudimentary management interface into the
> Bay/Nortel routers, with some (limited) capabilities. Unlike a regular CLI
> (command line interface), the TI has some scripting capabilities
>
> BCC = Bay Command Console - next level into the "guts" of the router. This has
> two modes: command mode and configuration mode.
>
> NOTE: before showing you a simple login session through all layers, I feel we
> need to specify something here: the majority of items to be set on Bay
> routers are reachable only via their corresponding MIB entity names/numbers,
> which is a PITA!!!
>
> And now a session - consisting in login to the TI (first level), then issuing
> the bcc command (second level, and first of the bcc, the command mode), then
> typing config (this is probably the equivalent of enable in cisco - second
> level for bcc)
>
> [scm at Crypto]$ telnet x.y.z.w
> Trying x.y.w.z...
> Connected to bcn (x.y.w.z).
> Escape character is '^]'.
>
>
> Bay Networks, Inc. and its Licensors.
> Copyright 1992,1993,1994,1995,1996,1997,1998,1999. All rights reserved.
>
>
>
> Login: Manager
>
> Password: [hidden]
>
> Mounting new volume...
> Device label:
> Directory: 1:
> New Present Working Directory: 1:
>
>
> Welcome to the Backbone Technician Interface
>
>
> [us-head-bcn]$bcc
^^^^^^^^^^^^^^
where did this prompt come from? ie: what does "us-head-bcn" mean?
is it always within []s (square brackets)? always end with $ (dollar
sign)?

no prompt for a password, because it is the "manager" account. right?

btw, when i say "always", I mean at that privilege level and with all
bay devices capable of cmd-line...or at least those we hope to collect.

> Welcome to the Bay Command Console!
>
> * To enter configuration mode, type config
>
> * To list all system commands, type ?
>
> * To exit the BCC, type exit
>
> bcc> config
>
> Reading configuration information, please wait . . . done.
>
> box#

the prompt is "box"? not us-head-bcn# or bcc#?

I should have asked explicity; what does the exit from 'box#' back to your
host look like?

> ... that's all that is to it.
>
> Thank you, John!
>
> Stef
>
> On Thursday 11 September 2003 01:23 pm, john heasley wrote:
> > Wed, Sep 03, 2003 at 12:28:41PM -0700, James Kilton:
> > > Hi,
> > >
> > > I'm new to Rancid and not familiar with Tcl, so forgive the newbieness -
> > >
> > > I'm unable to run commands in BCC on Bay routers and I think it's because
> > > of prompt issues. When you first log in to a Bay router, you're in TI
> > > instead of BCC. The prompt is [1:TN]$. I can get Rancid to recognize
> > > this by doing 'set prompt "TN"' in blogin. Rancid then executes the
> > > 'bcc' command to get into BCC. BCC uses a totally different prompt,
> > > however (bcc>), and I'm wondering how to get Rancid to "switch" to that
> > > prompt so that commands can be run in BCC. I've tried stuff like 'set
> > > prompt "TN|bcc"' or 'set prompt (TN|bcc)' all to no avail.
> > >
> > > If anyone has any ideas I'd appreciate hearing them.
> >
> > I think that someone explained this to me before, but I must have purged
> > it. blogin has a comment which reads:
> >
> > # Unlike the Cisco's, there is no enable function on the Bay's.
> > # Instead there are seperate User and Manager accounts. A 'system' command
> > # exists, which i am told does nothing.
> >
> > so, what is bcc? for that matter, what is "TI"? is the prompt
> > configurable?
> >
> > an example of non-privileged and privileged logins (and perhaps a few
> > random commands) performed manually from the bay/nortel would be helpful.
Prompt issues on Bay routers. [ In reply to ]
See comments inline:

On Monday 15 September 2003 05:52 pm, you wrote:
> Fri, Sep 12, 2003 at 07:58:16AM -0500, stefmit:
> > I have raised this issue before, but I had never dared to go any further,
> > knowing how hard it is for someone to create a program, then having to
> > deal with all possible questions and issues raised by everyone, about
> > every flavor of equipment that could possibly exist ... I have made
> > myself some changes to the script, but have failed to properly login all
> > the way into the "bcc". I will thus take advantage right now of this kind
> > and direct offer from John, to help in resolving the Bays, and prodiving
> > him with the info:
> >
> > TI = technician interface - a rudimentary management interface into the
> > Bay/Nortel routers, with some (limited) capabilities. Unlike a regular
> > CLI (command line interface), the TI has some scripting capabilities
> >
> > BCC = Bay Command Console - next level into the "guts" of the router.
> > This has two modes: command mode and configuration mode.
> >
> > NOTE: before showing you a simple login session through all layers, I
> > feel we need to specify something here: the majority of items to be set
> > on Bay routers are reachable only via their corresponding MIB entity
> > names/numbers, which is a PITA!!!
> >
> > And now a session - consisting in login to the TI (first level), then
> > issuing the bcc command (second level, and first of the bcc, the command
> > mode), then typing config (this is probably the equivalent of enable in
> > cisco - second level for bcc)
> >
> > [scm at Crypto]$ telnet x.y.z.w
> > Trying x.y.w.z...
> > Connected to bcn (x.y.w.z).
> > Escape character is '^]'.
> >
> >
> > Bay Networks, Inc. and its Licensors.
> > Copyright 1992,1993,1994,1995,1996,1997,1998,1999. All rights reserved.
> >
> >
> >
> > Login: Manager
> >
> > Password: [hidden]
> >
> > Mounting new volume...
> > Device label:
> > Directory: 1:
> > New Present Working Directory: 1:
> >
> >
> > Welcome to the Backbone Technician Interface
> >
> >
> > [us-head-bcn]$bcc
>
> ^^^^^^^^^^^^^^
> where did this prompt come from? ie: what does "us-head-bcn" mean?
> is it always within []s (square brackets)? always end with $ (dollar
> sign)?

I apologize - the name in between [] is the sysID associated with SNMP, that
the system reads (for example we named our router us (location) - head
(headquarters) - bcn (model). The important part is $ only, I think.

>
> no prompt for a password, because it is the "manager" account. right?

Right!

>
> btw, when i say "always", I mean at that privilege level and with all
> bay devices capable of cmd-line...or at least those we hope to collect.
>
> > Welcome to the Bay Command Console!
> >
> > * To enter configuration mode, type config
> >
> > * To list all system commands, type ?
> >
> > * To exit the BCC, type exit
> >
> > bcc> config
> >
> > Reading configuration information, please wait . . . done.
> >
> > box#
>
> the prompt is "box"? not us-head-bcn# or bcc#?

Right! it is box# - but - yet again - the point here is to pay attention to
the # only (I think).

>
> I should have asked explicity; what does the exit from 'box#' back to your
> host look like?
>
> > ... that's all that is to it.
> >
> > Thank you, John!
> >
> > Stef

In my opinion, the sequence would be:

$ prompt for TI
> prompt for bcc as command interface
# prompt for bcc as "enable"

The rest being more or less variable (for example, after getting into box#,
then every "move" is similar to "enable" in Cisco, i.e. changing the string
before # into whatever interface/entity is being processed.

Thx,
Stef
Prompt issues on Bay routers. [ In reply to ]
Forgot to answer your last question - will let the previously recorded session
do it for me:

<snip>

> > > Welcome to the Bay Command Console!
> > >
> > > * To enter configuration mode, type config
> > >
> > > * To list all system commands, type ?
> > >
> > > * To exit the BCC, type exit

<snip>

> > I should have asked explicity; what does the exit from 'box#' back to
> > your host look like?

i.e. same as the "exit" from bcc ... "exit"

Thanks a lot for all your help, John!
Prompt issues on Bay routers. [ In reply to ]
Mon, Sep 15, 2003 at 07:00:43PM -0500, stefmit:
> See comments inline:
>
> On Monday 15 September 2003 05:52 pm, you wrote:
> > Fri, Sep 12, 2003 at 07:58:16AM -0500, stefmit:
> > > I have raised this issue before, but I had never dared to go any further,
> > > knowing how hard it is for someone to create a program, then having to
> > > deal with all possible questions and issues raised by everyone, about
> > > every flavor of equipment that could possibly exist ... I have made
> > > myself some changes to the script, but have failed to properly login all
> > > the way into the "bcc". I will thus take advantage right now of this kind
> > > and direct offer from John, to help in resolving the Bays, and prodiving
> > > him with the info:
> > >
> > > TI = technician interface - a rudimentary management interface into the
> > > Bay/Nortel routers, with some (limited) capabilities. Unlike a regular
> > > CLI (command line interface), the TI has some scripting capabilities
> > >
> > > BCC = Bay Command Console - next level into the "guts" of the router.
> > > This has two modes: command mode and configuration mode.
> > >
> > > NOTE: before showing you a simple login session through all layers, I
> > > feel we need to specify something here: the majority of items to be set
> > > on Bay routers are reachable only via their corresponding MIB entity
> > > names/numbers, which is a PITA!!!
> > >
> > > And now a session - consisting in login to the TI (first level), then
> > > issuing the bcc command (second level, and first of the bcc, the command
> > > mode), then typing config (this is probably the equivalent of enable in
> > > cisco - second level for bcc)
> > >
> > > [scm at Crypto]$ telnet x.y.z.w
> > > Trying x.y.w.z...
> > > Connected to bcn (x.y.w.z).
> > > Escape character is '^]'.
> > >
> > >
> > > Bay Networks, Inc. and its Licensors.
> > > Copyright 1992,1993,1994,1995,1996,1997,1998,1999. All rights reserved.
> > >
> > >
> > >
> > > Login: Manager
> > >
> > > Password: [hidden]
> > >
> > > Mounting new volume...
> > > Device label:
> > > Directory: 1:
> > > New Present Working Directory: 1:
> > >
> > >
> > > Welcome to the Backbone Technician Interface
> > >
> > >
> > > [us-head-bcn]$bcc
> >
> > ^^^^^^^^^^^^^^
> > where did this prompt come from? ie: what does "us-head-bcn" mean?
> > is it always within []s (square brackets)? always end with $ (dollar
> > sign)?
>
> I apologize - the name in between [] is the sysID associated with SNMP, that
> the system reads (for example we named our router us (location) - head
> (headquarters) - bcn (model). The important part is $ only, I think.

so, this may contain spaces and puctuation? sorry, dont have the mib handy.

as for '$' only, no. looking for lone characters or english phrases that
can not be anchored has a tendency to match random characters appearing in
the normal output. something more like

^\[[^][]+\]\$

> >
> > no prompt for a password, because it is the "manager" account. right?
>
> Right!
>
> >
> > btw, when i say "always", I mean at that privilege level and with all
> > bay devices capable of cmd-line...or at least those we hope to collect.
> >
> > > Welcome to the Bay Command Console!
> > >
> > > * To enter configuration mode, type config
> > >
> > > * To list all system commands, type ?
> > >
> > > * To exit the BCC, type exit
> > >
> > > bcc> config
> > >
> > > Reading configuration information, please wait . . . done.
> > >
> > > box#
> >
> > the prompt is "box"? not us-head-bcn# or bcc#?
>
> Right! it is box# - but - yet again - the point here is to pay attention to
> the # only (I think).
>
> >
> > I should have asked explicity; what does the exit from 'box#' back to your
> > host look like?
> >
> > > ... that's all that is to it.
> > >
> > > Thank you, John!
> > >
> > > Stef
>
> In my opinion, the sequence would be:
>
> $ prompt for TI
> > prompt for bcc as command interface
> # prompt for bcc as "enable"
>
> The rest being more or less variable (for example, after getting into box#,
> then every "move" is similar to "enable" in Cisco, i.e. changing the string
> before # into whatever interface/entity is being processed.
>
> Thx,
> Stef

> Forgot to answer your last question - will let the previously recorded session
> do it for me:
>
> <snip>
>
> > > > Welcome to the Bay Command Console!
> > > >
> > > > * To enter configuration mode, type config
> > > >
> > > > * To list all system commands, type ?
> > > >
> > > > * To exit the BCC, type exit
>
> <snip>
>
> > > I should have asked explicity; what does the exit from 'box#' back to
> > > your host look like?
>
> i.e. same as the "exit" from bcc ... "exit"

so,

box# exit
unix_host% blogin host
...

not,
box# exit
bcc> exit
[foo]$ exit
unix_host%
Prompt issues on Bay routers. [ In reply to ]
On Wednesday 17 September 2003 01:39 pm, john heasley wrote:
This came the closest:) - my mistake for not being clear about the end of the
session:

> box# exit
> bcc> exit
> [foo]$ exit
^^^^^ it is actually "logout" ("exit" comes back with "unknown
command")
> unix_host%

One more note - at the [whatever]$ TI prompt, typing bcc takes a looong time
(I've seen routers where it took upwards to 30-45 sec, and not link
related!), before getting the "command" level bcc (i.e. bcc>), Typing then
config is pretty fast, though (to get the "enable" level", i.e. box#).

Thx again for all your work,
Stefan
Prompt issues on Bay routers. [ In reply to ]
stefmit wrote:
> On Wednesday 17 September 2003 01:39 pm, john heasley wrote:
> This came the closest:) - my mistake for not being clear about the end of the
> session:
>
>
>>box# exit
>>bcc> exit
>>[foo]$ exit
>
> ^^^^^ it is actually "logout" ("exit" comes back with "unknown
> command")
>
>>unix_host%

[mcooper at dire bin]$ grep logout *
blogin.in: send "logout\r"
brancid.in: if ( (/\>\s?logout$/) || $found_end ) {
[mcooper at dire bin]$


> One more note - at the [whatever]$ TI prompt, typing bcc takes a looong time
> (I've seen routers where it took upwards to 30-45 sec, and not link
> related!), before getting the "command" level bcc (i.e. bcc>), Typing then
> config is pretty fast, though (to get the "enable" level", i.e. box#).

typing bcc taks a long time? Do you mean it takes a long time for
blogin/brancid to get into bcc or that when you manually login you
cannot type bcc? I think you mean the first as it's something I've seen
myself. It all depends on the spec/loading of router involved, and
particularly memory. It seems to have to do *alot* of work to load the
bcc module on low sepc/memory routers. One lovely side effect of this I
noted was a massive jump in latency through the router! Try pinging the
router and then running brancid. As soon as it hits the bcc line the
ping times go through the roof :( I've seen ping times go from 1mc up to
300ms!! :(

One thing I should mention ( I've still not been able to get access to
any bay kit ), but brancid does not do a config command while in bcc and
never needed to in order to run the show config commands. Has this
changed in new revision's of BayOS?

--

Mark Cooper
http://netmangler.sourceforge.net - Network Management with Attitude
http://pvrhw.goldfish.org - Open Source PVR Hardware Database
Prompt issues on Bay routers. [ In reply to ]
On Wednesday 17 September 2003 09:17 pm, Mark Cooper wrote:
> stefmit wrote:

> [mcooper at dire bin]$ grep logout *
> blogin.in: send "logout\r"
> brancid.in: if ( (/\>\s?logout$/) || $found_end ) {
> [mcooper at dire bin]$

For whatever reasons, in all Nortel/Bat routers I have tried this, blogin
never makes it this far (as in "reaching the logout"). It gets me to the TI
prompt ($), and I can run commands there, but even when typing "logout" (!!!)
I cannot actually log out of the router(s). Telnet-ing "normally" (i.e. no
"blogin") into those same routers, and running commands, then a logout,
allows me to cleanly close the sessions ... very odd ...

>
> > One more note - at the [whatever]$ TI prompt, typing bcc takes a looong
> > time (I've seen routers where it took upwards to 30-45 sec, and not link
> > related!), before getting the "command" level bcc (i.e. bcc>), Typing
> > then config is pretty fast, though (to get the "enable" level", i.e.
> > box#).
>
> typing bcc taks a long time? Do you mean it takes a long time for
> blogin/brancid to get into bcc or that when you manually login you
> cannot type bcc? I think you mean the first as it's something I've seen
> myself. It all depends on the spec/loading of router involved, and
> particularly memory. It seems to have to do *alot* of work to load the
> bcc module on low sepc/memory routers. One lovely side effect of this I
> noted was a massive jump in latency through the router! Try pinging the
> router and then running brancid. As soon as it hits the bcc line the
> ping times go through the roof :( I've seen ping times go from 1mc up to
> 300ms!! :(

blogin/brancid never make it as far as getting to a bcc prompt (whether be it
"bcc>" or - even furfther - "box#"). I was referring to a normal login
session, going through TI, then typing bcc. All my Nortel routers hve at
least 32MB of RAM, and they handle small frame relay sites, with very small
tables, and not very much traffic.

>
> One thing I should mention ( I've still not been able to get access to
> any bay kit ), but brancid does not do a config command while in bcc and
> never needed to in order to run the show config commands. Has this
> changed in new revision's of BayOS?

No, it hasn't - one can do a "show config" under TI, without having to go into
bcc. The issue with bcc being the subject of this email thread was started by
someone's question about the equivalent of "enable" in the Nortel/Bat world.
I have explained as much as I was able to - in my initial response to that
query - what is the difference between TI and bcc ... and the thought was to
provide enough info to change the blogin/brancid to be able to handle a whole
session (login (telnet) into TI -->[router-ID]$bcc --> bcc>config -->
box#exit --> bcc>exit -->[router-ID]logout) properly. I do not think that
anybody was ever able to use blogin/brancid beyond the login to TI
capability.

Thx,
Stef
Prompt issues on Bay routers. [ In reply to ]
stefmit wrote:
<SNIP>
> For whatever reasons, in all Nortel/Bat routers I have tried this, blogin
> never makes it this far (as in "reaching the logout"). It gets me to the TI
> prompt ($), and I can run commands there, but even when typing "logout" (!!!)
> I cannot actually log out of the router(s). Telnet-ing "normally" (i.e. no
> "blogin") into those same routers, and running commands, then a logout,
> allows me to cleanly close the sessions ... very odd ...

I don't remember blogin being an interactive process?? You should be
able to do something like blogin -c 'bcc; show config' routername if not
can you post or email me the output?


<SNIP>
> blogin/brancid never make it as far as getting to a bcc prompt (whether be it
> "bcc>" or - even furfther - "box#"). I was referring to a normal login
> session, going through TI, then typing bcc. All my Nortel routers hve at
> least 32MB of RAM, and they handle small frame relay sites, with very small
> tables, and not very much traffic.

Can you post/email me the router.raw file after doing:-
setenv NOPIPE=YES
brancid -d routername


> No, it hasn't - one can do a "show config" under TI, without having to go into
> bcc. The issue with bcc being the subject of this email thread was started by
> someone's question about the equivalent of "enable" in the Nortel/Bat world.
> I have explained as much as I was able to - in my initial response to that
> query - what is the difference between TI and bcc ... and the thought was to
> provide enough info to change the blogin/brancid to be able to handle a whole
> session (login (telnet) into TI -->[router-ID]$bcc --> bcc>config -->
> box#exit --> bcc>exit -->[router-ID]logout) properly. I do not think that
> anybody was ever able to use blogin/brancid beyond the login to TI
> capability.

OK, herein lies the problem. When I originally ported clogin/rancid to
the Bay Networks kit that we were using at the time, you *HAD* to enter
bcc to run the show config command. I have no idea what version of BayOS
they were running at the time...but it was quite some time ago now :)
Can you confirm what version(s) you are running?
I do remember seeing someone post about problems with blogin/brancid a
while back, which they solved by changing the "more off" to "config cli
more false" and "show config -all" to "show config verbose".

If, as you say, you can run the "show config" command in TI mode, than
brancid can be simplified from:-
'bcc' => "RunCommand",
'show config' => "ShowConfig",
'show config -all' => "ShowConfig",

to:-

'show config' => "ShowConfig",

try testing this by doing blogin -c 'show config' routername
Again, if this doesn't work, please post/email me the output - hopefully
than I can get a better idea what is going wrong :)

HTH

--

Mark Cooper
http://netmangler.sourceforge.net - Network Management with Attitude
http://pvrhw.goldfish.org - Open Source PVR Hardware Database
Prompt issues on Bay routers. [ In reply to ]
Mark,

I am soooo sorry - I don't know what I was thinking of ... ;( I said: "one can
do a "show config" from a TI prompt" - THAT IS WRONG!!!. Only after reading
your specific question below, have I realized that I had screwed up. I meant:
one can do a "show" <many things about config> from a TI prompt (e.g. $show
ip route), but the specific "show config" is NOT available from a TI ($)
prompt, it needs a bcc> environment (not the enabled one, but the bcc
nonetheless).

I want to send this ASAP, because I misled you, not re-reading my email before
sending it. For the rest - I will get back to you on Monday, probably. Thank
you again for your help, and sorry about my mistake.

Stef

On Friday 19 September 2003 09:55 pm, Mark Cooper wrote:
<snip>
> If, as you say, you can run the "show config" command in TI mode, than
> brancid can be simplified from:-
> 'bcc' => "RunCommand",
> 'show config' => "ShowConfig",
> 'show config -all' => "ShowConfig",
>
> to:-
>
> 'show config' => "ShowConfig",
<snip>
Prompt issues on Bay routers. [ In reply to ]
> > James Kilton wrote:
> > > Thanks guys.
> > >
> > > I managed to fix this via some minor script hacking earlier in the
> > >week. I doubt it's pretty as
> >
> > I would certainly be interested to know what you changed :)
>
> Me too. TIA.
>
> Stef

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.

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: brancid.txt
Url: http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20030920/4a63661a/attachment.txt
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: blogin.txt
Url: http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20030920/4a63661a/attachment-0001.txt
Prompt issues on Bay routers. [ In reply to ]
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
Prompt issues on Bay routers. [ In reply to ]
Mark Cooper wrote:

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

Heh, not to worry. I'm by no means a programmer and hacked around with
the Rancid code until I finally stumbled upon something that worked.
Nothing will hurt my feelings here. ;-)

> [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 ">".

The primary issue to my untrained eye seemed to be the change of prompt
when going from the TI interface to BCC. So most of the time I spent on
this was spent trying to figure out how to get the scripts to first
recognize the TI prompt, then change to the BCC prompt after running the
'bcc' command.

> 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?

Some of my changes likely aren't necessary - I kept trying things until I
had success and didn't go back afterwards to determine for sure what
changes were and weren't necessary. The change to '{TN}' above is
necessary in my versions though - if I replace it with something else,
blogin never executes the initial 'bcc' command. But the change from '$'
to '>' may not be - I changed it back and was still able to login and run
commands.

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

Sure thing:

------------------------------------------------------
[rancid at syslog bin]$ ./blogin -c "bcc;show system memory;exit" 10.0.0.1
10.0.0.1
spawn telnet 10.0.0.1
Trying 10.0.0.1...
Connected to 10.0.0.1.
Escape character is '^]'.


Nortel Networks, Inc. and its Licensors.
Copyright 1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002.
All rights reserved.



Login:
Password:

Welcome to the Backbone Technician Interface

Mounting new volume...
Device label:
Directory: 1:
New Present Working Directory: 1:

[1:TN]$ more off
More Mode: OFF
Lines per screen: 44

[1:TN]$ bcc

Welcome to the Bay Command Console!

* To enter configuration mode, type config

* To list all system commands, type ?

* To exit the BCC, type exit


show system memory Sep 29, 2003 12:29:41
[GMT]


Memory Usage Statistics (Megabytes):
------------------------------------

Slot Total Used Free %Free
---- -------- -------- -------- -------
1 21.09 M 6.63 M 14.46 M 68%

[1:TN]$ logout

TI session logged out.

** Goodbye. **
Connection closed by foreign host.
------------------------------------------------------

> [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.

Yes, this was to combat a BCC bug where the uptime value is sometimes a
negative number.

> You've removed the first "show config" command to just leave
> the "show config -all", no problem.

'show config' shows the first few lines or so of 'show config -all' (the
software build date, SNMP contact info, and uptime), so the latter command
is the only one I was interested in.

> 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.

This was another thing that I had trouble with and had to work around in
an ugly fashion. Once the prompt issues were resolved I was successfully
logging in, running commands, and logging out, but the script still wasn't
detecting the end of session properly and was hence giving an error. It
turns out that a simple 'logout' from BCC will log you out of the router
(i.e., no need to do 'exit' first), so it might be the case that the 'end
of session' code would work as is when 'logout' is run in of itself. I
haven't tried it, though.

> 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
> "$"??

Yep and this was a required change. Otherwise I get "missed cmd(s): bcc".
My guess was/is that the original code never enters the 'while' loop when
'bcc' is run because it is run from the TI prompt which ends in '$'.

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

I'm primarily using ARN routers running code version 14.0 and 15.2.

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

My versions actually work without this change. Don't know how though. ;-)

> 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?

The problem for me was the prompt change upon execution of the 'bcc'
command. I was originally going to try to have the code treat the 'bcc'
command like the 'enable' command and work from there (because the code as
is expects a prompt change there), but I ended up going the ugly route
instead.

> 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

Posted above, though I ran "show system memory" instead to avoid having to
post a long config.

> setenv NOPIPE=YES;brancid -d routername ( post the .raw file left behind
)

Here's the .raw file, but again with a shorter command:
--------------------------------------------------------

[rancid at syslog ~/bin]$ cat 10.0.0.1.raw
10.0.0.1
spawn telnet 10.0.0.1
Trying 10.0.0.1...
Connected to 10.0.0.1.
Escape character is '^]'.


Nortel Networks, Inc. and its Licensors.
Copyright 1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002.
All rights reserved.



Login:
Password:

Welcome to the Backbone Technician Interface

Mounting new volume...
Device label:
Directory: 1:
New Present Working Directory: 1:

[1:TN]$ more off
More Mode: OFF
Lines per screen: 44

[1:TN]$ bcc

Welcome to the Bay Command Console!

* To enter configuration mode, type config

* To list all system commands, type ?

* To exit the BCC, type exit


show system memory Sep 29, 2003 13:03:04
[GMT]


Memory Usage Statistics (Megabytes):
------------------------------------

Slot Total Used Free %Free
---- -------- -------- -------- -------
1 21.09 M 6.64 M 14.44 M 68%

[1:TN]$ logout

TI session logged out.

** Goodbye. **
Connection closed by foreign host.
--------------------------------------------------------

> Hope that all helps :)

By all means, let me know if you need anything else. I'm happy to help.
Prompt issues on Bay routers. [ In reply to ]
--- James Kilton <kilton9 at yahoo.com> wrote:
> > At the minimum, the login prompt needs fixing! This can be fixed
> > like this:-
>
> My versions actually work without this change. Don't know how though.
> ;-)

I now see that I made changes in .cloginrc which I think are responsible
for this:

add userprompt * {Login:}