Telemetry Solution Demo with IOS XR

I put a telemetry demo to youtube at last year, but no more time summary… now I summaried in the article, will help you to easy build up the solution. Due to original testbed had changed, so follow some info maybe change, but all procedure should same. And XR configuration file is original. Demo video at this link:

Install Grafana and Influxdb by Docker

docker run -d -v grafana-storage:/var/lib/grafana -p 3000:3000 grafana/grafana:5.4.3
docker run -d --volume=/opt/influxdb:/data -p 8080:8083 -p 8086:8086 tutum/influxdb

Install Pipeline

git clone https://github.com/cisco/bigmuddy-network-telemetry-pipeline.git

Config Pipeline

[root@telemetry bigmuddy-network-telemetry-pipeline]# diff pipeline.conf pipeline-influxdb.conf 
302c302
< file = /data/dump.txt
---
> file = /opt/dump-frank.txt  #put data to file after receive telemetry, for debug 
370a371,383
> 
> [metrics_influx]   #put telemetry to influxdb
> stage = xport_output
> type = metrics
> file = metrics-nms.json   #filter data by metric before sent to influxdb 
> dump = metrics-dump-frank.txt
> output = influx
> influx = http://10.75.37.91:8086
> database = mdt_db

Due to telemetry data is so big, so delet data each hours:

[root@telemetry bigmuddy-network-telemetry-pipeline]# crontab -l
*/60 * * * * root echo "" > /opt/dump-frank.txt
*/60 * * * * root echo "" > /opt/bigmuddy-network-telemetry-pipeline/metrics-dump-frank.txt_wkid0

Open pipeline by Screen, more screen info, can check my last article: Deploy TRex in Centos7.4

[root@telemetry bigmuddy-network-telemetry-pipeline]# ./bin/pipeline -log= -debug -config=pipeline-influxdb.conf
INFO[2020-03-01 13:30:26.239083] Conductor says hello, loading config          config=pipeline-influxdb.conf debug=true fluentd= logfile= maxthreads=4 tag=pipeline version="v1.0.0(bigmuddy)"
DEBU[2020-03-01 13:30:26.239863] Conductor processing section...               name=conductor section=inspector tag=pipeline
DEBU[2020-03-01 13:30:26.239877] Conductor processing section, type...         name=conductor section=inspector tag=pipeline type=tap
INFO[2020-03-01 13:30:26.239887] Conductor starting up section                 name=conductor section=inspector stage="xport_output" tag=pipeline
DEBU[2020-03-01 13:30:26.239922] Conductor processing section...               name=conductor section="metrics_influx" tag=pipeline
DEBU[2020-03-01 13:30:26.239938] Conductor processing section, type...         name=conductor section="metrics_influx" tag=pipeline type=metrics
INFO[2020-03-01 13:30:26.239949] Conductor starting up section                 name=conductor section="metrics_influx" stage="xport_output" tag=pipeline
INFO[2020-03-01 13:30:26.239941] Metamonitoring: serving pipeline metrics to prometheus  name=default resource="/metrics" server=":8989" tag=pipeline
INFO[2020-03-01 13:30:26.240074] Starting up tap                               countonly=false filename="/opt/dump-frank.txt" name=inspector streamSpec=&{2 <nil>} tag=pipeline

