{"id":20593797,"url":"https://github.com/dsx1123/telemetry_collector","last_synced_at":"2025-06-28T17:36:02.321Z","repository":{"id":42459987,"uuid":"278292271","full_name":"dsx1123/telemetry_collector","owner":"dsx1123","description":"build telemetry software stack for Cisco nx-os, support both telemetry dial-out and gNMI dial-in","archived":false,"fork":false,"pushed_at":"2024-05-20T17:22:45.000Z","size":682,"stargazers_count":75,"open_issues_count":0,"forks_count":24,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-21T23:43:09.416Z","etag":null,"topics":["bash","chronograf","cisco","docker","influxdb","nxos","telegraf","telemetry"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsx1123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2020-07-09T07:18:23.000Z","updated_at":"2025-03-28T08:08:26.000Z","dependencies_parsed_at":"2024-01-23T05:28:30.204Z","dependency_job_id":"d3ec2de9-5c1c-4d7d-8590-c8d8a05e6431","html_url":"https://github.com/dsx1123/telemetry_collector","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dsx1123/telemetry_collector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsx1123%2Ftelemetry_collector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsx1123%2Ftelemetry_collector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsx1123%2Ftelemetry_collector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsx1123%2Ftelemetry_collector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsx1123","download_url":"https://codeload.github.com/dsx1123/telemetry_collector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsx1123%2Ftelemetry_collector/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262470257,"owners_count":23316465,"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","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":["bash","chronograf","cisco","docker","influxdb","nxos","telegraf","telemetry"],"created_at":"2024-11-16T07:49:47.266Z","updated_at":"2025-06-28T17:36:02.300Z","avatar_url":"https://github.com/dsx1123.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# telemetry_collector\nAutomatically build telemetry collector with [Telegraf](https://github.com/influxdata/telegraf), [Influxdb](https://github.com/influxdata/influxdb), and [Grafana](https://github.com/grafana/grafana), the example of sensor paths is using the native yang model and OpenConfig yang model of NX-OS as an example. `build.sh` script will create self-signed certificates for TLS transport. Using docker images of Telegraf, Influxdb, and Grafana to create containers with docker-compose. tested with `telegraf \u003e= 1.12.1`, `influxdb \u003e= 2.0` and `grafana\u003e=8.1`.\n\n# NOTE:\nThis project has upgraded the Influxdb to 2.0 which is not supported by Chronograf anymore, the dashboard is changed to Grafana with a new set of sensor paths. original code is moved to branch [chronograf_influxdb_1_x](https://github.com/dsx1123/telemetry_collector/tree/chronograf_influxdb_1_x)\n# Screenshoot\n![gnmi dashboard](https://github.com/dsx1123/telemetry_collector/blob/master/examples/gnmi.png?raw=true)\n## Requirements:\ndocker-ce, OpenSSL, docker-compose, any Linux distribution, see Known Issues if trying it on MacOS\n## How to use\n\n 1. To quickly start, set environment variables `GNMI_USER` and `GNMI_PASSWORD`, this user needs to be configured on nxos with a network-operator role at least, then use `sudo ./build.sh start` to start the containers:\n    ```bash\n    export GNMI_USER=telemetry\n    export GNMI_PASSWORD=SuperSecretPassword\n    ./build.sh start\n    ```\n    ```\n    2020-07-30T22:49:02--LOG--influxdb database folder does not exist, creating one\n    2020-07-30T22:49:02--LOG--change permission of config and data folder of influxdb\n    2020-07-30T22:49:02--LOG--generating self-signed certificates for telegraf plugins\n    2020-07-30T22:49:02--LOG--telegraf certificate does not exist, generating\n    2020-07-30T22:49:02--LOG--gernerating private key for CN telegraf\n    ...\u003commited\u003e\n    ```\n\n    By default, telegraf listens on `tcp:57000` for gRPC dial-out, if you want to modify the port, change the config file `etc/telegraf/telegraf.conf.example` in the project folder\n\n    gnmi dial-in is also enabled by default,  modify the `switches` in `build.sh` with mgmt address and grpc port:\n\n    ```ini\n    # swtiches accept gNMI dial-in\n    switches=( \"172.25.74.70:50051\" \"172.25.74.61:50051\" )\n    ```\n    When first starting the service, the script will check if certificates are generated, if not, it will create them for mdt and gnmi plugins to validate for 10 years.\n    use `http://\u003cip_address_of_host\u003e:3000 ` to open Grafana gui. login is `grafana/cisco123`\n\n2. TLS is enabled on cisco_telemetry_mdt plugin, comment below lines in `etc/telegraf/telegraf.conf` to disable it:\n    ```ini\n    # uncomment below to enable tls for dial-out plguin\n    tls_cert = \"/etc/telegraf/cert/telegraf.crt\"\n    tls_key = \"/etc/telegraf/cert/telegraf.key\"\n    ```\n    certificate `./etc/telegraf/cert/telegraf.crt` need be copied to nx-os to verify the collector's identity, then use the below command to enable TLS transport for the destination group, the `\u003ccertificate name\u003e`  needs to match the common name of `telegraf.crt`, it is set to `telegraf` in `build.sh`:\n    ```\n    switch(config)# telemetry\n    switch(config-telemetry)# destination-group 1\n    switch(conf-tm-dest)# ip address \u003ccollector address\u003e port 57000 protocol gRPC encoding GPB\n    switch(conf-tm-dest)# certificate /bootflash/telegraf.crt \u003ccertificate name\u003e\n\n    ```\n\n3. TLS need to be enabled for the gNMI plugin as well as nx-os, when configuring feature gRPC on a switch, a default certificate with 1-day validation is auto-generated, to configure the certificate for gRPC on nx-os, copy `etc/telegraf/cert/gnmi.pfx` to bootflash, then use below commands to import the certificate, the `\u003cexport password\u003e` is set to `cisco123` by default, you could modify it in `build.sh`, these steps are optional as the gnmi plugin in telegraf is set to disable certificate verification. \n    ```\n    switch(config)# crypto ca trustpoint gnmi_trustpoint\n    switch(config-trustpoint)# crypto ca import gnmi_trustpoint pkcs12 bootflash:gnmi.pfx \u003cexport password\u003e\n    switch(config)# grpc certificate gnmi_trustpoint\n    ```\n\n4. This tool will import a couple of pre-built dashboards:\n   -  The `fabric dashboard dialout` is an example of querying data from telemetry dial-out, you can find the example of the switch telemetry config that is used for this dashboard in [telemetry.cfg](/examples/telemetry.cfg).\n   -  The `fabric dashboard gnmi` is an example of querying data from gNMI dial-in.\n   -  The `Endpoints` shows the arp tables and Mac address tables of all the switches.\n   -  The `Interface Counters` shows all kinds of interface counters that is collected using the Openconfig model.\n   -  The `System Capacity` shows the current system utilization of NX-OS using metric collected from [icam](https://www.cisco.com/c/en/us/td/docs/dcn/nx-os/nexus9000/103x/configuration/icam/cisco-nexus-9000-series-nx-os-icam-configuration-guide-release-103x.html)\n\n6. Example of telegraf configuration can be found below:\n   - [telegraf.conf.example](etc/telegraf/telegraf.conf.example) example of cisco_telemetry_mdt config\n   - [gnmi.conf.example](etc/telegraf/telegraf.d/gnmi.conf.example) exmaple of gnmi plugin config\n\n## Known issue\n1. Before NX-OS 10.1(1), a single subscription of gNMI dial-in can only be SAMPLE or ON_CHANGE, not both. In order to configure different types of subscriptions, need to start two telegraf instances to separate SAMPLE and ON_CHANGE sensor paths.\nPlease take a look at enhancement [CSCvu58102](https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvu58102) for detail.\n2. MacOS uses the BSD version of sed by default which doesn't work with this script, use `brew install gnu-sed` to install the gnu version of sed if you are trying this script on MacOS.\n\n## Reference\n1. [Cisco Nexus 9000 Series NX-OS Programmability Guide, Release 10.3(x)](https://www.cisco.com/c/en/us/td/docs/dcn/nx-os/nexus9000/103x/programmability/cisco-nexus-9000-series-nx-os-programmability-guide-release-103x.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsx1123%2Ftelemetry_collector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsx1123%2Ftelemetry_collector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsx1123%2Ftelemetry_collector/lists"}