Configuration

In this example, streaming telemetry with OcNOS is demonstrated, using 'gnmic' as the gNMI Client.

To install the gnmic tool for managing network devices using gNMI, refer to the gnmic Installation

Figure 7. Dial-In Streaming Telemetry Topology

Before configuring Dial-In, meet all Prerequisites.

Enable streaming telemetry in a default VRFClosed Virtual Routing and Forwarding on OcNOS:

Copy
OcNOS#configure terminal
OcNOS(config)#feature streaming-telemetry
OcNOS(feature-telemetry-config)#commit
OcNOS(feature-telemetry-config)#exit

Telemetry Subscription Request via gnmic Command and YAML Input

Use the gnmic command with a YAML file input to request telemetry subscriptions with multiple paths.

Copy
gnmic -a <ipaddress:port> -u <UserName> -p <Password> --insecure  --config <path to config file> subscribe

This command establishes a telemetry subscription with the specified paths defined in the YAML file.

Telemetry Subscription Request via gnmic Command with a Single Path Option

Use the gnmic command with a single path option to request a telemetry subscription for a specific data path.

Copy
gnmic -a  <ipaddress:port> -u <UserName> -p <Password> --encoding [json, json_ietf] --insecure --mode STREAM --stream-mode sample --sample-interval sample-interval-value sub --path <path>
Copy
gnmic -a  <ipaddress:port> -u <UserName> -p <Password> --encoding [json, json_ietf] --insecure --mode [POLL, ONCE] sub --path <path>
Copy
gnmic -a <ipaddress:port> -u <UserName> -p <Password> --encoding proto --insecure --mode STREAM --stream-mode sample --sample-interval sample-interval-value sub --path <path> --proto-file IPI_OC.proto

This command creates a telemetry subscription for the specified path with the chosen sample interval and encoding format.

Supported gnmic Options

The following table explains the option fields.

Table 11. gnmic Option Details

Option

Description

--encoding

Specifies the encoding format as either json, proto, or json_ietf. The default encoding format is json.

--mode

Sets the mode of operation (STREAM, POLL, and ONCE).

--insecure

Allows insecure connections.

--stream-mode

Sets the stream mode (Sample).

--sample-interval

Sets the sample interval (10s).

Note: Interval should be 10s or more.

--config

Specifies the YAML configuration file path (Example: input_path.yaml).

--path

Sets the path to subscribe to specific data (Example:‘ipi:/interfaces/interface[name]/state’).

Note: For multiple paths specify each path with --path option.

--prefix

Defines a common prefix for all specified paths (Example:‘ipi:/interfaces’).

--proto-file

Path to Proto file (Example: IPI_OC.proto).