Decoding Junos Telemetry Interface Data With UNIX Utilities

 

You can use UNIX utilities to decode Junos Telemetry Interface data on a server, or collector, that is streaming data from a Juniper Networks device. The example in this section shows you how to decode a single packet of streamed data.

Preparing the Collector to Decode Data

This example requires the following:

  • UNIX OS with the Netcat (nc) utility.

  • Protocol buffers compiler.

  • Junos Telemetry Interface protocol buffers files.

This procedure shows how to prepare the collector to decode data using the Ubuntu OS.

  1. Install the Netcat utility.
  2. Install the protocol buffers compiler.
  3. Install the protocol buffers developer’s library.
  4. Verify that the library files are installed.
  5. Download and install the latest version of the Junos Telemetry interface protocol buffers files.

    From a Web browser, navigate to the All Junos Platforms software download URL on the Juniper Networks page: https://www.juniper.net/support/downloads/. After you select the name of the Junos OS platform and the release number, go to the Tools section and download the Junos Telemetry Interface Data Model Files package.

    Note

    Be sure to note the location of the extracted files.

Decoding Data on the Collector

This procedure shows you how to capture data, decode raw data, and use the protocol buffers files to decode data.

To decode data:

  1. Capture the data.

    Run netcat on a destination streaming telemetry server, or collector, in UDP listener mode to store all incoming datagrams into a file. Use the destination port number configured in streaming-server profile on your Juniper Networks device.

    Note

    This command stores datagrams into a file named data.gpb. Run this program to capture data. When you want to stop receiving data, stop with the program by sending the break signal (Control + C)

  2. Decode raw data.Note

    This step is optional. It is not required if you know the encoded message type of the data.

    Decode the message from the data.gpb file.

    The next nested structure under 2636 identifies the sensor type. The numerical value 2636 identifies the JuniperNetworksSensor message, which is defined in the telemetry_top.proto file. In this example, the numerical identifier 7 corresponds to the LogicalPort message defined in the logical_port.proto file. Use this information in the next step to generate more detailed output.

  3. Decode the message to include field names.

    Run the protocol buffers compiler with the decode option. Additionally, specify the top-level message type (TelemetryStream) and the file with the message definition, logical_port.proto. You must also include the Goggle protocol buffers (gpb) library.