cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2315
Views
5
Helpful
19
Replies

Using EEM & tcl script to talk to a remote http server

thinkingphones
Level 1
Level 1

I would like to use the eem and a tcl script to check for any new files to download from a remote http server. The eem would be used as a scheduler to invoke the tcl script - which would access the http server and download any new files (what will be ip phone config files) to the flash on the router.

Can anyone provide me with an example config for this?

thanks,

John.

19 Replies 19

So could i accomplish what i am looking for just using the EEM? Something like this:

event manager applet LoadConfigFiles

event timer cron name "load_timer" cron-entry "0 23 * * *"

action 1.0 cli command "configure terminal"

action 1.1 cli command "file prompt quiet"

action 1.2 cli command "exit"

action 2.0 cli command "copy http://10.10.10.10/test-tar/files.tar flash:files.tar"

action 3.0 cli command "archive tar /xtract flash:files.tar flash:/"

Or is it better to use a policy tcl script?

Yes, this would work provided you add:

action 0.5 cli command "enable"

But you could further simplify this. Change action 2.0 to:

action 2.0 cli command "archive tar /xtract http://10.10.10.10/test-tar/files.tar flash:/"

Then remove action 3.0. The advantage of Tcl is that you could extract the tar file to a temp directory, then scan the files to see if any of them need to be installed. This may not be necessary given your end goal, though.

If i were to use the above command - the applet would be simplified to the one action line, correct? This sounds good to me!

The tar file itself will include only files that have changed or are new in the remote directory - so yeah, having a temp dir on the router should not be necessary.

thanks again,

John.

At the very least you'd need two actions:

action 1.0 cli command "enable"

action 2.0 cli command "archive tar /xtract ..."

Any device which supports EEM 2.1 should have the http library. This means IOS 12.3(14)T and higher, 12.2(18)SXF5 and higher, etc.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: