Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 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
- Created: 2018-08-15T12:42:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-26T07:49:48.000Z (over 2 years ago)
- Last Synced: 2023-03-25T13:18:06.875Z (almost 2 years ago)
- Topics: arista, netbox, prometheus
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 35
- 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
```