Establish a Dial-in Telemetry Connection
This topic describes the procedure to establish a dial-in telemetry connection. Configure the gRPC service and data collector, and select sensor paths based on the sensor information you want to collect from the Junos device.
In dial-in mode, the data collector initiates the connection to the network device and subscribes to telemetry data. A session is established between the collector and the device, and then data is streamed from the device to the collector (streaming intervals can be configured). This method is preferred by operators who want a single configuration and operational data channel.
Prerequisites:
- Ensure the Juniper device runs a compatible Junos OS version that supports JTI.
- Set up a gRPC-compatible telemetry collector (for example, Juniper Telemetry Collector, Prometheus, or InfluxDB) to receive and process telemetry data.
- Ensure the Juniper device and collector can communicate over the network (TCP port 50051 for gRPC (default), or a custom port).
- If your implementation uses TLS, prepare certificates for the device and collector.
- For a complete list of sensors supported for your Juniper device, see Junos YANG
Data Model Explorer.
- Note: The Junos YANG Data Model Explorer was introduced in the 23.2R2-S2 releases. From releases 20.2R1 up to 23.1R1, the sensor information is available in the Junos Telemetry Sensor Explorer.
Configure gRPC services, see Configure gRPC Services.
Follow the procedures listed below to establish a dial-in telemetry connection:
Configure the Data Collector
Selecting Sensor Paths
Sensor Explorer and Guidelines for Selecting Sensor Paths
Use the Juniper Networks Junos YANG Data Model Explorer to view all the supported resource paths, their corresponding leaves, and the device platforms that support them.
To search and view other telemetry sensors and specific information about some legacy sensors, see Legacy Sensor Paths.
For information on guidelines and best practices for configuring sensor paths, see Explore Sensor Paths.
Decoding Data on the Collector
Decode 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:
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.
nc -ul 0.0.0.0 20000 > data.gpb
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
)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.protoc --decode_raw < ../data.gpb 1: "hillrock:160.1.1.25" 2: 0 4: "S1:/junos/system/linecard/interface/logical/usage/:/junos/system/linecard/interface/logical/usage/:PFE" 5: 65265 6: 1477686534474 7: 1 8: 1 101 { 2636 { 7 { 1 { 1: "et-0/0/4:2.32767" 2: 1477642750 3: 813 4 { 12: 0x37363732332e3165 } . . .
The next nested structure under
2636
identifies the sensor type. The numerical value2636
identifies theJuniperNetworksSensor
message, which is defined in thetelemetry_top.proto
file. In this example, the numerical identifier7
corresponds to theLogicalPort
message defined in thelogical_port.proto
file. Use this information in the next step to generate more detailed output.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.protoc --decode TelemetryStream logical_port.proto -I /usr/include -I . < data.gpb system_id: "hillrock:160.1.1.25" component_id: 0 sensor_name: "S1:/junos/system/linecard/interface/logical/usage/:/junos/system/linecard/interface/logical/usage/:PFE" sequence_number: 65268 timestamp: 1477686536484 version_major: 1 version_minor: 1 enterprise { [juniperNetworks] { [jnprLogicalInterfaceExt] { interface_info { if_name: "et-0/0/4:2.32767" init_time: 1477642750 snmp_if_index: 813 parent_ae_name: "ae1.32767" ingress_stats { if_packets: 0 if_octets: 0 } egress_stats { if_packets: 0 if_octets: 0 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/7:3.0" init_time: 1477642750 snmp_if_index: 520 parent_ae_name: "ae0.0" ingress_stats { if_packets: 61203309 if_octets: 6487548454 } egress_stats { if_packets: 87416547 if_octets: 9266153982 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.0" init_time: 1477642750 snmp_if_index: 2512 ingress_stats { if_packets: 26266247 if_octets: 2784214806 } egress_stats { if_packets: 26247215 if_octets: 2781829290 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.1" init_time: 1477642750 snmp_if_index: 2522 ingress_stats { if_packets: 26266249 if_octets: 2784214972 } egress_stats { if_packets: 26249115 if_octets: 2781935590 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.2" init_time: 1477642750 snmp_if_index: 2523 ingress_stats { if_packets: 26266248 if_octets: 2784214912 } egress_stats { if_packets: 26249106 if_octets: 2781935086 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.3" init_time: 1477642750 snmp_if_index: 2524 ingress_stats { if_packets: 26266248 if_octets: 2784214820 } egress_stats { if_packets: 26248520 if_octets: 2781902320 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.4" init_time: 1477642750 snmp_if_index: 2525 ingress_stats { if_packets: 26266247 if_octets: 2784214760 } egress_stats { if_packets: 26247302 if_octets: 2781834112 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.5" init_time: 1477642750 snmp_if_index: 2526 ingress_stats { if_packets: 26266247 if_octets: 2784214760 } egress_stats { if_packets: 26247209 if_octets: 2781828904 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.6" init_time: 1477642750 snmp_if_index: 2527 ingress_stats { if_packets: 26266248 if_octets: 2784214820 } egress_stats { if_packets: 26247196 if_octets: 2781828226 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.7" init_time: 1477642750 snmp_if_index: 2528 ingress_stats { if_packets: 26266247 if_octets: 2784214760 } egress_stats { if_packets: 26247203 if_octets: 2781828618 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.8" init_time: 1477642750 snmp_if_index: 2529 ingress_stats { if_packets: 26266247 if_octets: 2784214760 } egress_stats { if_packets: 26247225 if_octets: 2781829850 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.9" init_time: 1477642750 snmp_if_index: 2530 ingress_stats { if_packets: 26266247 if_octets: 2784214760 } egress_stats { if_packets: 26247209 if_octets: 2781828954 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.32767" init_time: 1477642750 snmp_if_index: 648 ingress_stats { if_packets: 4 if_octets: 240 } egress_stats { if_packets: 0 if_octets: 0 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/4:2.32767" init_time: 1477642750 snmp_if_index: 813 parent_ae_name: "ae1.32767" ingress_stats { if_packets: 0 if_octets: 0 } egress_stats { if_packets: 0 if_octets: 0 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/7:3.0" init_time: 1477642750 snmp_if_index: 520 parent_ae_name: "ae0.0" ingress_stats { if_packets: 61206122 if_octets: 6487846632 } egress_stats { if_packets: 87420567 if_octets: 9266580102 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.0" init_time: 1477642750 snmp_if_index: 2512 ingress_stats { if_packets: 26267458 if_octets: 2784343172 } egress_stats { if_packets: 26248420 if_octets: 2781957020 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.1" init_time: 1477642750 snmp_if_index: 2522 ingress_stats { if_packets: 26267460 if_octets: 2784343338 } egress_stats { if_packets: 26250320 if_octets: 2782063320 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.2" init_time: 1477642750 snmp_if_index: 2523 ingress_stats { if_packets: 26267459 if_octets: 2784343278 } egress_stats { if_packets: 26250311 if_octets: 2782062816 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.3" init_time: 1477642750 snmp_if_index: 2524 ingress_stats { if_packets: 26267460 if_octets: 2784343292 } egress_stats { if_packets: 26249725 if_octets: 2782030050 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.4" init_time: 1477642750 snmp_if_index: 2525 ingress_stats { if_packets: 26267459 if_octets: 2784343232 } egress_stats { if_packets: 26248507 if_octets: 2781961842 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.5" init_time: 1477642750 snmp_if_index: 2526 ingress_stats { if_packets: 26267459 if_octets: 2784343232 } egress_stats { if_packets: 26248414 if_octets: 2781956634 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.6" init_time: 1477642750 snmp_if_index: 2527 ingress_stats { if_packets: 26267460 if_octets: 2784343292 } egress_stats { if_packets: 26248401 if_octets: 2781955956 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.7" init_time: 1477642750 snmp_if_index: 2528 ingress_stats { if_packets: 26267459 if_octets: 2784343232 } egress_stats { if_packets: 26248408 if_octets: 2781956348 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.8" init_time: 1477642750 snmp_if_index: 2529 ingress_stats { if_packets: 26267459 if_octets: 2784343232 } egress_stats { if_packets: 26248430 if_octets: 2781957580 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.9" init_time: 1477642750 snmp_if_index: 2530 ingress_stats { if_packets: 26267459 if_octets: 2784343232 } egress_stats { if_packets: 26248414 if_octets: 2781956684 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.32767" init_time: 1477642750 snmp_if_index: 648 ingress_stats { if_packets: 4 if_octets: 240 } egress_stats { if_packets: 0 if_octets: 0 } op_state { operational_status: "up" } } } } }