Use this procedure to automatically deploy and activate third-party Python scripts through App Manager, including scheduler status checks and script execution for router automation.
NCS 1001 provides CLI commands to perform configurations and operations on the optical devices. If you want to automate the NCS 1001 node operations, you can run third party scripts through App manager. See Automatically deploy and activate third party script.
Follow these steps to deploy and activate third party script manually.
Procedure
-
Use the show script status command to check the list of the OPS scripts that are in-built in XR.
Example:
This command lists the status of xr_script_scheduler script. Ready status in the output means that the script checksum is verified and is ready to run.
RP/0/RP0/CPU0:ios#show script status Tue Oct 24 18:03:09.220 UTC ====================================================================================================== Name | Type | Status | Last Action | Action Time ------------------------------------------------------------------------------------------------------ show_interfaces_counters_ecn.py | exec | Ready | NEW | Tue Oct 24 07:10:36 2025 xr_data_collector.py | exec | Ready | NEW | Tue Oct 24 07:10:36 2025 xr_script_scheduler.py | process| Ready | NEW | Tue Oct 24 07:10:36 2025 ====================================================================================================== RP/0/RP0/CPU0:ios# -
Use the appmgr to run the XR scheduler script.
XR scheduler script contains the necessary
Example:
RP/0/RP0/CPU0:ios#configure RP/0/RP0/CPU0:ios(config)#appmgr RP/0/RP0/CPU0:ios(config-appmgr)#process-script xr_script_scheduler RP/0/RP0/CPU0:ios(config-process-script)#executable xr_script_scheduler.py RP/0/RP0/CPU0:ios(config-process-script)#commit -
Check for available process scripts in app manager.
This output highlights the xr_script_scheduler.py process script that is not activated.Example:
RP/0/RP0/CPU0:ios#show appmgr process-script-table Wed Oct 22 09:45:02.795 UTC Name Executable Activated Status Restart Policy Config Pending -------------------- -------------------- ----------- --------- ---------------- ---------------- xr_script_scheduler xr_script_scheduler.py No Not Started Always No -
Activate the available process script.
You can start executing a process script only after it is activated.
Example:
RP/0/RP0/CPU0:ios#appmgr process-script activate name xr_script_scheduler Wed Oct 22 09:45:41.035 UTC(Optional) Verify the status of the process script. This example shows the process script xr_script_scheduler is Activated.
RP/0/RP0/CPU0:ios#show appmgr process-script-table Wed Oct 22 09:45:47.275 UTC Name Executable Activated Status Restart Policy Config Pending -------------------- -------------------- ----------- --------- ---------------- ---------------- xr_script_scheduler xr_script_scheduler.py Yes Not Started Always No -
Use the appmgr process-script start command to start the available process script.
Example:
xr_script_scheduler is the only available process script.
This command starts the process script xr_script_scheduler.
RP/0/RP0/CPU0:ios#appmgr process-script start name xr_script_scheduler Wed Oct 22 09:46:08.273 UTC(Optional) Verify the status of the process script after activation. This example shows the process script xr_script_scheduler is Activated and Started.
RP/0/RP0/CPU0:ios#show appmgr process-script-table Wed Oct 22 09:46:24.679 UTC Name Executable Activated Status Restart Policy Config Pending -------------------- -------------------- ----------- --------- ---------------- ---------------- xr_script_scheduler xr_script_scheduler.py Yes Started Always No -
Verify the scheduler script is running.
- Run the show script execution command to verify the functioning of the debug and monitoring scripts.
Example:
This command displays a list of OPS scripts currently running.
RP/0/RP0/CPU0:ios# show script execution Tue Oct 24 19:41:15.882 UTC ==================================================================================================================== Req. ID | Name (type) | Start | Duration | Return | Status -------------------------------------------------------------------------------------------------------------------- 1698176223| xr_script_scheduler.py (process) | Tue Oct 24 19:37:02 2025 | 253.32s | None | Started ==================================================================================================================== RP/0/RP0/CPU0:ios# - Use the show script execution details command to verify if the scheduler script is running.
Example:
This command displays a list of OPS scripts currently running. If the scheduler script is correctly configured and activated, the scheduler script execution detail appears in the output.
RP/0/RP0/CPU0:ios#show script execution details Tue Oct 25 18:01:56.590 UTC ==================================================================================================================== Req. ID | Name (type) | Start | Duration | Return | Status -------------------------------------------------------------------------------------------------------------------- 1698170509| xr_script_scheduler.py (process) | Tue Oct 25 18:01:49 2023 | 7.68s | None | Started -------------------------------------------------------------------------------------------------------------------- Execution Details: ------------------ Script Name : xr_script_scheduler.py Version : 25.3.1.14Iv1.0.0 Log location : /harddisk:/mirror/script-mgmt/logs/xr_script_scheduler.py_process_xr_script_scheduler Arguments : Run Options : Logging level - INFO, Max. Runtime - 0s, Mode - Background Events: ------- 1. Event : New Time : Tue Oct 25 18:01:49 2025 Time Elapsed : 0.00s Seconds Description : Started by Appmgr 2. Event : Started Time : Tue Oct 25 18:01:49 2025 Time Elapsed : 0.11s Seconds Description : Script execution started. PID (15985) ==================================================================================================================== RP/0/RP0/CPU0:ios#
- Run the show script execution command to verify the functioning of the debug and monitoring scripts.
-
Copy the third party RPM files to the NCS 1001 node.
- Use any of the file transfer mechanisms to copy third-party RPM.
Example:
This example shows copying the RPM to the harddisk of the NCS 1001 node using scp.
RP/0/RP0/CPU0:ios#scp user@171.xx.xxx.xxx:/users/user/rpm-factory/RPMS/x86_64/nms-1.1-25.3.1.x86_64.rpm /harddisk: Tue Oct 24 18:02:42.400 UTC <snip> Password: nms-1.1-24.1.1.x86_64.rpm 100% 9664 881.5KB/s 00:00 RP/0/RP0/CPU0:ios# - (Optional) Verify the RPM files using dir <filepath> .
Example:
RP/0/RP0/CPU0:ios#dir harddisk:/nms-1.1-24.1.1.x86_64.rpm Wed Oct 24 19:53:54.041 UTC
- Use any of the file transfer mechanisms to copy third-party RPM.
-
Install the third party RPM files to use the required debug and monitoring python scripts.
The third party RPM files have the customized scripts to be executed. The third-party RPM contains two types of files:
-
One or more python scripts—For more information on developing python scripts, see IOS XR Programmability with Python and xr-python-scripts.
-
Run parameter JSON file—xr_script_scheduler.json has instruction for the scheduler script.
Example:
This is an example xr_script_scheduler.json file. Customize this file as per your requirements.
[ { "name": "__template_entry__.py", "description": ["**This is a template entry for documentation purpose. This entry will be ignored**", "name : Name of the python script to be executed", " [string][mandatory]", "description: Description of the script", " [string or list of strings][optional: default empty string]", "cmd_line_parameters: Script command line parameters" , " [list of strings][optional: default Null][Example: ", "env_variables: Enviromental variables to be set in script run shell", " [list of key value pairs][optional: default Null][Example: [['INT_NAME': 'hu0/1/0/1']]", "run_policy: Script restart policy when script exits", " [string: one of always/once/stop][optional: default 'always']", " always: restart the script every time it exits", " once: do not restart the script if it exits", " stop: stop an existing script run " ], "cmd_line_parameters": [], "env_variables": [], "run_policy": "always" }, { "name": "monitor_int_rx_cntr.py", "description": "Monitoring mgmt interface for Rx threshold of 100 ", "cmd_line_parameters": ["MgmtEth0/RP0/CPU0/0", "200", "-log", "debug"], "env_variables": [["INT_NAME", "FourHundredGigE0/9/0/0"], ["INT_NAME2", "FourHundredGigE0/10/0/0"]], "run_policy": "always" }, { "name": "monitor_int_rx_cntr.py", "description": "Monitoring Fo0/0/0/0 interface for Rx threshold of 1000000 ", "cmd_line_parameters": ["FourHundredGigE0/0/0/0", "1000000"], "run_policy": "once" }, { "name": "monitor_int_rx_cntr2.py", "description": "Monitoring Fo0/0/0/1 interface for Rx threshold of 5000000 ", "cmd_line_parameters": ["FourHundredGigE0/0/0/1", "5000000"], "run_policy": "always" }, { "name": "monitor_int_rx_cntr2.py", "description": "Monitoring Fo0/0/0/2 interface for Rx threshold of 5000000 ", "cmd_line_parameters": ["FourHundredGigE0/0/0/2", "8000000"], "run_policy": "stop" } ]Example:
Use the appmgr package install rpm <full RPM file path> command to install the third-party RPMs.RP/0/RP0/CPU0:ios#appmgr package install rpm /harddisk:/nms-1.1-25.3.1.x86_64.rpm Tue Oct 24 18:03:26.685 UTC RP/0/RP0/CPU0:ios# RP/0/RP0/CPU0:ios#show appmgr packages installed Tue Oct 24 19:42:07.967 UTC Sno Package --- ------------------------------------------------------------ 1 nms-1.1-25.3.1.x86_64 RP/0/RP0/CPU0:ios#After the scripts and the run parameters file become ready, build the RPM and configure the RPM to install files at <default exr appmgr rpm install path>/ops-script-repo/exec/<rpm name>/. RPM build tool for TPA is available at RPM Build Tool.
Note
Install the scripts in directories named after the RPM for smoother execution.
-
-
Use the show script status command to verify that the scripts and the run parameter files contained in the RPM are all installed successfully and added to the script management repository.
Example:
This output shows the status that two scripts (monitor_int_xr_cntr.py and monitor_int_rx_cntr2.py) and a run parameter file (xr_script_scheduler.json) file were installed in the third-party RPM named “nms”.
RP/0/RP0/CPU0:ios#show script status Tue Oct 24 19:41:10.696 UTC ====================================================================================================== Name | Type | Status | Last Action | Action Time ------------------------------------------------------------------------------------------------------ nms/monitor_int_rx_cntr.py | exec | Ready | NEW | Tue Oct 24 19:38:41 2023 nms/monitor_int_rx_cntr2.py | exec | Ready | NEW | Tue Oct 24 19:38:41 2023 nms/xr_script_scheduler.json | exec | Ready | NEW | Tue Oct 24 19:38:41 2023 show_interfaces_counters_ecn.py | exec | Ready | NEW | Tue Oct 24 19:33:52 2023 xr_data_collector.py | exec | Ready | NEW | Tue Oct 24 19:33:52 2023 xr_script_scheduler.py | process| Ready | NEW | Tue Oct 24 19:33:52 2023 ====================================================================================================== RP/0/RP0/CPU0:ios#After the scripts are installed, the scheduler script starts reading the run parameter JSON file and executes the required debug and monitoring scripts.
The logs generated by the scripts are available in the directory /harddisk\:/mirror/script-mgmt/logs/.
-
Verify that the debug and monitoring scripts are running.
Example:
Use the show script execution command to verify that the scripts are running.
RP/0/RP0/CPU0:ios#show script execution Tue Oct 24 19:41:15.882 UTC ==================================================================================================================== Req. ID | Name (type) | Start | Duration | Return | Status -------------------------------------------------------------------------------------------------------------------- 1698176223| xr_script_scheduler.py (process) | Tue Oct 24 19:37:02 2023 | 253.32s | None | Started 1698176224| nms/monitor_int_rx_cntr.py (exec) | Tue Oct 24 19:38:43 2023 | 152.46s | None | Started 1698176225| nms/monitor_int_rx_cntr.py (exec) | Tue Oct 24 19:38:44 2023 | 152.03s | None | Started 1698176226| nms/monitor_int_rx_cntr2.py (exec) | Tue Oct 24 19:38:44 2023 | 151.63s | None | Started ==================================================================================================================== RP/0/RP0/CPU0:ios#(Optional) Use the show script execution[ namescript-namedetail [output][error]]
-
Verify all the active packages are installed.
Example:
RP/0/RP0/CPU0:ios#show install active summary Fri Nov 14 12:52:39.322 IST Label : 25.3.1.31I-iso Active Packages: 2 ncs1001-xr-25.4.1.31I version=25.4.1.31I [Boot image] ncs1001-cosm-1.0.0.0-r253131I -
(Optional) Use the appmgr process-script stop command to stop the process script.
This command stops the execution of the process script xr_script_scheduler.Example:
RP/0/RP0/CPU0:ios#appmgr process-script stop name xr_script_scheduler Wed Oct 22 09:46:35.110 UTC(Optional) Verify the status of the process script after stopping it. This example shows the process script xr_script_scheduler is Activated and Stopped.
RP/0/RP0/CPU0:ios#show appmgr process-script-table Wed Oct 22 09:46:41.245 UT Name Executable Activated Status Restart Policy Config Pending -------------------- -------------------- ----------- --------- ---------------- ---------------- xr_script_scheduler xr_script_scheduler.py Yes Stopped Always No