summaryrefslogtreecommitdiffstats
path: root/bin/nrancid.in
diff options
context:
space:
mode:
authorEd Ravin <eravin@panix.com>2006-05-18 17:50:27 -0400
committerJeffrey C. Ollie <jeff@ocjtech.us>2007-03-25 23:04:42 -0500
commitad03c748e10fe5b8dbd95c3bcdbcc2c02e777e7b (patch)
tree33405ed88ff70682cede975be829b00e4e3264c9 /bin/nrancid.in
parent989312339ea2e16579803a48700628c5469e327a (diff)
downloadrancid-ad03c748e10fe5b8dbd95c3bcdbcc2c02e777e7b.tar.gz
rancid-ad03c748e10fe5b8dbd95c3bcdbcc2c02e777e7b.tar.xz
rancid-ad03c748e10fe5b8dbd95c3bcdbcc2c02e777e7b.zip
patch for "out of band" access to devices
On Fri, May 12, 2006 at 10:47:49PM -0400, Ed Ravin wrote: > On Tue, Aug 16, 2005 at 03:56:04PM +1000, Andrew Pollock wrote: > ... > > So the only way of managing the devices is via SSHing to the Cyclades and > > getting on the console port. We can SSH directly to a specific port of the > > Cyclades, and after authenticating, get on the console attached to that > > port, and disconnect by way of the standard SSH disconnect break sequence > > when we're done. > > > > I'm wondering if RANCID has evolved over the last nearly 2 years to include > > such out of band access to devices, or if it's much of a muchness still? As I posted previously, I've implemented this, and I now think/hope it's clean enough to release a patch. Here's how it works in cloginrc: add method testrouter {usercmd} add usercmd testrouter {ssh} {-t} {termserver01} {cu -l /dev/tty01 -s 9600} add usercmd_chat testrouter {Connected.} {\r} The patches below to clogin define a new method, "usercmd" (i.e. instead of "telnet" or "ssh"), which tells clogin to use the exact text supplied in the "usercmd" directive for that router as the command to spawn. Note the way the command line args are delimited, the braces have to be used to mark off the arguments or the spawn command will fail. Since whatever out-of-band gizmo you're using to access the router might need some more interaction to let you get to the router, the usercmd_chat directive is a list of expect/send pairs - match something, send something, match the next something, send something, etc. This is pretty primitive but it should be enough to get through conserver, cu, kermit, or whatever you're using as the out-of-band connector. In the above case, usercmd_chat is defined to "wait for the string 'Connected.' and then send a CR". For Andrew's case above, he might have to do something like: add usercmd routeronc1 {ssh} {-t} {-p 12345} {cyclades01} add usercmd_chat routeronc1 {Login:} {operator\r} {Password:} {secret\r} {Connected.} {\r} to get past the authentication he describes, and then send a CR to the router to get it to display a prompt. I didn't code anything yet for the situation Andrew describes where he wants to send an SSH break sequence when he's done. The attached patch includes a fix to clogin so that it will hang up if it times out after it's already sent "exit" to the router - though it wastes a few more seconds timing out, it is a reliable way to close the connection in my environment. If it turns out someone needs to have more chat interaction upon exit, I'd be happy to code it in. The patch to clogin is attached. The first chunk may need to be applied by hand, since one of the surrounding lines is from my S/Key patches. -- Ed
Diffstat (limited to 'bin/nrancid.in')
0 files changed, 0 insertions, 0 deletions