Here are two nice articles on how to use expect to automate Cisco router
configuration:

http://www.samag.com/documents/s=1180/sam9903c/9903c.htm
http://www.macdevcenter.com/pub/a/mac/2001/11/27/router_tcl.html


Regards,
Maurizio

----- Original Message -----
From: "Howard C. Berkowitz" 
To: 
Sent: Friday, September 27, 2002 9:28 PM
Subject: Re: OT: Perl/Expect to Console? [7:54344]


> >Expect is really awesome to do some stuff fast and don't worry about
> >Perl telnet modules, sockets and stuff. I have a lab with 5 routers
> >and I was sick of cleaning the configuration every time I started a new
> >lab test, so I wrote a simple expect script (attached to this msg) to
load
> >a default config. If you have a PM2 or something, you could change this
> >script to log into the PM2, reload the router and cleanup configs and IOS
> >image. Would be cool to have those power supplys that you can control
> >from the network, it should be a must have for those remote labs that
rent
> >rack space and people mess with configuration :)
>
> I do have APS power switches that can power cycle.  I'll be logging
> from the Linux logic box to a Cisco remote telnet server. I have the
> Perl anyway running some reasonably complex network and medical
> logic, so I'll have that anyway.  I've heard good things about
> Expect, but just have never touched it.
>
> >
> >--
> >Daniel Lafraia
> >Senior Software Developer CCNP/CCDP
> >Earthlink MIS Group
> >
> >On Fri, 27 Sep 2002, Howard C. Berkowitz wrote:
> >
> >>  Date: Fri, 27 Sep 2002 17:35:27 GMT
> >>  From: Howard C. Berkowitz
> >>  To: [EMAIL PROTECTED]
> >>  Subject: OT: Perl/Expect to Console? [7:54344]
> >>
> >>  I've written some Perl scripts (on a LINUX box) to drive some router
> >>  tests. Perl is something I've taught myself, and don't have the
> >>  experience with it I do with C.
> >>
> >>  I got some vague advice from one of our people to write TCL/Expect
> >>  and plug that in -- another language to learn -- or to use a telnet
> >>  client. Well, of course telnet would work manually -- but can I
> >>  fork/spawn a subprocess and connect it to Perl, such that STDIN and
> >>  STDOUT of telnet appear as Perl files?
> >>
> >>  Examples or pointers to them welcome.
> >>
> >>  Howard
> >Content-Type: TEXT/PLAIN; charset=US-ASCII; name="loadcfg.exp"
> >Content-ID:
> >Content-Description:
> >Content-Disposition: attachment; filename="loadcfg.exp"
> >
> >Attachment converted: G4Int1:loadcfg.exp (TEXT/MSWD) (001A21E0)




Message Posted at:
http://www.groupstudy.com/form/read.php?f=7&i=54474&t=54344
--------------------------------------------------
FAQ, list archives, and subscription info: http://www.groupstudy.com/list/cisco.html
Report misconduct and Nondisclosure violations to [EMAIL PROTECTED]

Reply via email to