Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

SSH scripts

Hi,

Can someone please let me know if you have a unix script to capture interface configuration if the device is running only on ssh.

I just wanted to know whether spanning tree port fast is enable on them.

Thanks a lot.

Anuradha.

4 REPLIES
Silver

Re: SSH scripts

This can be done with an expect script in

about 5 minutes.

CCIE Security

Community Member

Re: SSH scripts

the rancid tools collection has a tool called clogin which performs a login to all kind of cisco hardware, by telnet or ssh. you dont have to bother with expect (actually clogin is a expect script).

With that tool you can login to your device, execute some commands and you are back to commandline to feed to output to sed/grep/awk.

regards Martin

Community Member

Re: SSH scripts

Hi do you have any sample scripts or any docs on how to do it.

Thanks in advance,

Regards,

Anuradha.

Community Member

Re: SSH scripts

when clogin is set up correct you can use this to start:

clogin -c "sh run int Gi6/21" switch | grep "spanning-tree portfast" >/dev/null && echo "Enabled"

Martin

149
Views
0
Helpful
4
Replies
CreatePlease to create content