cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1144
Views
5
Helpful
2
Replies

Updateing an EEM Script with VRF

TW80CJ5
Level 3
Level 3

Hello everyone!

 

I am trying to update the following EEM script that will include the vrf, vrf CORP_OFFICE.

 

This script works great with out the VRF but I need to be able to include it because it is causing the backup to fail.

 

event manager applet BACKUP_BEFORE_CONFIG_CHANGE
description Backup of Config Before Changes Made
event syslog pattern "%SEC_LOGIN-5-LOGIN_SUCCESS"
action 1.0 info type routername
action 1.1 set hostname "$_info_routername"
action 1.2 set epoch "$_event_pub_sec"
action 1.3 cli command "enable"
action 1.4 cli command "copy running-config scp://username:password@192.168.10.45/BACKUPS/SWITCH/BEFORE_CONFIG_CHANGE_BACKUP/$hostname" pattern "Address"
action 1.5 cli command "" pattern "Destination"
action 1.6 cli command "" pattern "Destination"
action 1.7 cli command ""

 

 

I tried  this with no luck: action 1.4 cli command "copy running-config scp://username:password@192.168.10.45/BACKUPS/SWITCH/BEFORE_CONFIG_CHANGE_BACKUP/$hostname" pattern "Address" vrf CORP_OFFICE

 

Also with no luck: action 1.4 cli command "copy running-config vrf CORP_OFFICE scp://username:password@192.168.10.45/BACKUPS/SWITCH/BEFORE_CONFIG_CHANGE_BACKUP/$hostname" pattern "Address"

 

Thoughts? Comments? Suggestions???

 

Thanks!!!!

2 Replies 2

Dan Frey
Cisco Employee
Cisco Employee

Add this to the global config and give it a try:  ip ssh source-interface <interface_name>

OK, I added that (which was missing) and its not coming across. This eem script is working great on my ISR4431 and 4461 routers. And was working great with my 9300 switches.

 

In the switch debug, I am seeing a "command authorization failed". I am troubleshooting our AAA config and making sure the "eem.user" has the appropriate permissions on the switch to execute the command.

 

I will keep you posted.


Thanks!!!!!!!!!!!

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: