Configurable NETCONF Proxy for Junos Telemetry Interface

 

The Junos Telemetry Interface provides the capability to stream statistics for various defined attributes at a high scale. For a definition of these attributes, see Guidelines for gRPC Sensors (Junos Telemetry Interface). Additionally, you can stream the result of NETCONF requests executed locally on the system at a lower scale by using configurable XML proxy. The NETCONF XML management protocol and Junos XML API fully document all options for every supported Junos OS operational request. This feature provides access to thousands of attributes available through NETCONF “get” remote procedure calls (RPCs). For more information about using these RPCs, see Sending Requests to the NETCONF Server.

Starting with Junos OS Release 17.3R1 on MX Series and PTX Series routers, you can add configurable, user-defined YANG files. YANG is a standards-based, extensible, hierarchical data modeling language that is used to model the configuration and state data used by NETCONF operations, RPCs, and server event notifications

Best Practice

Juniper Networks recommends that you not use YANG files that map to a extensive or verbose Junos OS operational commands, such as show interfaces or show route. The use of such a file could result in very slow or no streaming of telemetry data or very high CPU usage for various processes.

Creating a User-Defined YANG File

To use the xmlproxyd process, also known as daemon, to translate telemetry data, create a render.yang file where the dr:command-app is set to xmlproxyd.

Note

The filename and module name included in the file must start with xmlproxyd_

  • For the filename, add the extension .yang, for example, xmlproxyd_ldpstats.yang

  • For the module name, use the filename without the extension .yang, for example, xmlproxyd_ldpstats

Custom YANG files for Junos OS conform to the YANG file syntax defined in RFC 6020, YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF). Certain directives need to be present in the file that configure NETCONF proxy.

  1. Provide a name for the module. It must start with xmlproxy_

    For example, for a YANG File for Packet Forwarding Engine traffic statistics:

    module xmlproxy_pfestatistics_oc {
    . . .

  2. Include the dame of the process, also known as the daemon, that provides the operational state. For the Junos Telemetry Interface, you must always use xmlproxyd:

    dr:command-app "xmlproxyd";

  3. Specify the RPC for the NETCONF get request:

    rpc juniper-netconf-get {

  4. Specify the location of the output of the RPC:

    dr:command-top-of-output "/junos";

  5. Specify the command to execute the RPC:

    dr:command-full-name "drend juniper-netconf-get";

  6. Specify the CLI command to execute for retrieving data.

    For example, to retrieve Packet Forwarding Engine traffic statistics:

    dr:cli-command "show pfe statistics traffic";

  7. Specify help for an RPC:

    dr: command-help “default <get> rpc”;

  8. Specify the OpenConfig hierarchy and use the dr:source command to map to a container, a list, or a specific leaf.

    For example, specify Packet Forwarding Engine statistics, including input packets and output packets:

  9. The following example shows how to include these commands in a YANG file to enable the xmlproxyd process to retrieve the full operational state and render it in the OpenConfig format:

Example: Kernel Routing Table (KRT) Statistics

This example shows a YANG file created to stream KRT statistics.

Installing a User-Defined YANG File

To add, validate, modify, or delete a user-defined YANG file for XML Proxy for the Junos Telemetry Interface, use the request system yang set of commands from the operational mode:

  1. Specify the name of the YANG file and the file path to install. This command creates .json file in the opt/lib/render directory.
    Note

    This command can be performed only on the current Routing Engine.

    To add multiple YANG modules with the request system yang add package package-name proxy-xml module command, enclose the file-path-names in brackets: [ file-path-name 1 file-path-name 2 ]

  2. (Optional) Validate a YANG package you have added.
  3. (Optional) Update an existing YANG file that was previously added.
  4. Delete an existing YANG file.
  5. Verify that the YANG file has been installed by entering the show system yang package command.
Release History Table
Release
Description
Starting with Junos OS Release 17.3R1 on MX Series and PTX Series routers, you can add configurable, user-defined YANG files.