Updateing an EEM Script with VRF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2021 03:19 PM
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!!!!
- Labels:
-
EEM Scripting
-
Network Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2021 07:09 AM
Add this to the global config and give it a try: ip ssh source-interface <interface_name>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2021 08:22 AM
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!!!!!!!!!!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 08:46 AM
run this command:
ip tftp source-interface {management interface}
