TCLSH and Macro Ping Test on Cisco Routers and Switches

This topic is to discuss the following lesson:

very useful… Thanks Rene !!

Hello Team,

I have access to a virtual Cisco lab and I tried the ping script, but when I enter TCL mode there is no foreach option. Does it depend on IOS version?

Capture112

Thank you.

Regards,

Hello Milan

When using the TCLSH configuration mode, the scripting commands do not appear in the context sensitive help using the “?”. Only the CLI commands will appear there, not the scripting commands. As you can see from my test below, the foreach command does not appear as a command, but is accepted as part of the script:

R1#tclsh
R1(tcl)#f?
format  fsck  

R1(tcl)#foreach address {
+>(tcl)#

I hope this has been helpful!

Laz

1 Like

Thank you Laz for your time to replay, all is clear now :slight_smile:

1 Like

Hello there,
This script doesn’t work on Version 15.2(4)M1. Can we get an updated one for pings and trace?

Hello Seng

Thanks for pointing this out. I’m not sure if the issue is with the script, the syntax or the support. Cisco IOS version 15.2(4)M1 does support TCL scripts according to the Cisco Feature Navigator. Can you tell us a little bit more about what error messages you are getting? Also, can you tell us the platform you are running this on? All of these will affect whether this script will actually run on your setup. Let us know so we can help you further.

I hope this has been helpful!

Laz