Task03
Layer 3 Data

Layer 3 Network Information

Layer 3 information, including routing information, VRFs, BFD and other related data points.

Step 1 - Load the 'openconfig-network-instance' YANG Module



Step 2 - Browse the 'openconfig-network-instance' YANG Module to protocols

Network Instance Protcols



BGP Peers



BGP Peer Node Details




ISIS Adjacencies



ISIS Adjacency Details



SVI Details



VRFs



Step 3 - Load the 'openconfig-bfd' YANG Module



BFD Peer State




Step 4 - Load the 'openconfig-lacp' YANG Module



LACP State




Step 5 - Stop the running docker containers

Stop all running containers by pressing Ctrl+c . We will restart these containers later with an updated gnmi.conf file.


Ctrl+C

Step 6 - Open gnmi.conf

Open file telegraf/gnmi.conf if it was closed previously


code -r /home/cisco/CiscoLive/DEVWKS-2135/telegraf/gnmi.conf

Step 7 - Replace the gNMI configuration file with this updated Layer 3 data.

Replace the telegraf.conf file with the below content and press Ctrl+s to save the file.


[agent]
  logtarget = "file"
  logfile = "/var/log/telegraf/telegraf.log"
  debug = true
  hostname = "telegraf"
  interval = "10s"
  round_interval = false
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  
  
  [[inputs.ping]]
  urls = ["10.15.24.10", "10.15.24.11", "10.15.24.12"]
  
  [inputs.ping.tags]
  tag1 = "ping"
  
  
  [[inputs.gnmi]]
    # Address and port of the GNMI GRPC server
    addresses = ["10.15.24.10:50051", "10.15.24.11:50051","10.15.24.12:50051"]
    ## define credentials
    username = "admin"
    password = "cisco.123"
  
    ## enable client-side TLS and define CA to authenticate the device
    enable_tls = true
    tls_ca = "/etc/telegraf/certs/gnmi.crt"
    insecure_skip_verify = true
  
    # redial in case of failures after
    redial = "10s"
  [inputs.gnmi.tags]
    tag1 = "gnmi"
  
    [[inputs.gnmi.subscription]]
      name = "mgmt-ip"
      origin = "openconfig"
      path = "/interfaces/interface[name=mgmt0]/subinterfaces/subinterface/ipv4/addresses/address/config"
      subscription_mode = "sample"
      sample_interval = "600s"

    [[inputs.gnmi.subscription]]
      name = "platform"
      origin = "openconfig"
      path = "/components/component/state/name"
      subscription_mode = "sample"
      sample_interval = "30s"

    [[inputs.gnmi.subscription]]
      name = "software-version"
      origin = "openconfig"
      path = "/components/component/state/software-version"
      subscription_mode = "sample"
      sample_interval = "30s"

    [[inputs.gnmi.subscription]]
      name = "memory"
      origin = "openconfig"
      path = "/components/component/state/memory"
      subscription_mode = "sample"
      sample_interval = "30s"

    [[inputs.gnmi.subscription]]
      name = "cpu"
      origin = "openconfig"
      path = "/components/component/cpu/utilization"
      subscription_mode = "sample"
      sample_interval = "30s"

    [[inputs.gnmi.subscription]]
      name = "temperature"
      origin = "openconfig"
      path = "/components/component/state/temperature/instant"
      subscription_mode = "sample"
      sample_interval = "20s"

    [[inputs.gnmi.subscription]]
      name = "fans"
      origin = "openconfig"
      path = "/components/component/fan/state"
      subscription_mode = "sample"
      sample_interval = "20s"
      suppress_redundant = true
      heartbeat_interval = "60s"

    [[inputs.gnmi.subscription]]
      name = "power-supply"
      origin = "openconfig"
      path = "/components/component/power-supply/state/"
      subscription_mode = "sample"
      sample_interval = "20s"
      suppress_redundant = true
      heartbeat_interval = "60s"

    [[inputs.gnmi.subscription]]
      name = "boot-time"
      origin = "openconfig"
      path = "/system/state"
      subscription_mode = "sample"
      sample_interval = "600s"

    [[inputs.gnmi.subscription]]
      name = "lldp-neighbors"
      origin = "openconfig"
      path = "/lldp/interfaces/interface/neighbors/neighbor/state"
      subscription_mode = "sample"
      sample_interval = "60s"
      suppress_redundant = true
      heartbeat_interval = "60s"

    [[inputs.gnmi.subscription]]
      name = "vlans"
      origin = "openconfig"
      path = "/network-instances/network-instance/vlans/vlan/state"
      subscription_mode = "sample"
      sample_interval = "60s"

    [[inputs.gnmi.subscription]]
      name = "mac-address-table"
      origin = "openconfig"
      path = "/network-instances/network-instance/fdb/mac-table/entries"
      subscription_mode = "sample"
      sample_interval = "60s"

    [[inputs.gnmi.subscription]]
      name = "l2rib_mac_entries"
      origin = "openconfig"
      path = "/network-instances/network-instance/fdb/l2rib/mac-table/entries"
      subscription_mode = "sample"
      sample_interval = "60s"

    [[inputs.gnmi.subscription]]
      name = "interface-state"
      origin = "openconfig"
      path = "/interfaces/interface/state/oper-status"
      subscription_mode = "sample"
      sample_interval = "10s"
      suppress_redundant = true
      heartbeat_interval = "60s"

    [[inputs.gnmi.subscription]]
      name = "isis-state"
      origin = "openconfig"
      path = "/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/levels/level/adjacencies/adjacency/state"
      # subscription_mode = "on_change"
      subscription_mode = "sample"
      sample_interval = "60s"

    [[inputs.gnmi.subscription]]
      name = "bgp-state"
      origin = "openconfig"
      path = "/network-instances/network-instance/protocols/protocol/bgp/neighbors"
      subscription_mode = "sample"
      sample_interval = "60s"

    [[inputs.gnmi.subscription]]
      name = "vrfs"
      origin = "openconfig"
      path = "/network-instances/network-instance/state"
      subscription_mode = "sample"
      sample_interval = "60s"

    [[inputs.gnmi.subscription]]
      name = "svis"
      origin = "openconfig"
      path = "/interfaces/interface/routed-vlan/ipv4/addresses/address"
      subscription_mode = "sample"
      sample_interval = "60s"

    [[inputs.gnmi.subscription]]
      name = "vxlan_peers"
      origin = "openconfig"
      path = "/network-instances/network-instance/connection-points/connection-point/endpoints/endpoint/vxlan/endpoint-peers"
      subscription_mode = "sample"
      sample_interval = "60s"

    [[inputs.gnmi.subscription]]
      name = "vxlan_vnis"
      origin = "openconfig"
      path = "/network-instances/network-instance/connection-points/connection-point/endpoints/endpoint/vxlan/endpoint-vnis/endpoint-vni"
      subscription_mode = "sample"
      sample_interval = "60s"

    [[inputs.gnmi.subscription]]
      name = "bgp_rib_type2_routes"
      origin = "openconfig"
      path = "/network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/l2vpn-evpn/loc-rib/routes/route-distinguisher/type-two-mac-ip-advertisement/type-two-route/state"
      subscription_mode = "sample"
      sample_interval = "60s"

    [[inputs.gnmi.subscription]]
      name = "bfd"
      origin = "openconfig"
      # path = "/bfd/interfaces/interface/peers/peer/state/session-state"
      path = "/bfd/interfaces/interface/id"
      # subscription_mode = "on_change"
      subscription_mode = "sample"
      sample_interval = "30s"
  
  [[outputs.file]]
    files = ["stdout"]
    data_format = "json"
  
  [[outputs.influxdb_v2]]
    ## The URLs of the InfluxDB cluster nodes.
    urls = ["http://influxdb:8086"]
  
    ## API token for authentication.
    token = "$DOCKER_INFLUXDB_INIT_ADMIN_TOKEN"
    organization = "$DOCKER_INFLUXDB_INIT_ORG"
    bucket = "$DOCKER_INFLUXDB_INIT_BUCKET"
  
  [outputs.influxdb_v2.tagpass]
    tag1 = ["gnmi", "ping"]
    

            

Step 8 - Restart the containers via Docker Compose

Run the docker-compose.yml file via the below command. Confirm that the subscriptions establish to the switches and the data is outputed to the terminal and the data should now also be present in Grafana.


docker-compose up

Step 9 - View the data in Grafana.

Now browse to the Grafana dashboard and hopefully the information from the paths we just added will appear on the dashboard.



  • Introduction
  • Lab Environment and Topology
  • Streaming Telemetry Overview
  • Tools Overview
  • TIG Stack
  • Browse YANG Suite
  • Bonus Task!
  • Thanks