[rancid] Re: 'out of band' access script changes?

Sherrill, Justin jsherrill at currentcomm.net
Mon Nov 20 20:33:22 UTC 2006

Going by your example, it doesn't work, as the spawned process doesn't
get a target router passed to it:

( is the 'gateway' router, and is the remote
router that can only be reached through the gateway.)

$ ./bin/clogin -c 'show vers'
spawn clogin -noenable -c telnet

No routers listed error : Usage: [snip...]

As I understand it, the usercmd option that's been patched in supplies a
new connection method for whatever server's being accessed, so I tried
constructing this line:

add usercmd  {cmtslogin} {-c} {telnet}

Am I correct in that this should say "Connect to and issue
'telnet', in order to connect to"?

It works in that it eventually connects to the remote device, but the
two connections seem to spawn and run in parallel - i.e. I see the
username and password for the second device getting printed out while
the first device is being logged into.

Has anyone done this in practice?  I'm wondering if I'm just

Justin C. Sherrill - CURRENT Communications
220 Kenneth Drive
Rochester, New York 14623
P: 585.486.0549 F: 585.486.0030

-----Original Message-----
From: Ed Ravin [mailto:eravin at panix.com] 
Sent: Sunday, November 19, 2006 12:27 AM
To: Sherrill, Justin
Cc: rancid-discuss at shrubbery.net
Subject: Re: 'out of band' access script changes?

On Fri, Nov 17, 2006 at 11:55:14AM -0500, Sherrill, Justin wrote:
> I tried applying the patch that Ed Ravin posted:
> http://www.shrubbery.net/pipermail/rancid-discuss/2006-May/001490.html
> And trying it as mentioned here, to reach a device on a separate
> network:
> (in .clogin)
> add method   {usercmd}
> add usercmd   {clogin} {-c} {telnet}
> {}
> (at the command line)
> $ ./bin/clogin -c 'show version'
> spawn clogin -c telnet
> Error: unknown connection method: usercmd

You didn't make any mistakes with the patches.  It's your cloginrc - you
are using the same router IP ( for the first and second
clogin thinks the way to get to is to first log into and then telnet to, which makes no sense.
Since you're calling the unpatched clogin on the second hop, it sees the
"usercmd" stuff defined for and aborts.

You probably wanted to say that the route to is via
into and then issuing the telnet command, like this:

  add method  {usercmd}
  add usercmd  {clogin} {-noenable} {-c} {telnet}

  add method  {telnet}
  add password  {xxx} {yyy}

The mistake would have been obvious if you had called the patched clogin
the "usercmd" - it would have understood "usercmd" and started a
infinite loop of clogins.

Let me know if you run into any more trouble with the patch.

	-- Ed

The information in this email may be confidential and/or privileged. This email is intended to be reviewed by only the individual or organization named above. If you are not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any review, dissemination or copying of this email and its attachments, if any, or the information contained herein is prohibited. If you have received this email in error, please immediately notify the sender by return email and delete this message from your system. 

More information about the Rancid-discuss mailing list