08-03-2009 10:48 AM
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.
08-05-2009 12:05 PM
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?
08-05-2009 01:32 PM
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.
08-05-2009 01:38 PM
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.
08-05-2009 01:40 PM
At the very least you'd need two actions:
action 1.0 cli command "enable"
action 2.0 cli command "archive tar /xtract ..."
08-03-2009 11:18 PM
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.
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: