{"id":19096554,"url":"https://github.com/sapcc/arista-eapi-exporter","last_synced_at":"2025-04-30T14:12:07.632Z","repository":{"id":41954541,"uuid":"144849612","full_name":"sapcc/arista-eapi-exporter","owner":"sapcc","description":"Arista exporter for Prometheus using the eAPI","archived":false,"fork":false,"pushed_at":"2024-07-23T09:45:04.000Z","size":44,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":46,"default_branch":"main","last_synced_at":"2024-07-23T11:51:53.735Z","etag":null,"topics":["arista","eos","prometheus-exporter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sapcc.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}},"created_at":"2018-08-15T12:21:32.000Z","updated_at":"2024-07-23T09:45:08.000Z","dependencies_parsed_at":"2024-02-01T22:41:33.864Z","dependency_job_id":"34602c26-ae9e-49ca-8ce1-a362529f1cf7","html_url":"https://github.com/sapcc/arista-eapi-exporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Farista-eapi-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Farista-eapi-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Farista-eapi-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Farista-eapi-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sapcc","download_url":"https://codeload.github.com/sapcc/arista-eapi-exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223783427,"owners_count":17201900,"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":["arista","eos","prometheus-exporter"],"created_at":"2024-11-09T03:37:05.176Z","updated_at":"2024-11-09T03:37:05.819Z","avatar_url":"https://github.com/sapcc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# arista-eapi-exporter\n\nThis is a Prometheus Exporter for extracting metrics from an Arista Switch using the Arista's eAPI and the Python Client for eAPI [pyeapi](https://pypi.org/project/pyeapi/).\n\nThe current implementation retrieves the memory usage data via `show hardware capacity` command and returns the table rows as a Gauge metric using some of the switches information as labels like the serial, the model, the firmware version and the hostname (arista_tcam).\nIt also returns a metric (arista_up) indicating if the switch was reachable or not and one returning the response time of the show version call (arista_response).\n\nFuture implementations could easily also gather other data from the switches.\n\nThe hostname of the switch has to be passed as **target parameter** in the http call.\n\n## Example Call\n\nif you are logged in to the POD running the exporter you can call\n\n```bash\ncurl http://localhost:9200/arista?target=eu-de-1-asw202-bm001.cc.eu-de-1.cloud.sap\n```\n\n## Prerequisites and Installation\n\nThe exporter was written for Python 3.6 or newer. To install all modules needed you have to run the following command:\n\n```bash\npip3 install --no-cache-dir -r requirements.txt\n```\n\nThere is also a docker file available to create a docker container to run the exporter.\n\n## The config.yml file\n\n* The **listen_port** is providing the port on which the exporter is waiting to receive calls.\n\n* The credentials for login to the switches can either be added to the config.yaml file or passed via environment variables `ARISTA_USERNAME` and `ARISTA_PASSWORD`. The environment overwrites the settings in the config file.\n\n* The **loglevel** can be specified in the config file. If omitted the default level is `INFO`.\n\n* The **timeout** parameter specifies the amount of time to wait for an answer from the switch. It can be defined in config.yaml ir passed via environment variable `TIMEOUT`. The environment overwrites the settings in the config file.\n\n* With the **exclude** parameter you can filter the output of the exporter. In the following example some of the tables are excluded.\n\n* The **job** parameter specifies the Prometheus job that will be passed as label.\n\n### Example of a config file\n\n```yaml\nlisten_port: 9200\nusername: \u003cyour username\u003e\npassword: \u003cyour password\u003e\nloglevel: \u003cINFO|DEBUG\u003e\ntimeout: 20\nexclude: ['NextHop', 'LPM', 'Host', 'MAC', 'VFP']\njob: arista\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapcc%2Farista-eapi-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsapcc%2Farista-eapi-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapcc%2Farista-eapi-exporter/lists"}