Aegis Automation Workflows in 5 Minutes - Backup Running Configuration from Cisco IOS Network Devices

Aegis Automation Workflows in 5 Minutes - Backup Running Configuration from Cisco IOS Network Devices

The "Aegis Automation Workflows in 5 Minutes" cool-tool blog series shows examples of Aegis workflows which deliver value in as little as 5 minutes development time - all using out of the box activities! Aegis workflows can be forever evolving, and while these workflows fulfill a purpose, you may for example want to extend a workflow from being a simple notification workflow to one which goes further to remediate a problem.

This 5 minute workflow will connect to all your Cisco Network Devices and save their running configuration to disk. This could be done on a schedule, before upgrades or just to verify the configuration hasn't changed automatically. The workflow will use a list of known devices and connect to each one in turn, saving their current configuration to a backup location.

This is what the workflow looks like...

workflow3

The workflow has uses a stored array of ip addresses for the list of Network Devices which are processed in sequence using the 'For Each' loop activity. It then establishes connections to the devices using Telnet (Arrgh Security! - check the Next steps below... I don't have SSH capable IOS version). The Telnet activity issues a number of commands to output the running configuration ...


workflow3a

Next it uses a regular expression to remove the unwanted text from the telnet session output including the logging in etc. and then saves the regex output to file.


workflow3b


And you are done ... hopefully in 5 minutes!


The workflow is attached if you want to compare results. There are some workitem attributes which need updating to work in your environment, the password attribute stores the Cisco password (I use the same for login and running enable command), networkDeviceList stores the address's of the Devices to connect to and outputfilePath is where to store the config files . Everything else is generic. The workflow requires Aegis 3.2 and Cisco IOS devices.


Next Steps - yes you've guessed it, there are loads of possibilities to extend this workflow! Here are some examples...


  1. A must - add some error handling and notification! If there are any failures (for example is a Cisco Network Device is unreachable) the workflow will silently fail apart from an error in console.

  2. Substitute the Telnet Activity with the SSH activity if you have SSH capable IOS version. Add decision support if you have a mix of Telnet / SSH devices.

  3. The workflow has a static list of device addresses - you can read the list dynamically from another source so the workflow always picks the current device list. Reading from File / Database etc.

  4. The same technique can be used to verify IOS versions, update passwords etc.

  5. Could you perform a restore of a configuration?

  6. Verify if there are any changes since the previous backup - notification if there is ?

  7. Add a scheduled trigger, so the workflow runs automatically on a schedule of your choosing.


Attachments

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2014-09-03 19:50
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.