CRYPT Client [metrics_influx],[http://10.75.37.91:8086]
 Enter username: admin
 Enter password:         
INFO[2020-03-01 13:30:29.493594] setup authentication                          authenticator="http://10.75.37.91:8086" name="metrics_influx" pem= tag=pipeline username=admin
INFO[2020-03-01 13:30:29.493713] setup metrics collection                      basepath="Cisco-IOS-XR-wdsysmon-fd-oper:system-monitoring/cpu-utilization/process-cpu" name="metrics_influx" tag=e
INFO[2020-03-01 13:30:29.493756] setup metrics collection                      basepath="Cisco-IOS-XR-wdsysmon-fd-oper:system-monitoring/cpu-utilization" name="metrics_influx" tag=pipeline
INFO[2020-03-01 13:30:29.493810] setup metrics collection                      basepath="Cisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/data-rate" name="metrics_ine
INFO[2020-03-01 13:30:29.493936] setup metrics collection                      basepath="Cisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-counters" name="mete
INFO[2020-03-01 13:30:29.494052] setup metrics collection                      basepath="Cisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/total/interfaces-mib-counters" name
INFO[2020-03-01 13:30:29.494100] setup metrics collection                      basepath="Cisco-IOS-XR-infra-syslog-oper:syslog/messages/message" name="metrics_influx" tag=pipeline
INFO[2020-03-01 13:30:29.494138] setup metrics collection                      basepath="Cisco-IOS-XR-nto-misc-oper:memory-summary/nodes/node/summary" name="metrics_influx" tag=pipeline
DEBU[2020-03-01 13:30:29.494148] metrics export configured                     file=metrics-nms.json metricSpec={[{Cisco-IOS-XR-wdsysmon-fd-oper:system-monitoring/cpu-utilization/process-cpu 0e
DEBU[2020-03-01 13:30:29.494218] Conductor processing section...               name=conductor section=testbed tag=pipeline
DEBU[2020-03-01 13:30:29.494227] Conductor processing section, type...         name=conductor section=testbed tag=pipeline type=tcp
INFO[2020-03-01 13:30:29.494235] Conductor starting up section                 name=conductor section=testbed stage="xport_input" tag=pipeline
INFO[2020-03-01 13:30:29.494387] Setting up workers                            database="mdt_db" influx="http://10.75.37.91:8086" name="metrics_influx" tag=pipeline workers=1 xport_type=influx
DEBU[2020-03-01 13:30:29.494454] dataMsg router running                        database="mdt_db" influx="http://10.75.37.91:8086" name="metrics_influx" tag=pipeline workers=1 xport_type=influx
DEBU[2020-03-01 13:30:29.494536] Run worker                                    database="mdt_db" influx="http://10.75.37.91:8086" name="metrics_influx" tag=pipeline wkid=0 workers=1 xport_typex
DEBU[2020-03-01 13:30:29.494610] Conductor watching for shutdown...            config=pipeline-influxdb.conf debug=true logfile= tag=pipeline
DEBU[2020-03-01 13:30:29.494620] Connected to influx node                      database="mdt_db" influx="http://10.75.37.91:8086" name="metrics_influx" tag=pipeline wkid=0 workers=1 xport_typex
INFO[2020-03-01 13:30:29.494627] TCP server starting                           listen=":5432" name=testbed tag=pipeline
INFO[2020-03-01 13:30:36.758557] TCP server accepted connection                encap=st keepalive=0s local="10.75.37.91:5432" name=testbed remote="192.168.0.6:41366" tag=pipeline
                  

[detached from 10814.pipeline]
[root@telemetry ~]# 
[root@telemetry ~]# 
[root@telemetry ~]# screen -ls
There is a screen on:
        10814.pipeline  (Detached)
1 Socket in /var/run/screen/S-root.

Config InfluxDB

All config by GUI, due to easy, so not paste screenshot, follow frequency use cmd:

CREATE DATABASE "mdt_db"
SHOW MEASUREMENTS   # check table in database
select * from "Cisco-IOS-XR-infra-syslog-oper:syslog/messages/message"  # check content in table
SHOW RETENTION POLICIES ON "mdt_db"  # check policy
CREATE RETENTION POLICY "24h" ON "db_name" DURATION 1d REPLICATION 1 DEFAULT  # only store data for 1 day in fluxdb

Config Telemetry at IOS XR

RP/0/RP0/CPU0:R6#sh run telemetry model-driven 
Sun Mar  1 10:46:28.241 UTC
telemetry model-driven
 destination-group nms
  address-family ipv4 10.75.37.91 port 5432
   encoding self-describing-gpb
   protocol tcp
  !
 !
 sensor-group bgp
  sensor-path 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
 !        
 sensor-group syslog
  sensor-path Cisco-IOS-XR-infra-syslog-oper:syslog/messages/message
 !
 sensor-group node-cpu
  sensor-path Cisco-IOS-XR-wdsysmon-fd-oper:system-monitoring/cpu-utilization
 !
 sensor-group ifmib-stats
  sensor-path Cisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/data-rate
  sensor-path Cisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-counters
 !
 sensor-group node-memory
  sensor-path Cisco-IOS-XR-nto-misc-oper:memory-summary/nodes/node/summary
 !
 sensor-group l2vpn-xconnect
  sensor-path Cisco-IOS-XR-l2vpn-oper:l2vpnv2/active/xconnects/xconnect
 !
 subscription nms
  sensor-group-id bgp strict-timer
  sensor-group-id bgp sample-interval 5000
  sensor-group-id syslog sample-interval 0
  sensor-group-id node-cpu strict-timer
  sensor-group-id node-cpu sample-interval 5000
  sensor-group-id ifmib-stats strict-timer
  sensor-group-id ifmib-stats sample-interval 30000
  sensor-group-id node-memory strict-timer
  sensor-group-id node-memory sample-interval 10000
  sensor-group-id l2vpn-xconnect strict-timer
  sensor-group-id l2vpn-xconnect sample-interval 30000
  destination-id nms
  source-interface Loopback0
 !
!

check telemetry statuus at router:

RP/0/RP0/CPU0:R6#sh telemetry model-driven subscriptio                    
Sun Mar  1 10:47:39.429 UTC
Subscription:  nms                      State: ACTIVE
-------------
  Sensor groups:
  Id                               Interval(ms)        State     
  bgp                              5000                Resolved  
  syslog                           0                   Resolved  
  node-cpu                         5000                Resolved  
  ifmib-stats                      30000               Resolved  
  node-memory                      10000               Resolved  
  l2vpn-xconnect                   30000               Resolved  

  Destination Groups:
  Id                 Encoding            Transport   State   Port    Vrf     IP            
  nms                self-describing-gpb tcp         Active  5432            10.75.37.91   
    No TLS            

Config Grafana

You just import follow jason profile that is ok: Frank’s Dashboard.json

XR Configuration

Please check this file: Telemetry-XR.cfg

本文出自 Frank's Blog

版权声明:


本文链接:Telemetry Solution Demo with IOS XR
版权声明:本文为原创文章,仅代表个人观点,版权归 Frank Zhao 所有,转载时请注明本文出处及文章链接
你可以留言,或者trackback 从你的网站

留言哦

blonde teen swallows load.xxx videos