[rancid] Re: 'out of band' access script changes?
Ed Ravin
eravin at panix.com
Wed Nov 22 14:42:26 UTC 2006
On Wed, Nov 22, 2006 at 01:09:13AM -0500, Ed Ravin wrote:
> OK, you convinced me to climb out of the ivory tower and get my hands
> dirty. It looks like the second clogin isn't passing through the output
> of the gateway router back to the first clogin in a timely manner.
> Here's a fix using the "interact" command of Expect (which explicitly
> enables a "pass-through" mode to the user) and clogin's handy-dandy
> scripting features:
Oh, sheesh, I forgot clogin will automatically invoke the "interact"
command if you don't give it any options. So there's no need for the
"-s" option and the script file. Try the configuration below in cloginrc,
this worked in my tests:
add method gateway-router telnet
add user gateway-router rancid
add password gateway-router {mumble}
add method far-router {usercmd}
add user far-router rancid
add password far-router {mumble} {grumble}
add usercmd far-router {clogin} {-noenable} {gateway-router}
add usercmd_chat far-router {>} {telnet far-router\r} {User Access Verification} {}
Now, the usercmd_chat dialogue does all the dirty work - wait for the
gateway router's prompt, send the telnet command, wait for some evidence
that there's a Cisco answering on the other side, then a null send (the
usercmd_chat requires expect-send pairs) and let clogin do what it knows
how to do.
You might want to change "{>}" to something that more specifically matches
the gateway router's command line prompt, like "{Gateway>}", especially
if you have any ">" characters in the router's login banner message.
-- Ed
More information about the Rancid-discuss
mailing list