7

I've not been able to find much in regards to TCL other than the Cisco PDF "Cisco IOS Scripting with TCL Configuration Guide" and I just have a few queries.

I'm looking into potentially utilising this for pinging a range of addresses withing a specific range of DHCP to check for live hosts. (though this can be done via the broadcast address for our large sites it would produce un-neccessary output as well as ip directed-broadcast)

what I want to know, is if I enter TCLSH to write up a quick script to test the range I like, what effect does this have on the router - I.E

Does it create a script file in memory that is held or is it run and forgotten after i exit tcl mode?

Does the script cause any significant overhead on the router that is worth noting?

Less important, but something I've been trying to find - Is there any specific version that tcl was introduced to IOS as standard?

Cheers guys - appreciate anything that can be provided :)

  • Does it create a script file in memory that is held or is it run and forgotten after i exit tcl mode? Yes it's only saved temporary in memory. You can save the script to a normal text file and rename it to .tcl, then upload it to the falsh and run it from there, for instance: Router#tclsh flash:/test.tcl. The overhead is only significant if the script is extremely large and utilizes lots of different processes. – user36472 Dec 20 '17 at 13:06
  • Hey @Cown ~ Thanks for the response, thats perfect, exactly what I was hoping - Had trouble finding the info in the cisco doc - looking through it atm, but theres alot thats going straight over my head! Appreciate it! Edit: appreciation – matthew walker Dec 20 '17 at 13:09
  • Cisco TCL scripting was introduced with versions: 12.3(2)T 12.3(7)T 12.2(25)S 12.2(33)SXH 12.2(33)SRC 12.2(33)SB Cisco IOS XE 3.1.0SG – user36472 Dec 20 '17 at 13:10
8

Does it create a script file in memory that is held or is it run and forgotten after I exit tcl mode?

Yes it's only saved temporary in memory. You can save the script to a normal text file and rename it to end with .tcl, then upload it to the flash and run it from there. For instance: Router#tclsh flash:/test.tcl.

Does the script cause any significant overhead on the router that is worth noting?

The overhead is only significant if the script is extremely large and utilizes lots of different processes. Remember that script errors with infinite loops can cause a switch to crash, even the high end versions.

Less important, but something I've been trying to find - Is there any specific version that tcl was introduced to IOS as standard?

Cisco IOS Scripting with Tcl

12.3(2)T 12.3(7)T 12.2(25)S 12.2(33)SXH 12.2(33)SRC 12.2(33)SB Cisco IOS XE 3.1.0SG

The Cisco IOS Scripting with Tcl feature provides the ability to run Tcl version 8.3.4 commands from the Cisco IOS command-line interface.

The following commands were introduced or modified: scripting tcl encdir, scripting tcl init, scripting tcl low-memory, tclquit, tclsh.

Tcl SNMP MIB Access

12.3(7)T 12.2(25)S 12.2(33)SXH 12.2(33)SRC 12.2(33)SB Cisco IOS XE 3.1.0SG

The Tcl SNMP MIB Access feature introduces a set of UNIX-like SNMP commands to make access to Simple Network Management Protocol (SNMP) MIB objects easier.

Tcl UDP and VRF support

15.1(1)T

The Tcl UDP and VRF feature provides support for UDP sockets in IOS Tcl.

The following commands were introduced or modified: fconfigure, socket, udp_open, udp_peek.

Fun little script guide:

http://www.ciscozine.com/ios-scripting-with-tcl/

Example of large script:

https://supportforums.cisco.com/t5/eem-scripting/tcl-script-to-replace-text-in-a-file-stored-in-flash/td-p/2516640

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.