cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1848
Views
15
Helpful
7
Replies

Cisco ISR 4431 EEM Script

TW80CJ5
Level 3
Level 3

Good Afternoon?

 

I am trying to configure EEM to run an automated backup using the following:

 

event manager applet DAILY_STARTUP_CONFIG_BACKUP
event timer watchdog time 86400
action 0 cli command copy /noconfirm start scp://abc:123@192.168.1.10/ROUTER/START

 

I cant get it to work. It works fine in my ASA config.


Ideas???


Thanks!!!!!!!

1 Accepted Solution

Accepted Solutions

Tyson Joachims
Spotlight
Spotlight

Also since you requested it, here is the EEM script that would do the same thing:

event manager applet BACKUP-CONFIG
 event timer watchdog time 86400
 action 010 cli command "enable"
 action 020 cli command "write memory"
 action 030 cli command "copy running-config scp://abc:123@192.168.1.10/ROUTER/START" pattern "Address"
 action 040 cli command "" pattern "Destination"
 action 050 cli command "" pattern "Destination"
 action 060 cli command ""

If you need to trouble shoot it, you can do so with the following:

terminal monitor
debug event manager action cli

The following command will tell you how long it will before the script runs again:

show event manager statistics server

View solution in original post

7 Replies 7

Tyson Joachims
Spotlight
Spotlight

Consider the "Archive" command

archive
 path scp://abc:123@192.168.1.10/ROUTERS/START
 write-memory
 time-period 86400

We are currently required to use the archive function to backup locally to flash for compliance reasons.

 

I need to be able to transfer it out on a scheduled task.


Thanks

In that case, you could still use the archive command but in conjunction with the kron scheduler. The following commands uses the archive to send to the SCP server any time the switch saves a local copy of the configuration to flash. The kron scheduler creates a policy that executes the "write memory" command every day at 02:00am (make sure your clock is correct on the switch). The actions of the kron job backs up the running configuration to the startup configuration in flash and in by doing so, invokes the archive to send a copy to the remote SCP server.

archive
 path scp://abc:123@192.168.1.10/ROUTERS/START
 write-memory
!
kron occurrence DAILY at 02:00 recurring
 policy-list CONFIG-LOCAL-BACKUP
!
kron policy-list CONFIG-LOCAL-BACKUP
 cli write memory

Are you sure this is going to work on a router...???

 

I will try it on Monday and keep you posted.

Tyson Joachims
Spotlight
Spotlight

Also since you requested it, here is the EEM script that would do the same thing:

event manager applet BACKUP-CONFIG
 event timer watchdog time 86400
 action 010 cli command "enable"
 action 020 cli command "write memory"
 action 030 cli command "copy running-config scp://abc:123@192.168.1.10/ROUTER/START" pattern "Address"
 action 040 cli command "" pattern "Destination"
 action 050 cli command "" pattern "Destination"
 action 060 cli command ""

If you need to trouble shoot it, you can do so with the following:

terminal monitor
debug event manager action cli

The following command will tell you how long it will before the script runs again:

show event manager statistics server

Heck yeah man!!!

 

I will be testing first thing on Monday! Thanks for a potentially great solution!

TW80CJ5
Level 3
Level 3

Works as needed! Thank you!