RANCID's fantastic!

Andrew Fort afort at choqolat.org
Thu Jan 22 00:06:52 UTC 2004


On 22/01/2004 10:33 AM, Andrew Pollock wrote:

>Okay, I'm now having a serious play with RANCID, and I'd like to see it do
>the out of band stuff I mentioned a while ago (i.e. we have switches,
>they're not telnetable, but the console is accessible via SSH to a Cyclades
>console access server).
>
>Can someone point me in the right direction as to what I'd have to modify to
>implement this?
>

Referring to Heas' previous reply to your post to the list, to add the
'loginscript' or 'connectscript' type of functionality, one would need
to hack the *login scripts.

You could start by hacking clogin (if cisco switches are your targets,
obviously), modifying the procedure 'login'.  At first glance, you're
probably wanting to source another expect script before the line

    # try each of the connection methods in $cmethod until one is successful
    set progs [llength $cmethod]

e.g.

    source $filename

With all the necessary expect business occuring in $filename to login to
the cyclades up to such a point that you'd be typing "telnet hostname
port" or similar to connect to the cisco.  In theory you could use
autoexpect to generate this script.  In addition, you'd need to flag to
clogin that you're running a prelogin script, otherwise it would expect
to be running 'spawn telnet hostname [args]' (or ssh, etc depending on
your method flag), which obviously doesn't grok since you're already
SSH'd in), and send the command instead of spawning the command.  Then,
you'd need to catch the prompt of the cyclades again to indicate to
expect that you want to bail out of that loop.

.  The 'hostname' and 'port' values would come from your router.db and
cloginrc values for those entries.

In regards to the port values, you specify these in the cloginrc file as
follows:

add method sw1.popname {telnet:2001}

However if this doesn't work for you, try

add method sw1.popname {telnet:-2001}

I'm happy to help in getting this working, or testing this (I have some
terminal servers in my lab I'd like to get configs through, too), so
feel free to contact me offline if you like.

-afort




More information about the Rancid-discuss mailing list