03-14-2008 10:46 AM
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.
03-15-2008 06:46 PM
This can be done with an expect script in
about 5 minutes.
CCIE Security
03-16-2008 04:20 AM
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
03-16-2008 04:22 AM
Hi do you have any sample scripts or any docs on how to do it.
Thanks in advance,
Regards,
Anuradha.
03-16-2008 08:08 AM
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
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: