cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
842
Views
0
Helpful
4
Replies

SSH scripts

dlwanuradha
Level 1
Level 1

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 4

cisco24x7
Level 6
Level 6

This can be done with an expect script in

about 5 minutes.

CCIE Security

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

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

Thanks in advance,

Regards,

Anuradha.

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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: