Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

Automatic configuration changes rollback

  Hi All.

  Attached you could find this cli policy.

  Usefull if you apply configuration changes to remote sites, and sometimes due its changes you lost access to the router and forgot the reload in command....

This script will roll back configuration to the previous running configuration. Will not reload router, so you will not lost unsaved configuration changes.

  This use the configure replace command available from 12.3.(7)T, 12.2(25)S, 12.2(33)SRA, and some other eem features like multiple event match from eem 2.4 available in 12.4(20)T. I use this to avoid a loop. The policy detects the "configure terminal", commands, but cant distinguish the user conf t from the EEM scripts configure terminal unless using a second match on syslog msg, that have the username. Maybe you could modify this script and use this in lower ios versions, using an alias for the configure terminal command under the EEM policy, but i didnt test this.

   I have other version, that instead of saving the running configuration and rolling back to this, rollback fom the startup config.

   This looks like there is some issues with the syslog pattern matching. The username ¨cisco¨ matchs on the pattern ¨console¨ ........ Recommended use of usernames, because script use this to know which configuration messages are from the user changes, and what from the own eem scripts. Be carefull username dont match on the syslog patterns.

   Feel free to check this policy and if needed fix any error.

  Added version 1.3, that will work for ios 12.4(14)T15, not sure from what version. Version 1.2 needs a 12.4(20)T feature.

   Br

   Alex.

916
Views
0
Helpful
0
Replies