Skip to main content

Telemetry simple configuration in Cisco XR devices

·3 mins
Rs Telemetry
Table of Contents
telemetry - This article is part of a series.
Part 1: This Article

Telemetry 是一种类似 SNMP 技术的 feature,用于远程采集网络设备上相关信息。与 SNMP 不同的是,SNMP 是 Pull Mode,需要 server 端主动的要求 Get 某些信息,而 Telemetry 则是一种 Push Mode,可以周期性、主动的 push 相关信息到 server 上。SNMP 是秒级的数据采集, 而 Telemetry 可以实现毫秒级的数据采集.

如何获得相应的 sensor-path
#

与 SNMP 的 OID 类似,sensor-path 代表着你想要的获得哪些信息,在 XR 设备上我们可以使用如下命令去判断我们需要获得的信息是哪一类,即获得关键字;然后到 yang 文件夹过滤相关关键字:

RP/0/RSP1/CPU0:9910-B#schema-describe show segment-routing traffic-eng forwarding policy name test-policy detail
Fri Dec 27 01:57:38.336 UTC
Action: get
Path:   RootOper.XTC.PolicyForwarding   <<< XTC

RP/0/RSP1/CPU0:9910-B#run
Fri Dec 27 01:57:42.449 UTC
[xr-vm_node0_RSP1_CPU0:~]$cd /pkg/yang/
[xr-vm_node0_RSP1_CPU0:/pkg/yang]$ls | grep xtc      <<<cfg代表配置相关,oper与show command相关
Cisco-IOS-XR-infra-xtc-agent-cfg.yang
Cisco-IOS-XR-infra-xtc-agent-oper-sub1.yang
Cisco-IOS-XR-infra-xtc-agent-oper-sub2.yang
Cisco-IOS-XR-infra-xtc-agent-oper.yang
Cisco-IOS-XR-infra-xtc-cfg.yang
Cisco-IOS-XR-infra-xtc-oper-sub1.yang
Cisco-IOS-XR-infra-xtc-oper.yang

//有用的文件:
RP/0/RP0/CPU0:XTC#run
Tue Jan 22 06:58:56.512 UTC
[xr-vm_node0_RP0_CPU0:~]$cd /pkg/telemetry/mdt/protogen
[xr-vm_node0_RP0_CPU0:/pkg/telemetry/mdt/protogen]$ls
yang_to_schema.txt

接下来就需要自己去 yang 文件中找一些关键词,自己把 sensor path 组合起来.

当然有更好的方法,可以参考我另一篇文章 ANX

XR device configuration
#

RP/0/RSP1/CPU0:9910-B#show run telemetry model-driven
Fri Dec 27 00:50:44.990 UTC
telemetry model-driven
destination-group spr-telemetry
  address-family ipv4 10.75.49.238 port 5432
   encoding self-describing-gpb
   protocol tcp
  !
sensor-group sr-policy-forwarding
  sensor-path Cisco-IOS-XR-infra-xtc-agent-oper:xtc/policy-forwardings/policy-forwarding     <<< 这个路径自己定义,查看相关yang文件补全后面的路径
!
subscription test
  sensor-group-id sr-policy-forwarding strict-timer
  sensor-group-id sr-policy-forwarding sample-interval 5000
  destination-id spr-telemetry
  source-interface MgmtEth0/RSP1/CPU0/0

Use Pipeline get Telemetry info
#

[root@localhost ~]# git clone https://github.com/cisco/bigmuddy-network-telemetry-pipeline.git
[root@localhost ~]# cd bigmuddy-network-telemetry-pipeline/
[root@localhost bigmuddy-network-telemetry-pipeline]# cp pipeline.conf pipeline-stdout.conf
[root@server1 bigmuddy-network-telemetry-pipeline]#   grep -v ^# pipeline-stdout.conf  | grep -v ^$
[default]
id = pipeline
metamonitoring_prometheus_resource = /metrics
metamonitoring_prometheus_server = :8989
[testbed]
stage = xport_input
type = udp
encap = st
listen = :5432    <<<< 定义监听的端口
[inspector]
stage = xport_output
type = tap
file = /opt/xuxing.text    <<< 定义存储的位置
datachanneldepth = 1000
[root@server1 bigmuddy-network-telemetry-pipeline]#
[root@localhost bigmuddy-network-telemetry-pipeline]# ./bin/pipeline -log= -config=pipeline-stdout.conf
INFO[2019-12-26 21:24:58.871798] Conductor says hello, loading config          config=pipeline-stdout.conf debug=false fluentd= logfile= maxthreads=4 tag=pipeline version="v1.0.0(bigmuddy)"
INFO[2019-12-26 21:24:58.872676] Conductor starting up section                 name=conductor section=inspector stage="xport_output" tag=pipeline
INFO[2019-12-26 21:24:58.872739] Conductor starting up section                 name=conductor section=testbed stage="xport_input" tag=pipeline
INFO[2019-12-26 21:24:58.872756] Metamonitoring: serving pipeline metrics to prometheus  name=default resource="/metrics" server=":8989" tag=pipeline
INFO[2019-12-26 21:24:58.873114] TCP server starting                           listen=":5432" name=testbed tag=pipeline
INFO[2019-12-26 21:24:58.873113] Starting up tap                               countonly=false filename="/opt/xuxing.text" name=inspector streamSpec=&{2 <nil>} tag=pipeline
[root@localhost opt]# cat xuxing.text

------- 2019-12-26 19:40:31.267904257 -0500 EST -------
Summary: GPB(common) Message [10.75.49.65:48094(9910-B)/Cisco-IOS-XR-infra-xtc-agent-oper:xtc/policy-forwardings/policy-forwarding msg len: 827]
{
    "Source": "10.75.49.65:48094",
    "Telemetry": {
        "node_id_str": "9910-B",
        "subscription_id_str": "test",
        "encoding_path": "Cisco-IOS-XR-infra-xtc-agent-oper:xtc/policy-forwardings/policy-forwarding",
        "collection_id": 56265,
        "collection_start_time": 1577406835874,
        "msg_timestamp": 1577406835874,
        "collection_end_time": 1577406835886
    },
    "Rows": [
        {
            "Timestamp": 1577406835885,
            "Keys": {
                "name": "srte_c_888_ep_10.1.3.3"
            },
            "Content": {
                "are-stats-valid": "true",
                "binding-sid": {
                    "label": 24005,
                    "sid-type": "mpls"
                },
                "candidate-path-name": "test",
                "color": 888,
                "endpoint-address": {
                    "af-name": "ipv4",
                    "ipv4": "10.1.3.3"
                },
                "forwarding-stats-bytes": 140,
                "forwarding-stats-pkts": 5,
                "is-local-label-valid": "true",
                "local-label": 24004,
                "paths": {
                    "are-stats-valid": "true",
                    "bkup-path-id": 0,
                    "forwarding-stats-bytes": 140,
                    "forwarding-stats-pkts": 5,
                    "is-protected": "false",
                    "is-pure-bkup": "false",
                    "label-stack": 16003,
                    "load-metric": 64,
                    "next-hop-ipv4": "10.1.12.1",
                    "next-hop-table-id": 3758096384,
                    "outgoing-interface": "HundredGigE0/0/0/0",
                    "path-id": 1,
                    "segment-list-name": "test"
                },
                "policy-name": "srte_c_888_ep_10.1.3.3"
            }
        }
    ]
}
RP/0/RSP1/CPU0:9910-B#show segment-routing traffic-eng forwarding policy
Fri Dec 27 00:53:24.082 UTC

SR-TE Policy Forwarding database
--------------------------------

