The demand for data regarding network state, whether to detect hotspots in the network or to aid decision-making on workload placement, requires data at a pace that traditional methods just cannot deliver. SNMP, CLI, and syslog have limitations that restrict automation and scale.
SNMP polling can often be on the order of 5–10 minutes; CLIs are unstructured and prone to change, which can often break scripts, as shown in Figure 6-11.
Figure 6-11 Traditional Management System Using SNMP, Syslog, and CLI
The traditional use of the pull model, where the client requests data from the network, does not scale when what you want is near real-time data.
Cisco NX-OS streaming telemetry allows you to push data off the device to a defined endpoint as JavaScript Object Notation (JSON) or using Google Protocol Buffers (GPB) at a much higher frequency and more efficiently, as shown in Figure 6-12.
Figure 6-12 Management System with Streaming Telemetry
Three simple steps are all that is required to configure telemetry:
Step 1. Set the format and destination to which the data is to be sent.
Step 2. Configure the data that is to be collected as part of the sensor group.
Step 3. Set the subscription between the sensor-group and the destination, along with the pace at which to send the data (in millseconds).
This data collected can be sent to the collector of your choice, be it an in-house tool, a commercial application such as Splunk, or a Cisco-provided solution such as the Data Center Network Manager (DCNM).
To help aid in the adoption and understanding of the capabilities of telemetry, Cisco provided a sample collector, which is available on Docker Hub. This receiver can take GPB data streamed from the network, parse it into JSON, which can then be forwarded to the database of your choice.
With this telemetry data, you can see network state and changes in near real time, allowing easier and more timely visibility into your network, as shown in Figure 6-13.
Figure 6-13 Health Monitor Using Streaming Telemetry
Using a combination of open-source tools and well-understood industry formats, you can begin your journey with telemetry data on Cisco NX-OS.
Example 6-20 shows a cadence-based collection of show command data every 750 seconds to monitor system health.
Example 6-20 NX-OS Telemetry Configuration Example
switch(config)# telemetry
switch(config-telemetry)# destination-group 1
switch(conf-tm-dest)# ip address 172.27.247.72 port 60001 protocol gRPC
encoding GPB
switch(conf-tm-dest)# sensor-group 1
switch(conf-tm-sensor)# data-source NX-API
switch(conf-tm-sensor)# path “show system resources”
switch(conf-tm-sensor)# path “show version”
switch(conf-tm-sensor)# path “show environment power”
switch(conf-tm-sensor)# path “show environment fan”
switch(conf-tm-sensor)# path “show environment temperature”
switch(conf-tm-sensor)# path “show processes cpu”
switch(conf-tm-sensor)# path “show policy-map vlan”
switch(conf-tm-sensor)# path “show ip access-list test”
switch(conf-tm-sensor)# subscription 1
switch(conf-tm-sub)# dst-grp 1
switch(conf-tm-dest)# snsr-grp 1 sample-interval 750000
For security, SSL/TLS certificates can be used to encrypt all the data exchanged between the client and the server. Optional mechanisms are available for clients to provide certificates for mutual authentication.
A sample configuration, with encryption enabled, is shown in Example 6-21.
Example 6-21 NX-OS Telemetry with Encryption Configuration Example
!—This example creates a subscription that streams data every 5 seconds to
destination IP 1.2.3.4 port 50003, and encrypts the stream using GPB encoding
verified using the test.pem.
switch(config)# telemetry
switch(config-telemetry)# certificate /bootflash/test.pem foo.test.google.fr
switch(conf-tm-telemetry)# destination-group 100
switch(conf-tm-dest)# ip address 1.2.3.4 port 50003 protocol gRPC encoding GPB
switch(config-dest)# sensor-group 100
switch(conf-tm-sensor)# path <show command>
switch(conf-tm-sensor)# subscription 100
switch(conf-tm-sub)# snsr-grp 100 sample-interval 5000
switch(conf-tm-sub)# dst-grp 100
Example 6-22 shows telemetry data collector details.
Example 6-22 NX-OS Telemetry Status switch# show telemetry data collector details
——————————————————————————–
Succ Collections Failed Collections Sensor Path
——————————————————————————–
150 0 <path>
! This command displays the statistic for the telemetry pipeline.
switch# show telemetry pipeline stats
Main Statistics:
Timers:
Errors:
Start Fail = 0
Data Collector:
Errors:
Node Create Fail = 0
Event Collector:
Errors:
Node Create Fail = 0 Node Add Fail = 0
Invalid Data = 0
Queue Statistics:
Request Queue:
High Priority Queue:
Info:
Actual Size = 50 Current Size = 0
Max Size = 0 Full Count = 0
Errors:
Enqueue Error = 0 Dequeue Error = 0
Low Priority Queue:
Info:
Actual Size = 50 Current Size = 0
Max Size = 0 Full Count = 0
Errors:
Enqueue Error = 0 Dequeue Error = 0
Data Queue:
High Priority Queue:
Info:
Actual Size = 50 Current Size = 0
Max Size = 0 Full Count = 0
Errors:
Enqueue Error = 0 Dequeue Error = 0
Low Priority Queue:
Info:
Actual Size = 50 Current Size = 0
Max Size = 0 Full Count = 0
Errors:
Enqueue Error = 0 Dequeue Error = 0
! This command displays all configured transport sessions.
switch# show telemetry transport
Session Id IP Address Port Encoding Transport Status
————————————————————————–
———
0 192.168.20.123 50001 GPB gRPC Conne