# Prometheus qBittorrent exporter
<p align="center">
<img src="https://raw.githubusercontent.com/esanchezm/prometheus-qbittorrent-exporter/master/logo.png" height="230">
</p>
A prometheus exporter for qBitorrent. Get metrics from a server and offers them in a prometheus format.
![](https://img.shields.io/github/license/esanchezm/prometheus-qbittorrent-exporter?style=for-the-badge) ![](https://img.shields.io/maintenance/yes/2023?style=for-the-badge) ![](https://img.shields.io/docker/pulls/esanchezm/prometheus-qbittorrent-exporter?style=for-the-badge) ![](https://img.shields.io/github/forks/esanchezm/prometheus-qbittorrent-exporter?style=for-the-badge) ![](https://img.shields.io/github/stars/esanchezm/prometheus-qbittorrent-exporter?style=for-the-badge) ![](https://img.shields.io/python/required-version-toml?tomlFilePath=https://raw.githubusercontent.com/esanchezm/prometheus-qbittorrent-exporter/master/pyproject.toml&style=for-the-badge) [![Coverage badge](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/esanchezm/prometheus-qbittorrent-exporter/python-coverage-comment-action-data/endpoint.json&label=tests%20coverage&style=for-the-badge)](https://htmlpreview.github.io/?https://github.com/esanchezm/prometheus-qbittorrent-exporter/blob/python-coverage-comment-action-data/htmlcov/index.html)
## How to use it
You can install this exporter with the following command:
```bash
pip3 install prometheus-qbittorrent-exporter
```
Then you can run it with
```
qbittorrent-exporter
```
Another option is run it in a docker container.
```
docker run \
-e QBITTORRENT_PORT=8080 \
-e QBITTORRENT_HOST=myserver.local \
-p 8000:8000 \
ghcr.io/esanchezm/prometheus-qbittorrent-exporter
```
Add this to your prometheus.yml
```
- job_name: "qbittorrent_exporter"
static_configs:
- targets: ['yourqbittorrentexporter:port']
```
The application reads configuration using environment variables:
| Environment variable | Default | Description |
| -------------------------- | ------------- | ----------- |
| `QBITTORRENT_HOST` | | qbittorrent server hostname |
| `QBITTORRENT_PORT` | | qbittorrent server port |
| `QBITTORRENT_SSL` | `False` | Whether to use SSL to connect or not. Will be forced to `True` when using port 443 |
| `QBITTORRENT_URL_BASE` | `""` | qbittorrent server path or base URL |
| `QBITTORRENT_USER` | `""` | qbittorrent username |
| `QBITTORRENT_PASS` | `""` | qbittorrent password |
| `EXPORTER_PORT` | `8000` | Exporter listening port |
| `EXPORTER_LOG_LEVEL` | `INFO` | Log level. One of: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL` |
| `METRICS_PREFIX` | `qbittorrent` | Prefix to add to all the metrics |
| `VERIFY_WEBUI_CERTIFICATE` | `True` | Whether to verify SSL certificate when connecting to the qbittorrent server. Any other value but `True` will disable the verification |
## Metrics
These are the metrics this program exports, assuming the `METRICS_PREFIX` is `qbittorrent`:
| Metric name | Type | Description |
| --------------------------------------------------- | -------- | ---------------- |
| `qbittorrent_up` | gauge | Whether the qBittorrent server is answering requests from this exporter. A `version` label with the server version is added. |
| `qbittorrent_connected` | gauge | Whether the qBittorrent server is connected to the Bittorrent network. |
| `qbittorrent_firewalled` | gauge | Whether the qBittorrent server is connected to the Bittorrent network but is behind a firewall. |
| `qbittorrent_dht_nodes` | gauge | Number of DHT nodes connected to. |
| `qbittorrent_dl_info_data` | counter | Data downloaded since the server started, in bytes. |
| `qbittorrent_up_info_data` | counter | Data uploaded since the server started, in bytes. |
| `qbittorrent_alltime_dl_total` | counter | Total historical data downloaded, in bytes. |
| `qbittorrent_alltime_ul_total` | counter | Total historical data uploaded, in bytes. |
| `qbittorrent_torrents_count` | gauge | Number of torrents for each `category` and `status`. Example: `qbittorrent_torrents_count{category="movies",status="downloading"}`|
## Screenshot
![](./grafana/screenshot.png)
[More info](./grafana/README.md)
## License
This software is released under the [GPLv3 license](LICENSE).
Raw data
{
"_id": null,
"home_page": "",
"name": "prometheus-qbittorrent-exporter",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "",
"keywords": "prometheus qbittorrent",
"author": "",
"author_email": "Esteban Sanchez <esteban.sanchez@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/89/8a/6fb92567de0ce0f61eae0173d6a9771a91631a18cd0508a502c5b81d2ea4/prometheus_qbittorrent_exporter-1.5.1.tar.gz",
"platform": null,
"description": "# Prometheus qBittorrent exporter\n\n<p align=\"center\">\n<img src=\"https://raw.githubusercontent.com/esanchezm/prometheus-qbittorrent-exporter/master/logo.png\" height=\"230\">\n</p>\n\nA prometheus exporter for qBitorrent. Get metrics from a server and offers them in a prometheus format.\n\n![](https://img.shields.io/github/license/esanchezm/prometheus-qbittorrent-exporter?style=for-the-badge) ![](https://img.shields.io/maintenance/yes/2023?style=for-the-badge) ![](https://img.shields.io/docker/pulls/esanchezm/prometheus-qbittorrent-exporter?style=for-the-badge) ![](https://img.shields.io/github/forks/esanchezm/prometheus-qbittorrent-exporter?style=for-the-badge) ![](https://img.shields.io/github/stars/esanchezm/prometheus-qbittorrent-exporter?style=for-the-badge) ![](https://img.shields.io/python/required-version-toml?tomlFilePath=https://raw.githubusercontent.com/esanchezm/prometheus-qbittorrent-exporter/master/pyproject.toml&style=for-the-badge) [![Coverage badge](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/esanchezm/prometheus-qbittorrent-exporter/python-coverage-comment-action-data/endpoint.json&label=tests%20coverage&style=for-the-badge)](https://htmlpreview.github.io/?https://github.com/esanchezm/prometheus-qbittorrent-exporter/blob/python-coverage-comment-action-data/htmlcov/index.html)\n\n## How to use it\n\nYou can install this exporter with the following command:\n\n```bash\npip3 install prometheus-qbittorrent-exporter\n```\n\nThen you can run it with\n\n```\nqbittorrent-exporter\n```\n\nAnother option is run it in a docker container.\n\n```\ndocker run \\\n -e QBITTORRENT_PORT=8080 \\\n -e QBITTORRENT_HOST=myserver.local \\\n -p 8000:8000 \\\n ghcr.io/esanchezm/prometheus-qbittorrent-exporter\n```\nAdd this to your prometheus.yml\n```\n - job_name: \"qbittorrent_exporter\"\n static_configs:\n - targets: ['yourqbittorrentexporter:port']\n```\nThe application reads configuration using environment variables:\n\n| Environment variable | Default | Description |\n| -------------------------- | ------------- | ----------- |\n| `QBITTORRENT_HOST` | | qbittorrent server hostname |\n| `QBITTORRENT_PORT` | | qbittorrent server port |\n| `QBITTORRENT_SSL` | `False` | Whether to use SSL to connect or not. Will be forced to `True` when using port 443 |\n| `QBITTORRENT_URL_BASE` | `\"\"` | qbittorrent server path or base URL |\n| `QBITTORRENT_USER` | `\"\"` | qbittorrent username |\n| `QBITTORRENT_PASS` | `\"\"` | qbittorrent password |\n| `EXPORTER_PORT` | `8000` | Exporter listening port |\n| `EXPORTER_LOG_LEVEL` | `INFO` | Log level. One of: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL` |\n| `METRICS_PREFIX` | `qbittorrent` | Prefix to add to all the metrics |\n| `VERIFY_WEBUI_CERTIFICATE` | `True` | Whether to verify SSL certificate when connecting to the qbittorrent server. Any other value but `True` will disable the verification |\n\n\n## Metrics\n\nThese are the metrics this program exports, assuming the `METRICS_PREFIX` is `qbittorrent`:\n\n\n| Metric name | Type | Description |\n| --------------------------------------------------- | -------- | ---------------- |\n| `qbittorrent_up` | gauge | Whether the qBittorrent server is answering requests from this exporter. A `version` label with the server version is added. |\n| `qbittorrent_connected` | gauge | Whether the qBittorrent server is connected to the Bittorrent network. |\n| `qbittorrent_firewalled` | gauge | Whether the qBittorrent server is connected to the Bittorrent network but is behind a firewall. |\n| `qbittorrent_dht_nodes` | gauge | Number of DHT nodes connected to. |\n| `qbittorrent_dl_info_data` | counter | Data downloaded since the server started, in bytes. |\n| `qbittorrent_up_info_data` | counter | Data uploaded since the server started, in bytes. |\n| `qbittorrent_alltime_dl_total` | counter | Total historical data downloaded, in bytes. |\n| `qbittorrent_alltime_ul_total` | counter | Total historical data uploaded, in bytes. |\n| `qbittorrent_torrents_count` | gauge | Number of torrents for each `category` and `status`. Example: `qbittorrent_torrents_count{category=\"movies\",status=\"downloading\"}`|\n\n## Screenshot\n\n![](./grafana/screenshot.png)\n\n[More info](./grafana/README.md)\n\n## License\n\nThis software is released under the [GPLv3 license](LICENSE).\n",
"bugtrack_url": null,
"license": "GPL-3.0",
"summary": "Prometheus exporter for qbittorrent",
"version": "1.5.1",
"project_urls": {
"Downloads": "https://github.com/esanchezm/prometheus-qbittorrent-exporter/archive/1.5.1.tar.gz",
"Homepage": "https://github.com/esanchezm/prometheus-qbittorrent-exporter"
},
"split_keywords": [
"prometheus",
"qbittorrent"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "354c2f9561b34aa8cbebdc2ace4f479a8b283f288f06c07be8a1269feb8be1f8",
"md5": "0c3e4946cb154c7ef2b9253d4c82bf6f",
"sha256": "9c5f2397a7bcb0af73676bafc7ceb8e1914612124c5103a5571ef4d6a92589ed"
},
"downloads": -1,
"filename": "prometheus_qbittorrent_exporter-1.5.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0c3e4946cb154c7ef2b9253d4c82bf6f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 18841,
"upload_time": "2024-01-19T22:14:19",
"upload_time_iso_8601": "2024-01-19T22:14:19.510463Z",
"url": "https://files.pythonhosted.org/packages/35/4c/2f9561b34aa8cbebdc2ace4f479a8b283f288f06c07be8a1269feb8be1f8/prometheus_qbittorrent_exporter-1.5.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "898a6fb92567de0ce0f61eae0173d6a9771a91631a18cd0508a502c5b81d2ea4",
"md5": "a3861157e1ae59e22b1607b5ac5cf192",
"sha256": "3faf451ff89ab1e2c0ec26a62912093c72cbe896100764148867ac1a35337f12"
},
"downloads": -1,
"filename": "prometheus_qbittorrent_exporter-1.5.1.tar.gz",
"has_sig": false,
"md5_digest": "a3861157e1ae59e22b1607b5ac5cf192",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 20758,
"upload_time": "2024-01-19T22:14:21",
"upload_time_iso_8601": "2024-01-19T22:14:21.366194Z",
"url": "https://files.pythonhosted.org/packages/89/8a/6fb92567de0ce0f61eae0173d6a9771a91631a18cd0508a502c5b81d2ea4/prometheus_qbittorrent_exporter-1.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-19 22:14:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "esanchezm",
"github_project": "prometheus-qbittorrent-exporter",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "prometheus-qbittorrent-exporter"
}