cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1169
Views
0
Helpful
7
Replies

Updating the IOS via ftp using EEM scripts on 891f and 892

ffong_jha
Level 1
Level 1

Hello guys,

 

I am working/testing on ftp an IOS update to our 891fs and 892s. We currently use EEM for things like interface IP updates and erasing NVRAM and they work great. I have hit a wall, I am not sure what is going wrong with my script. I have tried several variations and it does seem to work. Any help would be appreciated. Here are variations I have tried:

 

conf t
event manager applet IOS_Update
event none
action 1.0 cli command "enable"
action 2.0 cli command "copy ftp://ffong:password@10.90.0.46/cisco/c800-universalk9-mz.SPA.154-3.M6a.bin flash:"
action 3.0 cli command "config t"
action 4.0 cli command "boot system flash c890-universalk9-mz.157-3.M4a.bin"
action 5.0 cli command "end"
action 5.0 cli command "wr"
action 6.0 cli command "end"
action 9999 cli command "q"
end
wr

----------------------------------------------------------------------------------------------------

conf t
event manager applet IOS_Update authorization bypass
event timer absolute time 3600
action 1.0 cli command "enable"
action 2.0 cli command "copy ftp://ffong:password@10.90.0.46/cisco/c800-universalk9-mz.SPA.157-3.M4a.bin flash:"
action 3.0 cli command "wr"
action 9999 cli command "end"
end
wr

-----------------------------------------------------------------------------------------------------

conf t
event manager applet IOS_Update authorization bypass
event timer absolute time 3600
action 0.1 cli command "enable"
action 1.1 cli command "copy ftp://ffong:password@10.90.0.46/cisco/c800-universalk9-mz.SPA.157-3.M4a.bin flash:"
end
wr

7 Replies 7

balaji.bandi
Hall of Fame
Hall of Fame
conf t
event manager applet IOS_Update
event none
action 1.0 cli command "enable"
action 2.0 cli command "copy ftp://ffong:password@10.90.0.46/cisco/c800-universalk9-mz.SPA.154-3.M6a.bin flash:"
action 3.0 cli command "config t"
action 4.0 cli command "boot system flash c890-universalk9-mz.157-3.M4a.bin"
action 5.0 cli command "end"
action 5.0 cli command "wr"
action 6.0 cli command "end"
action 9999 cli command "q"
end
wr

The one you copy and one you booting does not match.

you also need to do 

 

no boot system flash c890-universalk9-mz.XXXXXXXXXXXXX (this is exiting one)

boot system flash c890-universalk9-mz.157-3.M4a.bin

 

wr and reload should work

 

Note: most of the my upgrade out of the box scripting, has never done using EEM, but it should work

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Leo Laohoo
Hall of Fame
Hall of Fame

I do not understand what is the requirement to make this very complicated and do not "re-invent" the wheel. 

This entire process can easily be done in Notepad: 

1.  Copy the IOS into the router

2.  Change the boot variable string. 

3.  Save the config

4.  Reboot the router. 

Keep it simple.  

Thank you guys, yes I apologize on the EEM, I do have the right one for action 2 and 4, I just copied the wrong one here. We are trying to push this to 3K+ devices and doing it manually is not a real option right now.

 

conf t
event manager applet IOS_Update
event none
action 1.0 cli command "enable"
action 2.0 cli command "copy ftp://ffong:password@10.90.0.46/cisco/c890-universalk9-mz.157-3.M4a.bin flash:"
action 3.0 cli command "config t"
action 4.0 cli command "boot system flash c890-universalk9-mz.157-3.M4a.bin"
action 5.0 cli command "end"
action 5.0 cli command "wr"
action 6.0 cli command "end"
action 9999 cli command "q"
end
wr

The EEM is going to be copy-n-pasted into the router, right? 

Try this in a Notepad: 

 

conf t
no boot system flash flash:
boot system flash flash:c890-universalk9-mz.157-3.M4a.bin
end
wr
copy
copy ftp://ffong:password@10.90.0.46/cisco/c890-universalk9-mz.157-3.M4a.bin flash:

Be aware that comparing the MD5 hash is not being performed either EEM or the method above. 

 

Thank you, it will be sent on mass via an ftp server not copied individuality.

If you have Server which is pushing this config, you can use same device to upgrade also for teh devices.(rather using EEM ?)

 

until you wan to do that  with EEM only ?  i do upgrade switch using scripting outof the box. it works, just test couple of device, is the process works as expected before you doing mass level ?

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

ffong_jha
Level 1
Level 1

Thank you guys, yes I apologize on the EEM, I do have the right one for action 2 and 4, I just copied the wrong one here. We are trying to push this to 3K+ devices and doing it manually is not a real option right now.

 

conf t
event manager applet IOS_Update
event none
action 1.0 cli command "enable"
action 2.0 cli command "copy ftp://ffong:password@10.90.0.46/cisco/c890-universalk9-mz.157-3.M4a.bin flash:"
action 3.0 cli command "config t"
action 4.0 cli command "boot system flash c890-universalk9-mz.157-3.M4a.bin"
action 5.0 cli command "end"
action 5.0 cli command "wr"
action 6.0 cli command "end"
action 9999 cli command "q"
end
wr

 

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: