SSH scripts

Unanswered Question
Mar 14th, 2008


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.


I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
cisco24x7 Sat, 03/15/2008 - 18:46

This can be done with an expect script in

about 5 minutes.

CCIE Security

m.hierling Sun, 03/16/2008 - 04:20

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

dlwanuradha Sun, 03/16/2008 - 04:22

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

Thanks in advance,



m.hierling Sun, 03/16/2008 - 08:08

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"



This Discussion