cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1057
Views
0
Helpful
2
Replies

EEM script | Upgrade Code | 9300

emory.clayton
Level 1
Level 1

Having issues getting an EEM script to run to download code from a tftp server, then executing the necessary commands to install. Looking at the output of the "debug event manager action cli" command, it seems action 1.3 is my issue. 

Switch#event manager run CODE_DOWNLOAD
Copying cat9k_iosxe.17.06.04.SPA.bin...

*Dec 1 11:53:30 EST: %HA_EM-6-LOG: CODE_DOWNLOAD : DEBUG(cli_lib) : : CTL : cli_open called.
*Dec 1 11:53:30 EST: %HA_EM-6-LOG: CODE_DOWNLOAD : DEBUG(cli_lib) : : OUT : Switch>
*Dec 1 11:53:30 EST: %HA_EM-6-LOG: CODE_DOWNLOAD : DEBUG(cli_lib) : : IN : Switch>enable
*Dec 1 11:53:30 EST: %HA_EM-6-LOG: CODE_DOWNLOAD : DEBUG(cli_lib) : : OUT : Switch#
*Dec 1 11:53:30 EST: %HA_EM-6-LOG: CODE_DOWNLOAD : DEBUG(cli_lib) : : IN : Switch#copy tftp://10.0.0.1/cat9k_iosxe.17.06.04.SPA.bin flash:
Switch#

 

This is my EEM script:
event manager applet CODE_DOWNLOAD
event none sync yes maxrun 2600
Action 1.1 cli command "enable"
action 1.2 puts "Copying cat9k_iosxe.17.06.04.SPA.bin..."
action 1.3 cli command "copy tftp://10.0.0.1/cat9k_iosxe.17.06.04.SPA.bin flash:" pattern "cat9k_iosxe.17.06.04.SPA.bin"
action 1.4 cli command "y"
action 1.5 wait 2400
action 1.6 cli command "no boot system"
action 1.7 cli command "boot system bootflash:packages.conf"
action 1.8 cli command "install add file bootflash:cat9k_iosxe.17.06.04.SPA.bin activate commit" pattern "y\/n"
action 1.9 syslog msg "EEM Script Executing"

I have tried several iterations of action 1.3 after researching various forms:
action 1.3 cli command "copy tftp://10.0.0.1/cat9k_iosxe.17.06.04.SPA.bin flash:" pattern "cat9k_iosxe.17.06.04.SPA.bin"
action 1.3 cli command "copy tftp://10.0.0.1/cat9k_iosxe.17.06.04.SPA.bin flash:" pattern "y\/n"

Any help is appreciated 

2 Replies 2

emory.clayton
Level 1
Level 1

I figured it out. This sequence worked for me:

action 1.3 cli command "copy tftp://10.0.0.1/cat9k_iosxe.17.06.04.SPA.bin flash:" pattern "cat9k_iosxe.17.06.04.SPA.bin"
action 1.4 cli command "y"

Leo Laohoo
Hall of Fame
Hall of Fame

Kindly refer to attachment.

Review Cisco Networking for a $25 gift card