12-01-2012 05:47 AM
Hello All
Can someone please show me how to execute a tcl script from the command prompt on a cisco router?
Cheers
Carlton
Solved! Go to Solution.
12-03-2012 12:14 AM
You can only run EEM policies manually if they are registered with the none event detector. So what you did is fine. However, if you want to run it just to test it, have a look at https://supportforums.cisco.com/docs/DOC-12757 and scroll down to the Testing section.
12-01-2012 06:38 AM
Hi,
Assume that you have tcl script to ping 3 ip address as below.
foreach address {
1.1.1.1
2.2.2.2
3.3.3.3
} {ping $address}
Use "tclsh" command and copy the script. That should do the job. Please find below example.
R1#tclsh
R1(tcl)#foreach address {
+>(tcl)#1.1.1.1
+>(tcl)#2.2.2.2
+>(tcl)#3.3.3.3
+>(tcl)#} {ping $address}
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
R1(tcl)#
Hope this helps.
Regards
Najaf
Please rate when applicable or helpful !!!
12-01-2012 06:46 AM
Najaf,
As I mentioned, I think I may have figured out how to run tcl scripts, but I keep on getting the error message below....
Any thoughts?
Cheers
12-01-2012 06:44 AM
I think I've figured out how to run tcl scripts.
I have the following script on my router EmailTemplate.tcl, however when I attempt to run it using the following command I get the error mesag EmailTemplate.tcl not registered with event none Event Detector
Cheers
Carlton
12-01-2012 06:54 AM
Hi Carlton,
Are you using any EEM? Sorry im not much in to EEM's yet :-)
You may use below url which explains how to configure EEM to send out email notifcations.
https://learningnetwork.cisco.com/blogs/network-sheriff/2009/06/19/writing-your-first-eem-applet
Regards
Najaf
12-01-2012 06:59 AM
Najaf,
That is a very good link. Unfortunately, it doesn't explain how to run tcl from within a router
12-02-2012 02:02 AM
I think I may have found the solution.
In order to run my tcl script called EmailTemplate.tcl I need to do the following int tcl mode:
Router(tcl)#source flash:EmailTemplate.tcl
The problem is I don't have the 'source' option.
Can someone please show me if there is an alternative to 'source'?
Cheers
Carlton
12-02-2012 05:28 PM
This will not work. You cannot run an EEM Tcl policy using tclsh. What do you actually want to do?
12-03-2012 12:05 AM
Hi Joesph,
I think I figured it out. However, I wanted to be able to run a tcl script at a cisco command prompt but I kept on getting the following error message 'EmailTemplate.tcl not registered with event none Event Detector'. So after much research I tweaked the script(see attachment). I now am able to run the script at the command prompt. However, can you let me know if its the way it should be done?
Cheers
Carlton
12-03-2012 12:14 AM
You can only run EEM policies manually if they are registered with the none event detector. So what you did is fine. However, if you want to run it just to test it, have a look at https://supportforums.cisco.com/docs/DOC-12757 and scroll down to the Testing section.
12-03-2012 12:23 AM
Wow, that's a great resource. Thanks Joseph.
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