[nsp] Cisco commands automatically sent
jlewis@lewis.org
jlewis@lewis.org
Sat, 10 Aug 2002 01:27:53 -0400 (EDT)
On Fri, 9 Aug 2002, MacDonald, James wrote:
> I use expect as well ... everything from password changes to major config
> changes and netflow collection. There are a tonne of examples on the web ...
> get the O'Reilly Expect book to help learn it. Also, I found a few ways to
Me too :)
I've successfully changed vty/console/enable passwords on large numbers of
access-servers, routers, and switches in record time using expect.
I ran into an odd problem with expect recently though. I know...I really
should just take a look at Rancid (maybe next week)...but I was trying to
come up with an expect script to archive configs last week. I have the
above mentioned book and know just enough expect to get basic things (like
mass password changes) done. I tried saving the config by sending show
run and expecting "end\r\n\r\n". Then I open a file and puts $output
$expect_out(buffer). This works on small configs, but on large routers
with large configs, I'd only get some seemingly random portion of the end
of the config. I could run the script against the same router several
times and get various sizes between 5 and 8kb in the output file. There
was apparently no pattern on consistency to it. Has anyone else had this
problem with $expect_out(buffer)?
----------------------------------------------------------------------
Jon Lewis *jlewis@lewis.org*| I route
System Administrator | therefore you are
Atlantic Net |
_________ http://www.lewis.org/~jlewis/pgp for PGP public key_________