Troubleshooting the Endpoints of Services
Junos OS operation (op) scripts automate network and device management and troubleshooting. Op scripts can perform any function available through the remote procedure calls (RPCs) supported by either the Junos XML management protocol or the Junos Extensible Markup Language (XML) API. Op scripts can be executed manually in the CLI or upon user login, or they can be called from another script. They are executed by the Junos OS management (mgd) process.
Op scripts enable you to do the following things:
Create custom operational mode commands
Execute a series of operational mode commands
Customize the output of operational mode commands
Shorten troubleshooting time by gathering operational information and iteratively narrowing down the cause of a network problem
Perform controlled configuration changes
Monitor the overall status of a device by creating a general operation script that periodically checks network warning parameters, such as high CPU usage.
Op scripts are based on the Junos XML management protocol, and the Junos XML API. Op scripts can be written in either the Extensible Stylesheet Language Transformations (XSLT) or Stylesheet Language Alternative Syntax (SLAX) scripting language. Op scripts use XPath to locate the operational objects to be inspected and XSLT constructs to specify the actions to perform on the located operational objects. The actions can change the output or execute additional commands based on the output.
The troubleshooting feature provides an easy and unique way to troubleshoot the services. You do not have to manually login to a device to check the status of services in the Connectivity Services Director application, but you can do the same using the functionality of operational scripts. You do have the flexibility of writing your own scripts to view the results.
Only Juniper Networks devices are supported by this functionality and this is not applicable to the third-party devices.
The operational scripts can either be created or imported to the platform from the local machine before you start troubleshooting the services or you can run the scripts that are of local type directly from the Functional Audit Result window by clicking the Troubleshoot button. For op scripts that are not of local type, the op scripts must be imported and staged on to the device using the Junos Space Network Management Platform application before you can run the scripts from within the Connectivity Services Director application for debugging and diagnosing the service endpoints or devices. Currently, you cannot directly add the scripts to the Connectivity Services Director GUI interface. Scripts with execution type as “Local” (@isLocal=true annotation in the SLAX script) are also listed in troubleshooting window. The listing is sorted and filtered based on the context specified for each service.
We recommend that you configure a script as a local script for effective and optimal debugging and analysis of the configuration settings contained in the script. The main advantage of a local script is that you need not download the script to a device (because a connection is established with the device by the GUI application and the script is run) and you need not remove the script from a device after you decommision a service.
The following table lists the context in which the OP scripts are written for different types of services:
Service Type |
Context |
---|---|
E-Line LDP |
@CONTEXT = "/device/configuration/protocols/l2circuit/neighbor/interface" Example : /device[name=”deviceName”]/configuration/protocols/l2circuit/neighbor[name=”neighbor IP”]/interface[name=”interfaceName.unitID”] |
IP |
/*@CONTEXT = "/device/configuration/routing-instances/instance/vrf/interface" */ Example : /device[name=”device name”]/configuration/routing-instances/instance[name=”Service name”]/instance-type[instance-type=”vrf”]/interface[name=”interfaceName.unitID”] |
E-LAN |
/* @CONTEXT = "/device/configuration/routing-instances/instance/vpls/interface" */ Example : /device[name=”device name”]/configuration/ routing-instances/instance[name=”Service name”]/instance-type[instance-type=”vpls”]/interface[name=”interfaceName.unitID”] |
E-Line (Local switching) |
/* @CONTEXT = "/device/configuration/protocols/l2circuit/local-switching/interface/end-interface" */ Example /device[name="MX80-1"]/configuration/protocols/l2circuit/local-switching/interface[name="ge-1/0/0.1801"]/end-interface[interface="ge-1/2/2.1881"] |
E-Line BGP |
/* @CONTEXT = “/device/configuration/routing-instances/instance/bgp/interface” */ Example : /device[name=”device name”]/configuration/routing-instances/instance[name=”Service name”]/instance-type[instance-type=”bgp”]/interface[name=”interfaceName.unitID”] |
Common context for all services |
/* @CONTEXT = “/device/configuration/interface/” */ Example: /device[name=”device name”]/configuration/ interface[name=”interfaceName.unitID”] Example commands: |
When you select a single service and from the Network Services > Connectivity task pane, select Audit Results > Functional Audit to schedule and perform a functional audit operation, the Functional Audit Results window is displayed after the operation of the selected service is validated. If you have previously run a functional audit already run, the result of the previous audit is displayed. To perform a troubleshooting of the selected service, you must click the Troubleshoot button. The troubleshooting task runs as a separate event in Connectivity Services Director, whereas troubleshooting was performed together with functional audit in the Services Activation Director GUI.
Troubleshooting Services Using Operational Scripts
The operational scripts or the OP scripts are written to view the statistics of a service in the Connectivity Services Director application. All the commands in the OP scripts are user-defined. To view the contexts for writing OP scripts for different service types, refer Table 1.
To execute the OP scripts and view the status of any service:
From the Network Management Platform task pane, select Images and Scripts > Scripts.
The Scripts page that appears displays a list of the existing scripts.
From the list of the scripts available in the SLAX format, right-click a script and click Stage Scripts on Devices to push the script onto a device.
The Stage Scripts on Device(s) page that appears displays a list of the devices associated with the script that you selected.
Select the Select Device Manually option and select any number of devices to which you want to push the script.
Note:The Enable Scripts on Devices check box is selected by default.
Click Stage to stage the script on all the devices that you selected.
The Stage Scripts Information dialog box confirms the successful staging of scripts onto the selected devices along with the Job ID.
Click Job ID to view the status of the job on the Job Management page.
You are redirected to the Scripts page.
From the View selector, select Service View. The workspaces that are applicable to routing and tunnel services are displayed.
Click the Build icon in the Service View of the Connectivity Services Director banner. The functionalities that you can configure in this mode are displayed in the task pane.
in the Network Services > Connectivity view pane, select Audit Results > Functional Audit. Alternatively, you can select a service order, click the Audit button at the top of the table of listed service orders from the Manage Network Services page and select Run Functional Audit.
In the Schedule Functional Audit dialog box, select Audit Now, then click OK. After the audit is run, the Functional Audit Results window is displayed.
From the Functional Audit Results window that displays a list of the devices associated with the service you selected, select the check box next to the device for which you want to diagnose and examine the associated service.
Click Troubleshoot to perform troubleshooting and analysis of the service for which functional audit is performed.
Select the check box next to a service that you want to analyze and monitor for its working and efficiency. The Execute OP Scripts page is displayed.
Select an OP script on the Execute OP Scripts page.
Click the Value column to enter any additional parameter for the selected OP script, besides the ones coded in the script.
Note:The selection of parameters is entirely dependent on the OP scripts. If the OP scripts support parameters, then all the parameters are listed and you need to enter the values. Parameters can be optional, on the basis of the OP scripts.
Click Execute to execute the selected OP scripts with the newly added parameters, if any.
A dialog box confirms the execution of the OP scripts along with the Job ID.
Click OK.
You are redirected to the Execute OP Scripts page.
Click View Last Result to view the previous OP scripts execution results.
The Execute OP Scripts Job Status dialog box is displayed with the results of the troubleshooting operation.
Note:This is an optional step.
Troubleshooting E-Line Services
From the Execute OP Scripts Job Status dialog box, you can check status of the interfaces, LDP sessions, neighbor links, and endpoints of an E-Line service. To select the status you want to check, click on the device from the device list on the left, and select the show command from the Command list. This figure shows the routing table for the selected device in the E-Line service.
Troubleshooting E-LAN Services
From the Execute OP Scripts Job Status dialog box, you can check status of the interfaces, LDP sessions, neighbor links, connection instances, and endpoints of an E-LAN service. To select the status you want to check, click on the device from the device list on the left, and select the show command from the Command list.
Troubleshooting IP Services
From the Execute OP Scripts Job Status dialog box, you can check status of the interfaces, LDP sessions, neighbor links, and endpoints of an IP service. To select the status you want to check, click on the device from the device list on the left, and select the show command from the Command list.