104 lines
3.4 KiB
Markdown
104 lines
3.4 KiB
Markdown
# PVE Exporter
|
|
|
|
Proxmox Virtual Environment Prometheus metrics exporter.
|
|
|
|
## Overview
|
|
|
|
PVE Exporter is a tool that collects metrics from a Proxmox Virtual Environment cluster and exposes them for Prometheus to scrape. This exporter supports gathering metrics for cluster state, LXC containers, QEMU virtual machines, physical disks, node storage, node status, node subscription details, and software-defined networking (SDN).
|
|
|
|
## Features
|
|
|
|
- Collects various metrics from Proxmox VE to monitor the health and performance of your virtual environment.
|
|
- Supports multi-node clusters for high availability.
|
|
- Securely uses Proxmox API tokens with minimal permissions.
|
|
|
|
## Prerequisites
|
|
|
|
- Docker installed on your machine.
|
|
- Access to a Proxmox VE instance with API tokens configured.
|
|
|
|
## Configuration
|
|
|
|
### Proxmox API Token
|
|
|
|
When generating the token, make sure to assign the 'PVEAuditor' permission to both the user and the API token. For security reasons, assign only the 'PVEAuditor' role to limit permissions appropriately.
|
|
|
|
```yaml
|
|
# Proxmox API token configuration.
|
|
token:
|
|
tokenId: "your-token-id"
|
|
secret: "your-secret"
|
|
```
|
|
|
|
### Proxmox API Hosts
|
|
|
|
If you are running a multi-node cluster, add multiple API hosts to ensure high availability of metrics. Note that this configuration is not intended for gathering metrics from multiple PVE clusters. For multiple PVE clusters, deploy a separate exporter instance for each cluster.
|
|
|
|
```yaml
|
|
# Proxmox API hosts.
|
|
hosts:
|
|
- "https://host1.example.com"
|
|
- "https://host2.example.com"
|
|
```
|
|
|
|
### Metrics Configuration
|
|
|
|
Configure which metrics to collect by enabling or disabling specific metric types.
|
|
|
|
```yaml
|
|
# Proxmox metrics configuration.
|
|
metrics:
|
|
clusterState: true # Enable collection of cluster state metrics.
|
|
ltc: true # Enable collection of LXC container metrics.
|
|
qemu: true # Enable collection of QEMU virtual machine metrics.
|
|
disk: true # Enable collection of physical disk metrics.
|
|
storage: true # Enable collection of node storage metrics.
|
|
nodeStatus: true # Enable collection of node status metrics.
|
|
subscription: true # Enable collection of node subscription details.
|
|
sdn: true # Enable collection of software-defined network (SDN) metrics.
|
|
```
|
|
|
|
## Build
|
|
|
|
To build the Docker image for PVE Exporter, use the following command:
|
|
|
|
```sh
|
|
docker build --rm -t harbor.imtm.cz/private/pve-exporter:version .
|
|
```
|
|
|
|
Replace `version` with the appropriate version tag you want to use.
|
|
|
|
## Run
|
|
|
|
To run the Docker image, use the following command:
|
|
|
|
```sh
|
|
docker run --rm -d -p 9090:9090 --name pve-exporter harbor.imtm.cz/private/pve-exporter:version
|
|
```
|
|
|
|
Replace `version` with the appropriate version tag you used during the build.
|
|
|
|
## Usage
|
|
|
|
Once the Docker container is running, the exporter will be available on port `9090`. You can configure Prometheus to scrape metrics from the exporter by adding a new scrape configuration to your Prometheus configuration file.
|
|
|
|
Example Prometheus scrape configuration:
|
|
|
|
```yaml
|
|
scrape_configs:
|
|
- job_name: 'pve-exporter'
|
|
static_configs:
|
|
- targets: ['localhost:9090']
|
|
```
|
|
|
|
## License
|
|
|
|
This project is licensed under the MIT License. See the LICENSE.txt file for details.
|
|
|
|
## Contributing
|
|
|
|
Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or bug fixes.
|
|
|
|
## Support
|
|
|
|
If you encounter any issues or have questions, please open an issue on the project's GitHub repository. |