[comp.dcom.sys.cisco] expect script to retrieve cisco router configuration information

louie@sayshell.umd.edu (Louis A. Mamakos) (05/08/91)

I have submitted a set of expect scripts (and a perl script) that I
use to help maintain cisco router configuration information to the
FTP.CISCO.COM anonymous FTP server.  Its in a file called
'cisco-expect.shar'.  'expect' may be ftp'd as pub/expect.shar.Z from
durer.cme.nist.gov.  Perl is available all over the place.

To use these scripts you'll need the 'expect' program.  In short,
there is a script which will telnet into a cisco router (you specify
the passwords) and do a WRITE NETWORK back to the host that you're
running the script on.  There is also a quicky perl script which
strips the passwords out of the configuration before it is saved away
in the archive directory.

There is also a script which will telnet to a router and do a
CONFIGURE NETWORK to modify configuration information.  This is very
useful if you want to change a bunch of routers all at once (say, to
update the name server information).

Also included is a diddly script which telnets into a cisco router to
checkpoint the IP accounting information.

There's really no documentation other than some comments in the
scripts themselves; they are really quite short and easy to understand
if you understand how 'expect' works.

If you have any new and improved versions or improvements, please let
me know.  They were just quick hacks that I came up with, and someone
I knew suggested that this is just the sort of thing others had
wanted.

Enjoy,
louie

guri@apogee.sps.mot.com (Gurvinder Singh Ahluwalia) (05/09/91)

> I have submitted a set of expect scripts (and a perl script) that I
> use to help maintain cisco router configuration information to the
> FTP.CISCO.COM anonymous FTP server.  Its in a file called
> 'cisco-expect.shar'.  'expect' may be ftp'd as pub/expect.shar.Z from
> durer.cme.nist.gov.  Perl is available all over the place.

We don't have FTP access.  Can this be retrieved through email over
the Internet or could you send me a copy?

Incidentally, 'write net' breaks if the config is larger than 32K (8.0).  
How do you handle that in this scheme?

---
Gurvinder Singh Ahluwalia    Internet : guri@apogee.sps.mot.com 
Software Engineer            UUCP     : ..!oakhill!apogee!guri@cs.utexas
Global Networking            Post/SNA : RXDH10
MOTOROLA SPS, Inc.           Wk.      : (512) 891-3310
Austin, Texas 78754          Pg.      : (512) 474-3216