Color: 888, End-point: 10.1.3.3
  Name: srte_c_888_ep_10.1.3.3
  Candidate path name: test
  Binding SID: 24005
  Segment Lists:
    SL[0]:
      Name: test
      Paths:
        Path[0]:
          Outgoing Label: 16003
          Outgoing Interface: HundredGigE0/0/0/0
          Next Hop: 10.1.12.1
          Switched Packets/Bytes: 5/140
          FRR Pure Backup: No
  Policy Packets/Bytes Switched: 5/140

Some command
#

show telemetry model-driven sensor-group
show telemetry model-driven destination
show telemetry model-driven subscription

For a specific sensor-group, destination-group, or subscription.
show telemetry model-driven sensor-group <sensor-group-nme> internal
show telemetry model-driven destination <destination-name>
show telemetry model-driven subscription <subscription-name> internal

For traces or showtech.
show telemetry model-driven trace all (included in show tech telemetry)
show tech-support telemetry model-driven

For gRPC.
show grpc status
show grpc trace all (included in show tech telemetry)
show tech-support grpc

Some sensor path
#

BGPCisco-IOS-XR-ipv4-bgp-oper:bgp/bpm-instances-table/bpm-instances
Cisco-IOS-XR-ipv4-bgp-oper:bgp/instances/instance/instance-active/default-vrf/process-info
Cisco-IOS-XR-ipv4-bgp-oper:bgp/instances/instance/instance-active/default-vrf/neighbors/neighbor/message-statistics
Cisco-IOS-XR-ip-rib-ipv4-oper:rib/vrfs/vrf/afs/af/safs/saf/ip-rib-route-table-names/ip-rib-route-table-name/protocol/bgp/as/information
QosCisco-IOS-XR-qos-ma-oper:qos/nodes/node/policy-map/interface-table/interface/input
Cisco-IOS-XR-qos-ma-oper:qos/nodes/node/policy-map/interface-table/interface/output
CPUCisco-IOS-XR-wdsysmon-fd-oper:system-monitoring/cpu-utilization
MemoryCisco-IOS-XR-nto-misc-oper:memory-summary/nodes/node/summary
SLACisco-IOS-XR-man-ipsla-oper:ipsla/operation-data/operations/operation/statistics/latest/target/specific-stats/icmp-path-jitter-stats
Cisco-IOS-XR-man-ipsla-oper:ipsla/operation-data/operations/operation/statistics/latest/hops/hop/specific-stats/icmp-path-jitter-stats
ISISCisco-IOS-XR-clns-isis-oper:isis/instances/instance/statistics-global
Cisco-IOS-XR-clns-isis-oper:isis/instances/instance/levels/level/adjacencies/adjacency
Cisco-IOS-XR-ip-rib-ipv4-oper:rib/vrfs/vrf/afs/af/safs/saf/ip-rib-route-table-names/ip-rib-route-table-name/protocol/isis/as/information
Cisco-IOS-XR-ip-rib-ipv6-oper:ipv6-rib/vrfs/vrf/afs/af/safs/saf/ip-rib-route-table-names/ip-rib-route-table-name/protocol/isis/as/information
IPv4/IPv6 Interface counterCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/protocols/protocol
OpticalCisco-IOS-XR-controller-optics-oper:optics-oper/optics-ports/optics-port/optics-info
EnvCisco-IOS-XR-sysadmin-envmon-ui:environment/oper/
UptimeCisco-IOS-XR-shellutil-oper:system-time/uptime
interfaceCisco-IOS-XR-pfi-im-cmd-oper:interfaces/interface-summary
Cisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-counters
NCS55xx_NPUCisco-IOS-XR-platforms-ofa-oper:ofa/stats/nodes/node/Cisco-IOS-XR-NCS-BDplatforms-npu-resources-oper:hw-resources-datas
Cisco-IOS-XR-platforms-ofa-oper:ofa/stats/nodes/node/Cisco-IOS-XR-NCS-BDplatforms-npu-resources-oper:stats-resources-datas
interface-date-rateCisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/data-rate
telemetry - This article is part of a series.
Part 1: This Article



Comments