Introduction
This page provides information on configuring telemetry on the router and the client for streaming and storing raw logs on an external linux machine.
Pre-requisites
- Telemetry client is installed on Ubuntu linux VM. You can use the following Ubuntu OVA image, which already has the telemetry client applications installed.
Note: The Cisco CLVS service by default provides Cisco Enterprise Linux. The telemetry client applications are tested only on Ubuntu. While requesting custom (Ubuntu) OS installation from the CLVS team, they require a linux machine image (OVA) file built from hypervisors like VMware Fusion. At the time of writing, the CLVS hypervisors could only load OVA files up to version vmx-11. Therefore, if you are building an OVA image you may want to set the supported hypervisor version vmx-11 or lower in the compatibiity-settings of your hypervisor. - The router Mgmt interface is configured with an external IP through which it can reach the Ubuntu linux VM.
XR configuration
telemetry model-driven
destination-group telem_client
! Provide IP address and port on the machine where the collector is listening.
address-family ipv4 10.65.44.195 port 57000
encoding self-describing-gpb
protocol tcp
!
!
sensor-group my-servo
sensor-path Cisco-IOS-XR-gnss-oper:gnss-receiver/nodes
sensor-path Cisco-IOS-XR-ptp-oper:ptp/ptp-pd-oper:platform/servo
sensor-path Cisco-IOS-XR-ptp-oper:ptp/ptp-pd-oper:platform/apr-log
sensor-path Cisco-IOS-XR-ptp-oper:ptp/ptp-pd-oper:platform/servo-statistics
!
subscription servo-sub
sensor-group-id my-servo sample-interval 5000
destination-id telem_client
source-interface MgmtEth0/RP0/CPU0/0
!
!
! Enable streaming of APR logs
ptp
log
servo driver
!
!
Pipeline collector
pipeline-gnmi as a collector for the telemetry client.
Installation
git clone https://github.com/cisco-ie/pipeline-gnmi.git
cd pipeline-gnmi
make build
Configuration
Pipeline uses two configuration files:
- pipeline_cisco.conf
- metrics_cisco.json
pipeline_cisco.conf
[cisco-input]
stage = xport_input
type = tcp
encap = st
listen = : 57000 # Should be same as the port number configured in XR configuration
[mymetrics]
stage = xport_output
type = metrics
file = metrics_cisco.json # Attached to this page
datachanneldepth = 1000
output = influx
influx = http://localhost:8086
database = ptp_db # Influx database name used by pipeline for storing the received data
workers = 10
Running pipeline
<pipeline-gnmi directory>/bin/pipeline_linux_amd64 --config pipeline_cisco.conf
Database - Influx
Installation
wget https://dl.influxdata.com/influxdb/releases/influxdb_1.8.6_amd64.deb
sudo dpkg -i influxdb_1.8.6_amd64.deb
sudo service influxdb start
Configuration
influx # Enter influx database shell
# Create database which wraps around data after 8 hours
create database ptp_db with duration 8h # Use same database name as specified in pipeline_cisco.conf file
Other useful commands
influx # Enter influx database shell
show databases # List databases
use ptp_db # Enter into a database
# List tables in the database
show measurements
Cisco-IOS-XR-gnss-oper:gnss-receiver/nodes/node/receivers/receiver
Cisco-IOS-XR-ptp-oper:ptp/Cisco-IOS-XR-ptp-pd-oper:platform/apr-log
Cisco-IOS-XR-ptp-oper:ptp/Cisco-IOS-XR-ptp-pd-oper:platform/servo
Cisco-IOS-XR-ptp-oper:ptp/Cisco-IOS-XR-ptp-pd-oper:platform/servo-statistics
# Show columns in a table
show field keys from "Cisco-IOS-XR-ptp-oper:ptp/Cisco-IOS-XR-ptp-pd-oper:platform/servo"
fieldKey fieldType
-------- ---------
lock-status integer
mean-path-delay integer
offset-from-master integer
phase-accuracy-last integer
servo-mode integer
#Retrieve data from the table
select "lock-status","offset-from-master" from "Cisco-IOS-XR-ptp-oper:ptp/Cisco-IOS-XR-ptp-pd-oper:platform/servo" order by desc limit 5
name: Cisco-IOS-XR-ptp-oper:ptp/Cisco-IOS-XR-ptp-pd-oper:platform/servo
time lock-status offset-from-master
---- ----------- ------------------
1626669329152000000 2 2
1626669324152000000 2 2
1626669319153000000 2 2
1626669314152000000 2 2
1626669309152000000 2 2
Grafana
Installation
sudo apt-get install -y adduser libfontconfig1
wget https://dl.grafana.com/oss/release/grafana_8.0.5_amd64.deb
sudo dpkg -i grafana_8.0.5_amd64.deb
sudo /bin/systemctl start grafana-server
Launching grafana
Point the web-browser to http://<Ubuntu-VM-IP>:3000
References
Influx query language documentation: https://docs.influxdata.com/influxdb/v1.8/query_language/