06-09-2021 02:20 PM
I am attempting to use EEM to build an applet that will automatically backup the configuration to a TFTP server after changes are made per DISA STIGS. I have tried different variations and still come up with no backup.
First I tested the command #copy run tftp://10.0.0.10 and it copies the configuration without any issue. I can write it this way to get a text file #copy run tftp://10.0.0.10/<switchname>.txt
I am getting quite frustrated trying to make an applet to work. Here is what I have tried
event manager applet Backup-Config
event syslog pattern "%SYSLOG-5-CONFIG_I"
action 1 info type routername (only option that matches)
action 1.1 cli command "enable"
action 1.2 cli command "copy run tftp" pattern "remote host"
action 1.3 cli command "10.0.0.10" pattern "filename"
action 1.4 cli command "$_info_routername-config"
I tried different variations and nothing happens.
Can anyone help me? This is the first time I am working with EEM and it is definitely like learning a new language.
Thank you for any assistance.
Robert
06-09-2021 02:35 PM
i tested some time back this works.
event manager applet Backup-Running-Config
description Backup-Running-Config
event syslog pattern "%SYS-5-CONFIG_I: Configured from"
action 0.1 info type routername
action 1.0 cli command "enable"
action 1.1 cli command "copy run tftp" pattern "Address"
action 1.2 cli command "10.10.10.10" pattern "filename"
action 1.3 cli command "$_info_routername-config_$_event_pub_sec"
action 2.0 syslog priority informational msg "Configuration change detected. Write to TFTP succesfully executed"!
06-09-2021 03:03 PM
06-09-2021 03:23 PM
Are you able to copy the config to TFTP to confirm is this working?
Do you get success log in the Logs ?
06-09-2021 03:38 PM
02-16-2024 06:04 AM
I tested something like this recently. For me, my testing suggests that this line is incorrect:
action 1.3 cli command "$_info_routername-config_$_event_pub_sec"
when I changed the variable to $_info_routername-confg it worked.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide