qBittorrent WebUI Prometheus Metrics Exporter
- TypeScript 97.6%
- Dockerfile 2.4%
| src | ||
| .gitignore | ||
| Dockerfile | ||
| package.json | ||
| pnpm-lock.yaml | ||
| readme.md | ||
| tsconfig.json | ||
Prometheus Exporter for qBittorrent
Running
Create .env and fill it's contents like shown below:
QBIT_WEBUI_URL=<Your qBittorrent WebUI URL (with schema)>
QBIT_WEBUI_USER=<WebUI username>
QBIT_WEBUI_PASSWORD=<WebUI password>
Example with actual values:
QBIT_WEBUI_URL=http://192.168.67.15:8080
QBIT_WEBUI_USER=admin
QBIT_WEBUI_PASSWORD=qwerty12345
Then run:
pnpm build && pnpm start
Exporter will now listen on port 9167 by default on all interfaces
You can go to your browser and check the metrics at http://127.0.0.1:9167/metrics
After running you can setup your prometheus like with any other exporter:
# assuming you are running both prometheus and this exporter on the same machine
# without containers and etc. otherwise change the target address
...
scrape_configs:
...
- job_name: 'qbittorrent'
scrape_interval: 15s
scrape_timeout: 15s
static_configs:
- targets: ['127.0.0.1:9167']
Docker
Build the image
sudo docker buildx build -t qbt_exporter:0.0.1 .
Run non-persistent container for testing
sudo docker run --rm --env-file .env -p 9167:9167 -it qbt_exporter:0.0.1
Persistent setup with compose (build the image before running)
- Create
compose.yamlwith following content:services: qbt_exporter: image: qbt_exporter:0.0.1 restart: always ports: - "9167:9167" env_file: - ./.env deploy: resources: limits: memory: 256M - Start your deployment:
sudo docker compose up -d