mirror of
https://github.com/NohamR/prometheus-qbittorrent-exporter.git
synced 2025-05-23 16:49:29 +00:00
Added an option to verify web UI SSL certificate or not
This commit is contained in:
parent
70ec628045
commit
5773684369
19
README.md
19
README.md
@ -34,15 +34,16 @@ Add this to your prometheus.yml
|
|||||||
```
|
```
|
||||||
The application reads configuration using environment variables:
|
The application reads configuration using environment variables:
|
||||||
|
|
||||||
| Environment variable | Default | Description |
|
| Environment variable | Default | Description |
|
||||||
| -------------------- | ------------- | ----------- |
|
| -------------------------- | ------------- | ----------- |
|
||||||
| `QBITTORRENT_HOST` | | qbittorrent server hostname |
|
| `QBITTORRENT_HOST` | | qbittorrent server hostname |
|
||||||
| `QBITTORRENT_PORT` | | qbittorrent server port |
|
| `QBITTORRENT_PORT` | | qbittorrent server port |
|
||||||
| `QBITTORRENT_USER` | `""` | qbittorrent username |
|
| `QBITTORRENT_USER` | `""` | qbittorrent username |
|
||||||
| `QBITTORRENT_PASS` | `""` | qbittorrent password |
|
| `QBITTORRENT_PASS` | `""` | qbittorrent password |
|
||||||
| `EXPORTER_PORT` | `8000` | Exporter listening port |
|
| `EXPORTER_PORT` | `8000` | Exporter listening port |
|
||||||
| `EXPORTER_LOG_LEVEL` | `INFO` | Log level. One of: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL` |
|
| `EXPORTER_LOG_LEVEL` | `INFO` | Log level. One of: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL` |
|
||||||
| `METRICS_PREFIX` | `qbittorrent` | Prefix to add to all the metrics |
|
| `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
|
## Metrics
|
||||||
|
@ -34,6 +34,7 @@ class QbittorrentMetricsCollector():
|
|||||||
port=config["port"],
|
port=config["port"],
|
||||||
username=config["username"],
|
username=config["username"],
|
||||||
password=config["password"],
|
password=config["password"],
|
||||||
|
VERIFY_WEBUI_CERTIFICATE=config["verify_webui_certificate"]
|
||||||
)
|
)
|
||||||
|
|
||||||
def collect(self):
|
def collect(self):
|
||||||
@ -187,6 +188,7 @@ def main():
|
|||||||
"exporter_port": int(get_config_value("EXPORTER_PORT", "8000")),
|
"exporter_port": int(get_config_value("EXPORTER_PORT", "8000")),
|
||||||
"log_level": get_config_value("EXPORTER_LOG_LEVEL", "INFO"),
|
"log_level": get_config_value("EXPORTER_LOG_LEVEL", "INFO"),
|
||||||
"metrics_prefix": get_config_value("METRICS_PREFIX", "qbittorrent"),
|
"metrics_prefix": get_config_value("METRICS_PREFIX", "qbittorrent"),
|
||||||
|
"verify_webui_certificate": get_config_value("VERIFY_WEBUI_CERTIFICATE", "True") == "True",
|
||||||
}
|
}
|
||||||
# set level once config has been loaded
|
# set level once config has been loaded
|
||||||
logger.setLevel(config["log_level"])
|
logger.setLevel(config["log_level"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user