[Trilug-ontopic] Linux/Perl/Expect question

Greg Brown gwbrown1 at gmail.com
Wed Oct 29 18:34:21 EDT 2008


AWWWW... man, I thought that was going to do it:

-bash-3.00$ scp classified at classified:system:running-config xxxxxxx-confg
The authenticity of host 'classified' can't be established.
RSA key fingerprint is 'classified'
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'classified' (RSA) to the list of known hosts.
Password:
Privilege denied.
channel_lookup: 0: bad id: channel free
client_input_channel_req: channel 0: unknown channel

now time to look up the errors.

Good ideas, all!  Keep 'em coming.

On Wed, Oct 29, 2008 at 5:34 PM, Scott Lambdin <lopaki at gmail.com> wrote:

> I saw where someone else was having trouble with getting just the show run
> output with expect.  Like this guy:
> http://www.linuxforums.org/forum/linux-programming-scripting/117521-expect-creating-variables-fly.html
>
> I'm not getting where the "useless info" is coming from.  Where is my old
> Cisco Rooter-on-a-eisa-card thingy I bought for $300 in the '90's?
>
>
> From http://blog.pressure.net.nz/ this looks interesting:
>
>  Retrieving IOS running-config via scp <http://blog.pressure.net.nz/?p=15>Posted
> by: daniel <http://blog.pressure.net.nz/?author=1> in Cisco<http://blog.pressure.net.nz/?cat=2>
>
> Ok, now I've only tested this with routers running IOS - it may be a little
> different with Catalyst switches, since they store their config on flash,
> rather than nvram. On the other hand, it may be exactly the same, since
> we're retrieving running-config, not startup-config.
>
> First, you need to ensure that ssh and scp have been enabled. I strongly
> recommend that you run ssh version 2.
>
> ip ssh version 2
> ip scp server enable
>
> Then, on your PC:
>
> scp user at router-hostname:system:running-config .
>
> You should then have a file called "running-config" in that directory.
> Pretty simple…
>
> If you want to grab the startup-config instead of the running-config, try:
>
> scp user at router-hostname:nvram:startup-config .
>
> By using RSA keys to eliminate the password prompt at login, this method
> could be expanded to form the basis of an automated config backup. I know
> that various apps already exist, but a lot of them retrieve the config via
> "expect" scripts, basically executing a "show run" and capturing the output.
>
> Another method of retrieving the config is via SNMP, however unless you're
> using SNMP v3 with encryption, this method is potentially insecure.
>
> This entry was posted on Thursday, July 31st, 2008 at 3:03 am and is filed
> under Cisco <http://blog.pressure.net.nz/?cat=2>.You can follow any
> responses to this entry through the RSS 2.0<http://blog.pressure.net.nz/?feed=rss2&p=15>feed. You can skip
> to the end <http://blog.pressure.net.nz/?p=15#respond> and leave a
> response. Pinging is currently not allowed.
>
>
> --
> There's a box?
>
> _______________________________________________
> Trilug-ontopic mailing list
> Trilug-ontopic at trilug.org
> http://www.trilug.org/mailman/listinfo/trilug-ontopic
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.trilug.org/pipermail/trilug-ontopic/attachments/20081029/c904eaf3/attachment.htm 


More information about the Trilug-ontopic mailing list