Exec Scripts Overview
Cisco IOS XR exec scripts are on-box scripts that automate configurations of devices in the network. The exec scripts are written in Python using the Python libraries that Cisco provides with the base package. The scripts access the configuration and retrieve the operational state of the network element. You can trigger the exec scripts manually via CLI commands or an Remote Procedure Call (RPC) over the NETCONF protocol. The script performs the operations that management scripts perform from an external controller. The operations include connecting to NETCONF server on the router, configuring the router, querying the operational data using data models, or CLI commands. You can download scripts to the disk, configure the scripts, and view the operational data. You can run a maximum of 10 scripts simultaneously.
A script management repository on the router manages the exec scripts. This repository is replicated on both RPs.
In Cisco IOS XR, Authentication, Authorization, and Accounting (AAA) controls the user access and privileges to perform operations. To run the exec script, you must have root user permissions.
Exec scripts provide the following advantages:
- Provides automation capabilities to simplify complex operations.
- Create customized operations based on the requirement.
- Provide flexibility in changing the input parameters for every script run. This fosters dynamic automation of operational information.
- Detect and display errors and warnings when executing an operation.
- Run multiple automated operations in parallel without blocking the console.
This chapter gets you started with provisioning your Python automation scripts on the router.
Note: This chapter does not delve into creating Python scripts, but assumes that you have basic understanding of Python programming language. This section will walk you through the process involved in deploying and using the scripts on the router.