08-22-2014 08:41 AM
i want to make changes in more than 30 cisco devices.
For example:
So, there is a TCL script to make ssh in my devices and make this changes? Instead get into the device one by one.
Thanks a lot
PS: I know that Cisco Prime works, but now i can't buy it.
Solved! Go to Solution.
08-22-2014 12:45 PM
I don't believe there is a way via a TCL script to handle entering a password after the SSH command is entered.
SecureCRT is a paid program which allows for a decent amount of scripting. You can have a script read a list of devices from a text file (for flexibility), prompt the user to enter their username/password at the beginning of the script, and it can go through each device and execute the commands in the script. It can be done in about 20-30 lines of code (VBS, Python, or Javascript) but SecureCRT has a couple of it's own commands you'd need use (their documentation is good but a little long).
There may be some alternative free programs with scripting built in. I know TeraTerm has scripting in some form but I'm unsure how flexible or easy it is to use. I looked at it briefly at one point and wasn't too impressed but you can't beat the price.
08-24-2014 07:14 AM
You can use rancid to run the same commands on multiple devices:
cat <<_EOF_ > /tmp/x
conf term
logging host 10.10.2.4
end
_EOF_
clogin -x /tmp/x devName1 devName2 ... devNameN
get rancid from http://www.shrubbery.net/rancid/
For windows you'll also need cygwin: http://www.cygwin.com/
> Aaron Drydale
> I don't believe there is a way via a TCL script to handle entering a password after the SSH command is entered.
include the ssh command in the tcl/expect script
Regards,
Lee
08-22-2014 12:45 PM
I don't believe there is a way via a TCL script to handle entering a password after the SSH command is entered.
SecureCRT is a paid program which allows for a decent amount of scripting. You can have a script read a list of devices from a text file (for flexibility), prompt the user to enter their username/password at the beginning of the script, and it can go through each device and execute the commands in the script. It can be done in about 20-30 lines of code (VBS, Python, or Javascript) but SecureCRT has a couple of it's own commands you'd need use (their documentation is good but a little long).
There may be some alternative free programs with scripting built in. I know TeraTerm has scripting in some form but I'm unsure how flexible or easy it is to use. I looked at it briefly at one point and wasn't too impressed but you can't beat the price.
08-24-2014 07:14 AM
You can use rancid to run the same commands on multiple devices:
cat <<_EOF_ > /tmp/x
conf term
logging host 10.10.2.4
end
_EOF_
clogin -x /tmp/x devName1 devName2 ... devNameN
get rancid from http://www.shrubbery.net/rancid/
For windows you'll also need cygwin: http://www.cygwin.com/
> Aaron Drydale
> I don't believe there is a way via a TCL script to handle entering a password after the SSH command is entered.
include the ssh command in the tcl/expect script
Regards,
Lee
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide