{"id":18722413,"url":"https://github.com/nleiva/xr-telegraf","last_synced_at":"2025-11-09T11:02:57.072Z","repository":{"id":87031030,"uuid":"201324811","full_name":"nleiva/xr-telegraf","owner":"nleiva","description":"Example of cool dashboard for Cisco IOS XR devices","archived":false,"fork":false,"pushed_at":"2019-08-09T19:49:25.000Z","size":35,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T14:50:02.475Z","etag":null,"topics":["cisco","cisco-ios-xr","grafana","influxdb","streaming-telemetry","telegraf"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nleiva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-08T19:33:29.000Z","updated_at":"2025-02-13T12:56:44.000Z","dependencies_parsed_at":"2023-05-30T07:15:20.895Z","dependency_job_id":null,"html_url":"https://github.com/nleiva/xr-telegraf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nleiva/xr-telegraf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nleiva%2Fxr-telegraf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nleiva%2Fxr-telegraf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nleiva%2Fxr-telegraf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nleiva%2Fxr-telegraf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nleiva","download_url":"https://codeload.github.com/nleiva/xr-telegraf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nleiva%2Fxr-telegraf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283496071,"owners_count":26845317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-09T02:00:05.828Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cisco","cisco-ios-xr","grafana","influxdb","streaming-telemetry","telegraf"],"created_at":"2024-11-07T13:41:21.076Z","updated_at":"2025-11-09T11:02:57.022Z","avatar_url":"https://github.com/nleiva.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# IOS XR Telegraf testing\n\nGetting started with Telegraf and IOS XR Streaming Telemetry.\n\n## Installing Telegraf\n\n- Install Go\n\n```bash\nwget https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz\nsudo rm -rf /usr/lib/go\nsudo tar -C /usr/local -xzf go1.12.7.linux-amd64.tar.gz\nexport GOROOT=/usr/local/go\nexport PATH=$PATH:$GOROOT/bin\n```\n\nValidate with `go version`.\n\n- Install Dep\n\n```bash\ngo get -d -u github.com/golang/dep \ncd $(go env GOPATH)/src/github.com/golang/dep\nDEP_LATEST=$(git describe --abbrev=0 --tags) \ngit checkout $DEP_LATEST\ngo install -ldflags=\"-X main.version=$DEP_LATEST\" ./cmd/dep \ngit checkout master\n```\n\n- Build Telegraf\n\n```bash\ndep ensure -vendor-only\nexport GO111MODULE=on\nexport GOPROXY=https://proxy.golang.org\ngo build -mod=vendor ./cmd/telegraf\n```\n\nConfig: [telegraf.conf](telegraf.conf).\n\n## Run InfluxDB\n\n- Run it on a Docker Container\n\n```bash\ndocker run -p 8086:8086 \\\n    -v $PWD:/var/lib/influxdb \\\n    influxdb\n```\n\nModify `$PWD` to the directory where you want to store data associated with the InfluxDB container.\n\n- Create a DB\n\n```bash\nexport MDT_DURATION=168\nexport MDT_SHARD=6\nMDT_DB=`echo q=CREATE DATABASE mdt_db WITH DURATION ${MDT_DURATION}h SHARD DURATION ${MDT_SHARD}h`\ncurl -s -XPOST http://localhost:8086/query --data-urlencode \"$MDT_DB\"\n```\n\nValidate with: `curl -s -XPOST http://localhost:8086/query --data-urlencode \"q=show databases\"`.\n\n## Run Grafana\n\n```bash\ndocker run \\\n  -d \\\n  -p 3000:3000 \\\n  --name=grafana \\\n  -e \"GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource,briangann-gauge-panel\" \\\n  -e \"GF_SECURITY_ADMIN_PASSWORD=secret\" \\\n  grafana/grafana\n```\n\nGrafana is now at: `http://\u003chost ip\u003e:3000` (admin/secret). Need to add InfluxDB as a data source.\n\n## Configure the router\n\n```bash\ngrpc\n port 57344\n address-family ipv4\n!\n```\n\n```bash\ntelemetry model-driven\n sensor-group Basics\n  sensor-path Cisco-IOS-XR-shellutil-oper:system-time/uptime\n  sensor-path Cisco-IOS-XR-mpls-te-oper:mpls-te/tunnels/summary\n  sensor-path Cisco-IOS-XR-pfi-im-cmd-oper:interfaces/interface-summary\n  sensor-path Cisco-IOS-XR-wdsysmon-fd-oper:system-monitoring/cpu-utilization\n  sensor-path Cisco-IOS-XR-nto-misc-oper:memory-summary/nodes/node/summary\n  sensor-path Cisco-IOS-XR-ip-rsvp-oper:rsvp/interface-briefs/interface-brief\n  sensor-path Cisco-IOS-XR-clns-isis-oper:isis/instances/instance/statistics-global\n  sensor-path Cisco-IOS-XR-ip-rsvp-oper:rsvp/counters/interface-messages/interface-message\n  sensor-path Cisco-IOS-XR-controller-optics-oper:optics-oper/optics-ports/optics-port/optics-info\n  sensor-path Cisco-IOS-XR-clns-isis-oper:isis/instances/instance/levels/level/adjacencies/adjacency\n  sensor-path Cisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface/latest/generic-counters\n  sensor-path Cisco-IOS-XR-ipv4-bgp-oper:bgp/instances/instance/instance-active/default-vrf/process-info\n  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/isis/as/information\n  sensor-path 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\n !\n subscription Dashboard\n  sensor-group-id Basics sample-interval 30000\n !\n```\n\n## Run Telegraf\n\nExecute this: `./telegraf --config telegraf.conf`.\n\n## Create Dashboard\n\nUse [dashboard.json](dashboard.json).\n\n### Querying the DB for troubleshooting\n\n```json\n$ curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode \"db=mdt_db\" --data-urlencode \"epoch=ms\"  --data-urlencode \"q=SELECT max(\\\"total-cpu-one-minute\\\") FROM \\\"Cisco-IOS-XR-wdsysmon-fd-oper:system-monitoring/cpu-utilization\\\"\"\n{\n    \"results\": [\n        {\n            \"statement_id\": 0,\n            \"series\": [\n                {\n                    \"name\": \"Cisco-IOS-XR-wdsysmon-fd-oper:system-monitoring/cpu-utilization\",\n                    \"columns\": [\n                        \"time\",\n                        \"max\"\n                    ],\n                    \"values\": [\n                        [\n                            1565292318129,\n                            2\n                        ]\n                    ]\n                }\n            ]\n        }\n    ]\n}\n```\n\n```json\n$ curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode \"db=mdt_db\" --data-urlencode \"epoch=ms\" --data-urlencode \"q=SELECT \\\"adjacency-interface\\\" FROM \\\"Cisco-IOS-XR-clns-isis-oper:isis/instances/instance/levels/level/adjacencies/adjacency\\\" WHERE (\"Producer\" =~ /^mrstn-5501-2\\.cisco\\.com$/ AND time \u003e= now() - 60m)\"\n{\n    \"results\": [\n        {\n            \"statement_id\": 0,\n            \"series\": [\n                {\n                    \"name\": \"Cisco-IOS-XR-clns-isis-oper:isis/instances/instance/levels/level/adjacencies/adjacency\",\n                    \"columns\": [\n                        \"time\",\n                        \"adjacency-interface\"\n                    ],\n                    \"values\": [\n                        [\n                            1565377154666,\n                            \"HundredGigE0/0/1/0\"\n                        ],\n                        [\n                            1565377154666,\n                            \"HundredGigE0/0/1/1\"\n                        ],\n                        [\n                            1565377154666,\n                            \"HundredGigE0/0/1/2\"\n                        ],\n                        ...\n```\n\n## Links\n\n- [IOS XR Plugin](https://github.com/ios-xr/telegraf-plugin)\n- [Cisco GNMI Telemetry](https://docs.influxdata.com/telegraf/v1.11/plugins/plugin-list/#cisco_telemetry_gnmi)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnleiva%2Fxr-telegraf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnleiva%2Fxr-telegraf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnleiva%2Fxr-telegraf/lists"}