Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

gNMI Genstate Subscription

A gNMI Genstate subscription utilizes the gNMI protocol to retrieve state data from a network device, specifically focusing on data exposed through Genstate YANG data models. This allows you to monitor the operational state of the device, similar to data presented in CLI "show" commands, but through a streaming mechanism.

The Genstate model allows you to access operational state information in a structured, machine-readable format. The network device, acting as a gNMI server, sends telemetry data corresponding to the subscribed paths. This data can be used for monitoring, alerting, and other applications.

gNMI clients in gRPC dial-in environments can subscribe to a Genstate resource path and STREAM statistics in SAMPLE sub mode to a collector for telemetry data.

Note:

ON_CHANGE sub mode is not supported. For more information, see Guidelines for Telemetry Data Subscriptions over gNMI.

Use the following steps to set up gNMI Genstate subscription:

  1. View or download the models from the Juniper/yang GitHub repository or Juniper Networks.

  2. Obtain and load the gRPC server's certificate.

  3. Enable your network device for gRPC services.

  4. Specify the local certificate used for server authentication.

Note:

For Genstate subscription step details, see Configure gRPC Services.

The subscription example that follows uses a target device configured for mutual authentication using X.509 certificates. The subscription request supplies the root CA certificate required to verify the target device's local certificate, and it also provides the client's key and certificate so that the target device can authenticate the client. The subscription uses STREAM mode and submode SAMPLE and requests data for the resource path genstate:/genstate/system-information/os-version. The telemetry data returned to the collector shows that the target device is operating with Junos OS version 24.2R1.12-EVO.

Note:

Junos OS supports several origin schemas including Juniper Native, OpenConfig, and Genstate. The origin is stated in the path before the colon where genstate is the origin in the path genstate:/genstate/system-information/os-version. For more information on origin in path, see gNMI Service.

The subscription example that follows again uses a target device configured for mutual authentication using X.509 certificates. The subscription uses STREAM mode and submode SAMPLE and requests data for the resource path genstate:/genstate/interface-information/physical-interface[name=et-1/0/1]/admin-status. The admin-status (administrative status) indicates whether the interface is enabled (up) or disabled (down). The telemetry data returned to the collector shows that physical interface et-1/0/1 is up.

Change History Table

Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.

Release
Description
15.1F3
Junos OS Evolved Release 24.2R1, Juniper Networks publishes the genstate YANG data models. The genstate models are subscribable YANG models for operational state data on Junos devices. gNMI clients can subscribe to resource paths defined in the models to retrieve specific state data.