config_manager

Description

Script to automate configuration of NTP, SNMP and Logging on IOS XE devices

This Python script will iterate over a list of IOS XE devices specified on the devices.csv file, and will push a standard NTP, SNMP or Logging configuration depending on the selected option.
This will be done using the RESTCONF protocol.

About the LAB to run the demo.

The devices.csv file contains the CSR1000v Always-on DevNet sandbox as part of this demo.
Sandbox URL: https://devnetsandbox.cisco.com/RM/Diagram/Index/27d9747a-db48-4565-8d44-df318fce37ad?diagramType=Topology

CSR1000V Host: ios-xe-mgmt.cisco.com

SSH Port: 8181

NETCONF Port: 10000

RESTCONF Ports: 9443 (HTTPS)

Credentials of this public available Sandbox to specify when prompted for it:

Username: developer

Password: C1sco12345

Usage

  1. Clone this repo in your local machine typing on your terminal:

git clone https://github.com/agmanuelian/config_manager.git

  1. Install the required dependencies specified on the requirements.txt file:

pip install requirements.txt

  1. Edit the devices.csv file with the parameters (IP address and RESTCONF port) of the list of devices that you want to configure.
  2. Modify on the main_file.py script the directory from where the devices.csv file is read, with your local directory.
  3. Replace the confgen_response JSON object with your infrastructure parameters (NTP server, SNMP and Logging parameters).
  4. Run the main_file.py script.

python main_file.py

  1. You will be prompted to enter your TACACS credentials (demo credentials specified on previous section) to access the list of devices.
  2. You will be prompted to enter the desired option (whether to configure NTP, Logging or SNMP)
  3. Based on your selection, the script will configure it on the list of devices.

REF: TACACS is a network device access management protocol. If you have that configure to access all your network devices, you could use your TACACS credentials to access the network devices. Otherwise, using local authentication will work, too.

Release Notes

Version 1.0

The configuration parameters are specified statically on the script. In order to configure the list of network devices, these NTP, SNMP and Logging parameters should be statically typed on the JSON structure embedded on the script. On future releases, it will be get using an API call to a specific application that generates config files.

View code on GitHub

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.