SlideShare a Scribd company logo
1 of 37
www.networktocode.com Network to Code Confidential
How to Introduce Telemetry
Streaming (gNMI) in Your
Network with SNMP with
Telegraf
November 2020
www.networktocode.com Network to Code Confidential
Who is Network to Code?
/company/network-to-code/
@networktocode
• Founded in mid 2014
• Network Automation Solution Provider
– Next-gen consulting and integration company
– Focus on automation/programmability and reducing
operational inefficiencies
– Services only business model
• Vendor Independent
– Infrastructure (Cisco, Juniper, Arista, HP, Cumulus, F5
etc.)
– Open Source Tools (Ansible, Salt, Python, StackStorm,
Puppet, Terraform, Telegraf, InfluxDB, Prometheus,
Grafana, ElasticSearch, Kibana)
– IT Operations Software – ServiceNOW, Remedy, IBM
www.networktocode.com
www.networktocode.com Network to Code Confidential
About David & Josh
David
● Dublin, IE
● Sr Network Automation
Consultant, Network to Code
● Automating Networks since
2013
● Telegraf user since 2019
Josh
● Minnesota, US
● Network Automation
Engineer, Network to Code
● Automating Networks since
2015
● Telegraf user since 2018
@vanderaaj@davidban77 @jvanderaa@davidban77
www.networktocode.com Network to Code Confidential
Agenda
One of the best times to be gathering telemetry data from
network devices!
• Network Streaming Telemetry Stack
• gNMI
• Gathering of Data from Network Devices with Telegraf
• Enriching and Modifying metrics
• Demo
• Wrap Up & Tips and Tricks
www.networktocode.com Network to Code Confidential
Telemetry Stack
Collect
Enrichment
Store
Dashboard
Network Devices
www.networktocode.com Network to Code Confidential
gNMI - Streaming Telemetry
www.networktocode.com Network to Code Confidential
What is gNMI
• Model driven configuration and retrieval of
operational data over gRPC (Remote
Procedure Calls)
• Protocol Buffers
• Subscription model
www.networktocode.com Network to Code Confidential
gNMI Plugin Note
• Previously Cisco gNMI Telemetry
(cisco_telemetry_gnmi)
• Renamed to just gNMI in Telegraf 1.15
• https://github.com/influxdata/telegraf/tree/rel
ease-1.16/plugins/inputs/gnmi
www.networktocode.com Network to Code Confidential
Telegraf for Network Telemetry
www.networktocode.com Network to Code Confidential
What is Telegraf?
• Telegraf is a plugin-driven server agent for
collecting & reporting metrics written in Go
• Pulls metrics from system running on, 3rd
party APIs
• Output plugins to send to various data stores
www.networktocode.com Network to Code Confidential
Telegraf - gNMI
11
[[inputs.gnmi]]
addresses = ["device1"]
username = "<USERNAME>"
password = "<PASSWORD>"
[[inputs.gnmi.subscription]]
origin = "openconfig-interfaces"
path = "/interfaces/interface"
subscription_mode = "sample"
sample_interval = "60s"
Collect Interfaces/interface counters
Base config : Device + Credential
www.networktocode.com Network to Code Confidential
Want to monitor all of this, streaming telemetry
would be terrific
www.networktocode.com Network to Code Confidential
Several devices in your environment do not yet
support Streaming Telemetry!
www.networktocode.com Network to Code Confidential
Hybrid Collection
www.networktocode.com Network to Code Confidential
Telegraf - SNMP
15
[[inputs.snmp]]
agents = ["device1"]
version = 2
community = "<SNMP Community>"
interval = "60s"
timeout = "10s"
retries = 3
[[inputs.snmp.field]]
name = "hostname"
oid = "RFC1213-MIB::sysName.0"
is_tag = true
[[inputs.snmp.table]]
name = "interface"
inherit_tags = [ "hostname" ]
oid = "IF-MIB::ifXTable"
[[inputs.snmp.table.field]]
name = "name"
oid = "IF-MIB::ifDescr"
is_tag = true
Base config : Device, Credential, interval
Convert sysName.0 as tag hostname
Collect IF-MIB::ifXTable Table
Convert ifDescr as Tag name
www.networktocode.com Network to Code Confidential
Challenge with Multiple Input Plugins
16
snmp
gnmi
interface_counters,agent_host=router1,ifName=Ethernet7
ifOutOctets=3814i,ifInOctets=469i 160519
interface,source=192.0.2.10,name=Ethernet7 in_octets=2176i 1605192
interface,source=192.0.2.10,name=Ethernet7 out_octets=316i 1605192
Measurement Tag Set Field Set TimestampInflux Line Protocol:
www.networktocode.com Network to Code Confidential
Telegraf Pipeline
www.networktocode.com Network to Code Confidential
Telegraf Pipeline
snmp
Output Plugin
40+ availableprometheus_client
gnmi Execd
regex
Input Plugins
190+ available
Processors Plugins
25+ available
influxdb
rename
Collect
Data
Enrichment
Output
www.networktocode.com Network to Code Confidential
Data Enrichment
www.networktocode.com Network to Code Confidential
Data Normalization with Telegraf - single device
20
snmp
Output Plugin - Send to InfluxDB
Normalize Data
influxdb_v2
gnmi execd
regex
rename rename rename
Collect Data + Add device level Tags
Enrich Data (add interface role)
www.networktocode.com Network to Code Confidential
# Processor to rename the snmp fields
[[processors.rename]]
[[processors.rename.replace]]
field = "ifHCInOctets"
dest = "in_octets"
[[processors.rename.replace]]
field = "ifHCOutOctets"
dest = "out_octets"
[[processors.rename.replace]]
tag = "agent_host"
dest = "source"
Telegraf - Rename Data
21
Rename the field ifHCInOctets and ifHCOutOctets to match gNMI
Rename the tag agent_host to match gNMI
www.networktocode.com Network to Code Confidential
Telegraf - Add metadata
22
[[processors.regex]]
[processors.regex.tagpass]
host = device1
[[processors.regex.tags]]
key = "name"
pattern = "^ge-0/0/0$"
replacement = "management"
result_key = "interfacerole"
[[processors.regex.tags]]
key = "name"
pattern = "^ge-0/0/1$"
replacement = "data"
result_key = "interfacerole"
Apply these rules only for measurement with a tag host=device1
If a tag name=ge-0/0/0 is present, add a tag interfacerole=management
If a tag name=ge-0/0/1 is present, add a tag interfacerole=data
www.networktocode.com Network to Code Confidential
Demo Environment
www.networktocode.com Network to Code Confidential
Demo Environment
www.networktocode.com Network to Code Confidential
Recap
• Collect Data from devices
• Normalize the data
• Enrich the data
• Output the data
• Dashboard of the data
www.networktocode.com Network to Code Confidential
What’s Next & Tips and Tricks
www.networktocode.com Network to Code Confidential
What we are trying to do next?
• Flux language
• InfluxDB 2.0
• InfluxDB IOx
• Additional plugins - Input and Processor
• Starlark processor
www.networktocode.com Network to Code Confidential
Telegraf Tips & Tricks
• Automate configuration with templating - Ansible is a good choice
• Run in Docker
• Install SNMP MIB’s Locally
• Use files output for troubleshooting
• SNMP/gNMI won’t work? Look at writing your own executable
with the execd plugins
• Input Internal Plugin (about the Telegraf Plugin)
• Consider running on device natively
• Use the reachability plugins (Network Response, DNS)
• Look at the Plugin Documentation (search “Telegraf Plugins”)
www.networktocode.com Network to Code Confidential
Monitor Your Network With gNMI, SNMP, and Grafana
http://blog.networktocode.com/post/monitor_your_network_with_gnmi_snmp_and_grafana/
Network Telemetry for SNMP Devices
http://blog.networktocode.com/post/network_telemetry_for_snmp_devices/
Monitoring Websites with Telegraf and
Prometheus
https://blog.networktocode.com/post/monitoring_websites_with_telegraf_and_prometheus/
Network to Code Blog Content
www.networktocode.com Network to Code Confidential
Thank You!
/company/network-to-code/
@networktocode
www.networktocode.com
slack.networktocode.com
www.networktocode.com Network to Code Confidential
Appendix Items
www.networktocode.com Network to Code Confidential
[global_tags]
device_role = "spine"
[agent]
hostname = "telegraf-r1"
Telegraf-R1: Base Input Configuration
[[inputs.snmp]]
agents = ["r1"]
version = 2
community = "${SNMP_COMMUNITY}"
interval = "60s"
timeout = "10s"
retries = 3
[[inputs.snmp.table]]
name = "interface"
oid = "IF-MIB::ifXTable"
[[inputs.snmp.table.field]]
name = "name"
oid = "IF-MIB::ifDescr"
is_tag = true
Cont.
www.networktocode.com Network to Code Confidential
Telegraf -R1 Data Normalization and Enrichment
[[processors.rename]]
[[processors.rename.replace]]
field = "ifHCInOctets"
dest = "in_octets"
[[processors.rename.replace]]
field = "ifHCOutOctets"
dest = "out_octets"
[[processors.rename.replace]]
tag = "agent_host"
dest = "device"
[[processors.regex]]
namepass = ["interface"]
[[processors.regex.tags]]
key = "name"
pattern = "^GigaS+0$"
replacement = "management"
result_key = "intf_role"
[[processors.regex.tags]]
key = "name"
pattern = "^GigaS+0/1$"
replacement = "spine"
result_key = "intf_role"
[[processors.regex.tags]]
key = "name"
pattern = "^GigaS+0/2$"
replacement = "backbone"
result_key = "intf_role"
Cont.
www.networktocode.com Network to Code Confidential
Telegraf -R1 Output InfluxDB and STDOUT
[[outputs.influxdb]]
urls = ["http://influxdb:8086"]
[[outputs.file]]
files = ["stdout"]
data_format = "influx"
www.networktocode.com Network to Code Confidential
[global_tags]
device_role = "spine"
[agent]
hostname = "telegraf-r2"
Telegraf-R2: Base Input Configuration
Cont.
[[inputs.gnmi]]
addresses = ["r2:6030"]
username = "${GNMI_USER}"
password = "${GNMI_PASSWORD}"
redial = "10s"
[[inputs.gnmi.subscription]]
name = "interface"
origin = "openconfig-interfaces"
path = "/interfaces/interface/state/counters"
subscription_mode = "sample"
sample_interval = "5s"
www.networktocode.com Network to Code Confidential
Telegraf -R2 Data Normalization and Enrichment
Cont.
[[processors.rename]]
[[processors.rename.replace]]
tag = "source"
dest = "device"
[[processors.regex]]
namepass = ["interface"]
[[processors.regex.tags]]
key = "name"
pattern = "^Managementd+$"
replacement = "management"
result_key = "intf_role"
[[processors.regex.tags]]
key = "name"
pattern = "^Ethernet1$"
replacement = "spine"
result_key = "intf_role"
[[processors.regex.tags]]
key = "name"
pattern = "^Ethernet2$"
replacement = "backbone"
result_key = "intf_role"
www.networktocode.com Network to Code Confidential
Telegraf -R2 Output InfluxDB and STDOUT
[[outputs.influxdb]]
urls = ["http://influxdb:8086"]
[[outputs.file]]
files = ["stdout"]
data_format = "influx"

More Related Content

What's hot

What's hot (20)

OpenStack Architecture and Use Cases
OpenStack Architecture and Use CasesOpenStack Architecture and Use Cases
OpenStack Architecture and Use Cases
 
[OpenInfra Days Korea 2018] (Track 4) - Grafana를 이용한 OpenStack 클라우드 성능 모니터링
[OpenInfra Days Korea 2018] (Track 4) - Grafana를 이용한 OpenStack 클라우드 성능 모니터링[OpenInfra Days Korea 2018] (Track 4) - Grafana를 이용한 OpenStack 클라우드 성능 모니터링
[OpenInfra Days Korea 2018] (Track 4) - Grafana를 이용한 OpenStack 클라우드 성능 모니터링
 
ELK at LinkedIn - Kafka, scaling, lessons learned
ELK at LinkedIn - Kafka, scaling, lessons learnedELK at LinkedIn - Kafka, scaling, lessons learned
ELK at LinkedIn - Kafka, scaling, lessons learned
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting router
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
 
오픈스택 멀티노드 설치 후기
오픈스택 멀티노드 설치 후기오픈스택 멀티노드 설치 후기
오픈스택 멀티노드 설치 후기
 
Swoole Love PHP
Swoole Love PHPSwoole Love PHP
Swoole Love PHP
 
Cilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPCilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDP
 
Monitoring using Prometheus and Grafana
Monitoring using Prometheus and GrafanaMonitoring using Prometheus and Grafana
Monitoring using Prometheus and Grafana
 
Introduction to FreeSWITCH
Introduction to FreeSWITCHIntroduction to FreeSWITCH
Introduction to FreeSWITCH
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
 
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
 
【解説】IKE(IIJ Kubernetes Engine):= Vanilla Kubernetes + 何?
【解説】IKE(IIJ Kubernetes Engine):= Vanilla Kubernetes + 何?【解説】IKE(IIJ Kubernetes Engine):= Vanilla Kubernetes + 何?
【解説】IKE(IIJ Kubernetes Engine):= Vanilla Kubernetes + 何?
 
Kubernete Meetup Tokyo #18 - Kubebuilder/controller-runtime 入門
Kubernete Meetup Tokyo #18 - Kubebuilder/controller-runtime 入門Kubernete Meetup Tokyo #18 - Kubebuilder/controller-runtime 入門
Kubernete Meetup Tokyo #18 - Kubebuilder/controller-runtime 入門
 
Hybrid cloud : why and how to connect your datacenters to OVHcloud ?
Hybrid cloud : why and how to connect your datacenters to OVHcloud ? Hybrid cloud : why and how to connect your datacenters to OVHcloud ?
Hybrid cloud : why and how to connect your datacenters to OVHcloud ?
 
ネットワークの自動化・監視の取り組みについて #netopscoding #npstudy
ネットワークの自動化・監視の取り組みについて #netopscoding #npstudyネットワークの自動化・監視の取り組みについて #netopscoding #npstudy
ネットワークの自動化・監視の取り組みについて #netopscoding #npstudy
 
OpenvSwitch Deep Dive
OpenvSwitch Deep DiveOpenvSwitch Deep Dive
OpenvSwitch Deep Dive
 
Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
Jenkins를 활용한 Openshift CI/CD 구성
Jenkins를 활용한 Openshift CI/CD 구성 Jenkins를 활용한 Openshift CI/CD 구성
Jenkins를 활용한 Openshift CI/CD 구성
 
초보자를 위한 네트워크/VLAN 기초
초보자를 위한 네트워크/VLAN 기초초보자를 위한 네트워크/VLAN 기초
초보자를 위한 네트워크/VLAN 기초
 

Similar to How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Telegraf

26.1.7 lab snort and firewall rules
26.1.7 lab   snort and firewall rules26.1.7 lab   snort and firewall rules
26.1.7 lab snort and firewall rules
Freddy Buenaño
 
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
mfrancis
 

Similar to How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Telegraf (20)

26.1.7 lab snort and firewall rules
26.1.7 lab   snort and firewall rules26.1.7 lab   snort and firewall rules
26.1.7 lab snort and firewall rules
 
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
Monitoring as Code: Getting to Monitoring-Driven Development - DEV314 - re:In...
 
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
Leveraging the strength of OSGi to deliver a convergent IoT Ecosystem - O Log...
 
Managing Large-scale Networks with Trigger
Managing Large-scale Networks with TriggerManaging Large-scale Networks with Trigger
Managing Large-scale Networks with Trigger
 
CENTRAL MANAGEMENT OF NETWORK AND CALL SERVICES
CENTRAL MANAGEMENT OF NETWORK AND CALL SERVICESCENTRAL MANAGEMENT OF NETWORK AND CALL SERVICES
CENTRAL MANAGEMENT OF NETWORK AND CALL SERVICES
 
Getting Started: Intro to Telegraf - July 2021
Getting Started: Intro to Telegraf - July 2021Getting Started: Intro to Telegraf - July 2021
Getting Started: Intro to Telegraf - July 2021
 
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
 
Internet of things the salesforce lego machine cloud
Internet of things   the salesforce lego machine cloudInternet of things   the salesforce lego machine cloud
Internet of things the salesforce lego machine cloud
 
5G Multi-Access Edge Compute
5G Multi-Access Edge Compute5G Multi-Access Edge Compute
5G Multi-Access Edge Compute
 
Hunting for APT in network logs workshop presentation
Hunting for APT in network logs workshop presentationHunting for APT in network logs workshop presentation
Hunting for APT in network logs workshop presentation
 
Samantha Wang [InfluxData] | Data Collection Overview | InfluxDays 2022
Samantha Wang [InfluxData] | Data Collection Overview | InfluxDays 2022Samantha Wang [InfluxData] | Data Collection Overview | InfluxDays 2022
Samantha Wang [InfluxData] | Data Collection Overview | InfluxDays 2022
 
New Design Patterns in Microservice Solutions
New Design Patterns in Microservice SolutionsNew Design Patterns in Microservice Solutions
New Design Patterns in Microservice Solutions
 
Applciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumerationApplciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumeration
 
How to Build a Telegraf Plugin by Noah Crowley
How to Build a Telegraf Plugin by Noah CrowleyHow to Build a Telegraf Plugin by Noah Crowley
How to Build a Telegraf Plugin by Noah Crowley
 
Building a Telegraf Plugin by Noah Crowly | Developer Advocate | InfluxData
Building a Telegraf Plugin by Noah Crowly | Developer Advocate | InfluxDataBuilding a Telegraf Plugin by Noah Crowly | Developer Advocate | InfluxData
Building a Telegraf Plugin by Noah Crowly | Developer Advocate | InfluxData
 
How to Use Telegraf and Its Plugin Ecosystem
How to Use Telegraf and Its Plugin EcosystemHow to Use Telegraf and Its Plugin Ecosystem
How to Use Telegraf and Its Plugin Ecosystem
 
Cisco Automation with Puppet and onePK - PuppetConf 2013
Cisco Automation with Puppet and onePK - PuppetConf 2013Cisco Automation with Puppet and onePK - PuppetConf 2013
Cisco Automation with Puppet and onePK - PuppetConf 2013
 
PRTG
PRTGPRTG
PRTG
 
P4 Introduction
P4 Introduction P4 Introduction
P4 Introduction
 
IThome DevOps Summit - IoT、docker與DevOps
IThome DevOps Summit - IoT、docker與DevOpsIThome DevOps Summit - IoT、docker與DevOps
IThome DevOps Summit - IoT、docker與DevOps
 

More from InfluxData

How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
InfluxData
 
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
InfluxData
 
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
InfluxData
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
InfluxData
 

More from InfluxData (20)

Announcing InfluxDB Clustered
Announcing InfluxDB ClusteredAnnouncing InfluxDB Clustered
Announcing InfluxDB Clustered
 
Best Practices for Leveraging the Apache Arrow Ecosystem
Best Practices for Leveraging the Apache Arrow EcosystemBest Practices for Leveraging the Apache Arrow Ecosystem
Best Practices for Leveraging the Apache Arrow Ecosystem
 
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
How Bevi Uses InfluxDB and Grafana to Improve Predictive Maintenance and Redu...
 
Power Your Predictive Analytics with InfluxDB
Power Your Predictive Analytics with InfluxDBPower Your Predictive Analytics with InfluxDB
Power Your Predictive Analytics with InfluxDB
 
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
How Teréga Replaces Legacy Data Historians with InfluxDB, AWS and IO-Base
 
Build an Edge-to-Cloud Solution with the MING Stack
Build an Edge-to-Cloud Solution with the MING StackBuild an Edge-to-Cloud Solution with the MING Stack
Build an Edge-to-Cloud Solution with the MING Stack
 
Meet the Founders: An Open Discussion About Rewriting Using Rust
Meet the Founders: An Open Discussion About Rewriting Using RustMeet the Founders: An Open Discussion About Rewriting Using Rust
Meet the Founders: An Open Discussion About Rewriting Using Rust
 
Introducing InfluxDB Cloud Dedicated
Introducing InfluxDB Cloud DedicatedIntroducing InfluxDB Cloud Dedicated
Introducing InfluxDB Cloud Dedicated
 
Gain Better Observability with OpenTelemetry and InfluxDB
Gain Better Observability with OpenTelemetry and InfluxDB Gain Better Observability with OpenTelemetry and InfluxDB
Gain Better Observability with OpenTelemetry and InfluxDB
 
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
How a Heat Treating Plant Ensures Tight Process Control and Exceptional Quali...
 
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...How Delft University's Engineering Students Make Their EV Formula-Style Race ...
How Delft University's Engineering Students Make Their EV Formula-Style Race ...
 
Introducing InfluxDB’s New Time Series Database Storage Engine
Introducing InfluxDB’s New Time Series Database Storage EngineIntroducing InfluxDB’s New Time Series Database Storage Engine
Introducing InfluxDB’s New Time Series Database Storage Engine
 
Start Automating InfluxDB Deployments at the Edge with balena
Start Automating InfluxDB Deployments at the Edge with balena Start Automating InfluxDB Deployments at the Edge with balena
Start Automating InfluxDB Deployments at the Edge with balena
 
Understanding InfluxDB’s New Storage Engine
Understanding InfluxDB’s New Storage EngineUnderstanding InfluxDB’s New Storage Engine
Understanding InfluxDB’s New Storage Engine
 
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDBStreamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
Streamline and Scale Out Data Pipelines with Kubernetes, Telegraf, and InfluxDB
 
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
Ward Bowman [PTC] | ThingWorx Long-Term Data Storage with InfluxDB | InfluxDa...
 
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
Scott Anderson [InfluxData] | New & Upcoming Flux Features | InfluxDays 2022
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts | InfluxDays 2022
 
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
Steinkamp, Clifford [InfluxData] | Welcome to InfluxDays 2022 - Day 2 | Influ...
 
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
Steinkamp, Clifford [InfluxData] | Closing Thoughts Day 1 | InfluxDays 2022
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Telegraf

  • 1. www.networktocode.com Network to Code Confidential How to Introduce Telemetry Streaming (gNMI) in Your Network with SNMP with Telegraf November 2020
  • 2. www.networktocode.com Network to Code Confidential Who is Network to Code? /company/network-to-code/ @networktocode • Founded in mid 2014 • Network Automation Solution Provider – Next-gen consulting and integration company – Focus on automation/programmability and reducing operational inefficiencies – Services only business model • Vendor Independent – Infrastructure (Cisco, Juniper, Arista, HP, Cumulus, F5 etc.) – Open Source Tools (Ansible, Salt, Python, StackStorm, Puppet, Terraform, Telegraf, InfluxDB, Prometheus, Grafana, ElasticSearch, Kibana) – IT Operations Software – ServiceNOW, Remedy, IBM www.networktocode.com
  • 3. www.networktocode.com Network to Code Confidential About David & Josh David ● Dublin, IE ● Sr Network Automation Consultant, Network to Code ● Automating Networks since 2013 ● Telegraf user since 2019 Josh ● Minnesota, US ● Network Automation Engineer, Network to Code ● Automating Networks since 2015 ● Telegraf user since 2018 @vanderaaj@davidban77 @jvanderaa@davidban77
  • 4. www.networktocode.com Network to Code Confidential Agenda One of the best times to be gathering telemetry data from network devices! • Network Streaming Telemetry Stack • gNMI • Gathering of Data from Network Devices with Telegraf • Enriching and Modifying metrics • Demo • Wrap Up & Tips and Tricks
  • 5. www.networktocode.com Network to Code Confidential Telemetry Stack Collect Enrichment Store Dashboard Network Devices
  • 6. www.networktocode.com Network to Code Confidential gNMI - Streaming Telemetry
  • 7. www.networktocode.com Network to Code Confidential What is gNMI • Model driven configuration and retrieval of operational data over gRPC (Remote Procedure Calls) • Protocol Buffers • Subscription model
  • 8. www.networktocode.com Network to Code Confidential gNMI Plugin Note • Previously Cisco gNMI Telemetry (cisco_telemetry_gnmi) • Renamed to just gNMI in Telegraf 1.15 • https://github.com/influxdata/telegraf/tree/rel ease-1.16/plugins/inputs/gnmi
  • 9. www.networktocode.com Network to Code Confidential Telegraf for Network Telemetry
  • 10. www.networktocode.com Network to Code Confidential What is Telegraf? • Telegraf is a plugin-driven server agent for collecting & reporting metrics written in Go • Pulls metrics from system running on, 3rd party APIs • Output plugins to send to various data stores
  • 11. www.networktocode.com Network to Code Confidential Telegraf - gNMI 11 [[inputs.gnmi]] addresses = ["device1"] username = "<USERNAME>" password = "<PASSWORD>" [[inputs.gnmi.subscription]] origin = "openconfig-interfaces" path = "/interfaces/interface" subscription_mode = "sample" sample_interval = "60s" Collect Interfaces/interface counters Base config : Device + Credential
  • 12. www.networktocode.com Network to Code Confidential Want to monitor all of this, streaming telemetry would be terrific
  • 13. www.networktocode.com Network to Code Confidential Several devices in your environment do not yet support Streaming Telemetry!
  • 14. www.networktocode.com Network to Code Confidential Hybrid Collection
  • 15. www.networktocode.com Network to Code Confidential Telegraf - SNMP 15 [[inputs.snmp]] agents = ["device1"] version = 2 community = "<SNMP Community>" interval = "60s" timeout = "10s" retries = 3 [[inputs.snmp.field]] name = "hostname" oid = "RFC1213-MIB::sysName.0" is_tag = true [[inputs.snmp.table]] name = "interface" inherit_tags = [ "hostname" ] oid = "IF-MIB::ifXTable" [[inputs.snmp.table.field]] name = "name" oid = "IF-MIB::ifDescr" is_tag = true Base config : Device, Credential, interval Convert sysName.0 as tag hostname Collect IF-MIB::ifXTable Table Convert ifDescr as Tag name
  • 16. www.networktocode.com Network to Code Confidential Challenge with Multiple Input Plugins 16 snmp gnmi interface_counters,agent_host=router1,ifName=Ethernet7 ifOutOctets=3814i,ifInOctets=469i 160519 interface,source=192.0.2.10,name=Ethernet7 in_octets=2176i 1605192 interface,source=192.0.2.10,name=Ethernet7 out_octets=316i 1605192 Measurement Tag Set Field Set TimestampInflux Line Protocol:
  • 17. www.networktocode.com Network to Code Confidential Telegraf Pipeline
  • 18. www.networktocode.com Network to Code Confidential Telegraf Pipeline snmp Output Plugin 40+ availableprometheus_client gnmi Execd regex Input Plugins 190+ available Processors Plugins 25+ available influxdb rename Collect Data Enrichment Output
  • 19. www.networktocode.com Network to Code Confidential Data Enrichment
  • 20. www.networktocode.com Network to Code Confidential Data Normalization with Telegraf - single device 20 snmp Output Plugin - Send to InfluxDB Normalize Data influxdb_v2 gnmi execd regex rename rename rename Collect Data + Add device level Tags Enrich Data (add interface role)
  • 21. www.networktocode.com Network to Code Confidential # Processor to rename the snmp fields [[processors.rename]] [[processors.rename.replace]] field = "ifHCInOctets" dest = "in_octets" [[processors.rename.replace]] field = "ifHCOutOctets" dest = "out_octets" [[processors.rename.replace]] tag = "agent_host" dest = "source" Telegraf - Rename Data 21 Rename the field ifHCInOctets and ifHCOutOctets to match gNMI Rename the tag agent_host to match gNMI
  • 22. www.networktocode.com Network to Code Confidential Telegraf - Add metadata 22 [[processors.regex]] [processors.regex.tagpass] host = device1 [[processors.regex.tags]] key = "name" pattern = "^ge-0/0/0$" replacement = "management" result_key = "interfacerole" [[processors.regex.tags]] key = "name" pattern = "^ge-0/0/1$" replacement = "data" result_key = "interfacerole" Apply these rules only for measurement with a tag host=device1 If a tag name=ge-0/0/0 is present, add a tag interfacerole=management If a tag name=ge-0/0/1 is present, add a tag interfacerole=data
  • 23. www.networktocode.com Network to Code Confidential Demo Environment
  • 24. www.networktocode.com Network to Code Confidential Demo Environment
  • 25. www.networktocode.com Network to Code Confidential Recap • Collect Data from devices • Normalize the data • Enrich the data • Output the data • Dashboard of the data
  • 26. www.networktocode.com Network to Code Confidential What’s Next & Tips and Tricks
  • 27. www.networktocode.com Network to Code Confidential What we are trying to do next? • Flux language • InfluxDB 2.0 • InfluxDB IOx • Additional plugins - Input and Processor • Starlark processor
  • 28. www.networktocode.com Network to Code Confidential Telegraf Tips & Tricks • Automate configuration with templating - Ansible is a good choice • Run in Docker • Install SNMP MIB’s Locally • Use files output for troubleshooting • SNMP/gNMI won’t work? Look at writing your own executable with the execd plugins • Input Internal Plugin (about the Telegraf Plugin) • Consider running on device natively • Use the reachability plugins (Network Response, DNS) • Look at the Plugin Documentation (search “Telegraf Plugins”)
  • 29. www.networktocode.com Network to Code Confidential Monitor Your Network With gNMI, SNMP, and Grafana http://blog.networktocode.com/post/monitor_your_network_with_gnmi_snmp_and_grafana/ Network Telemetry for SNMP Devices http://blog.networktocode.com/post/network_telemetry_for_snmp_devices/ Monitoring Websites with Telegraf and Prometheus https://blog.networktocode.com/post/monitoring_websites_with_telegraf_and_prometheus/ Network to Code Blog Content
  • 30. www.networktocode.com Network to Code Confidential Thank You! /company/network-to-code/ @networktocode www.networktocode.com slack.networktocode.com
  • 31. www.networktocode.com Network to Code Confidential Appendix Items
  • 32. www.networktocode.com Network to Code Confidential [global_tags] device_role = "spine" [agent] hostname = "telegraf-r1" Telegraf-R1: Base Input Configuration [[inputs.snmp]] agents = ["r1"] version = 2 community = "${SNMP_COMMUNITY}" interval = "60s" timeout = "10s" retries = 3 [[inputs.snmp.table]] name = "interface" oid = "IF-MIB::ifXTable" [[inputs.snmp.table.field]] name = "name" oid = "IF-MIB::ifDescr" is_tag = true Cont.
  • 33. www.networktocode.com Network to Code Confidential Telegraf -R1 Data Normalization and Enrichment [[processors.rename]] [[processors.rename.replace]] field = "ifHCInOctets" dest = "in_octets" [[processors.rename.replace]] field = "ifHCOutOctets" dest = "out_octets" [[processors.rename.replace]] tag = "agent_host" dest = "device" [[processors.regex]] namepass = ["interface"] [[processors.regex.tags]] key = "name" pattern = "^GigaS+0$" replacement = "management" result_key = "intf_role" [[processors.regex.tags]] key = "name" pattern = "^GigaS+0/1$" replacement = "spine" result_key = "intf_role" [[processors.regex.tags]] key = "name" pattern = "^GigaS+0/2$" replacement = "backbone" result_key = "intf_role" Cont.
  • 34. www.networktocode.com Network to Code Confidential Telegraf -R1 Output InfluxDB and STDOUT [[outputs.influxdb]] urls = ["http://influxdb:8086"] [[outputs.file]] files = ["stdout"] data_format = "influx"
  • 35. www.networktocode.com Network to Code Confidential [global_tags] device_role = "spine" [agent] hostname = "telegraf-r2" Telegraf-R2: Base Input Configuration Cont. [[inputs.gnmi]] addresses = ["r2:6030"] username = "${GNMI_USER}" password = "${GNMI_PASSWORD}" redial = "10s" [[inputs.gnmi.subscription]] name = "interface" origin = "openconfig-interfaces" path = "/interfaces/interface/state/counters" subscription_mode = "sample" sample_interval = "5s"
  • 36. www.networktocode.com Network to Code Confidential Telegraf -R2 Data Normalization and Enrichment Cont. [[processors.rename]] [[processors.rename.replace]] tag = "source" dest = "device" [[processors.regex]] namepass = ["interface"] [[processors.regex.tags]] key = "name" pattern = "^Managementd+$" replacement = "management" result_key = "intf_role" [[processors.regex.tags]] key = "name" pattern = "^Ethernet1$" replacement = "spine" result_key = "intf_role" [[processors.regex.tags]] key = "name" pattern = "^Ethernet2$" replacement = "backbone" result_key = "intf_role"
  • 37. www.networktocode.com Network to Code Confidential Telegraf -R2 Output InfluxDB and STDOUT [[outputs.influxdb]] urls = ["http://influxdb:8086"] [[outputs.file]] files = ["stdout"] data_format = "influx"