The Blueprint: TCL and EEM

In the previous post, I showed a simple TCL script that I used to copy multiple files from a USB stick to the CF(Flash) card of the router.

I took this a step further and wrote an EEM script that initializes and kicks off the TCL script once you insert the FLASH card into the router. I got lazy and didn’t want to perform any key strokes. With this setup, you don’t have to type any commands in the router! Pop the CF card in the router and boom…instant auto copy!

Here’s the EEM script that I wrote:

——————————–

event manager applet USB
event syslog pattern “%FILESYS-5-CF: CompactFlash inserted ”
action 1.1 cli command “enable”
action 1.2 cli command “tclsh usbflash1:TCL/usbtoflash.tcl”
action 1.3 syslog priority debugging msg “FILE COPY COMPLETE”

——————————– 

This EEM script is configured on the router that I used for all the copies. The TCL script file, usbtflash.tcl, is saved on the source location(in this example, it is the USB stick plugged into the usbflash1 slot on the router) along with all of the other files I want to copy to FLASH.

This just a small example of what you can do when you combine EEM scripting along with the TCL scripting. This script can be modified to your liking…Have fun!

….gosh those CCIE numbers are getting higher and higher…hopefully I can get one before they hit the 40K mark.

CiscoNinjaNC

Advertisements

One response to “The Blueprint: TCL and EEM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: