https://github.com/sapcc/arista_sd
Custom Prometheus service discovery to get the hostnames of Arista switches from Netbox
https://github.com/sapcc/arista_sd
arista netbox prometheus
Last synced: 6 months ago
JSON representation
Custom Prometheus service discovery to get the hostnames of Arista switches from Netbox
- Host: GitHub
- URL: https://github.com/sapcc/arista_sd
- Owner: sapcc
- License: apache-2.0
- Archived: true
- Created: 2018-08-15T12:42:34.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-06-26T07:49:48.000Z (over 3 years ago)
- Last Synced: 2025-02-19T18:47:20.425Z (8 months ago)
- Topics: arista, netbox, prometheus
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 49
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# arista_sd
Custom Prometheus service discovery to get arista switch hostnames of baremetal PODs from [Netbox](https://netbox.readthedocs.io/en/latest/).
The targets are written into a configmap using the Python [Kubernetes Client](https://pypi.org/project/kubernetes/)## Prerequisites and Installation
The service discovery was written for Python 3.6 or newer. To install all modules needed you have to run the following command:
```bash
pip3 install --no-cache-dir -r requirements.txt
```There is also a docker file available to create a docker container to run the exporter.
## The config.yml file
* The **netbox** entry is pointing at the url of the netbox installation.
* **configmap** is the name of the configmap file to write to. The actual configmap name has to be passed via environment variable `OS_PROM_CONFIGMAP_NAME`.
* The **job** parameter specifies the Prometheus job that will be passed as label.
* The **refresh_interval** (in seconds) can either be specified via config file or via environment variable `REFRESH_INTERVAL`. The environment overwrites the setting in the config file.
* **namespace** is the Kubernetes Name Space of Prometheus.### Example of a config file
```text
netbox: netbox.global.cloud.sap
configmap: arista_targets.json
job: arista
refresh_interval: 1800
namespace: kube-monitoring
```