Closed nvollmar closed 1 year ago
This warning is originating from python urllib3
. Not something which can be fixed in prometheus-pve-exporter
.
This would fix it though:
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
@znerol I can't find where verify_ssl
setting would have an effect:
https://github.com/prometheus-pve/prometheus-pve-exporter/search?q=verify_ssl
verify_ssl
is passed directly to proxmoxer/proxmoxer.
@nvollmar: Did you see proxmoxer/proxmoxer#128 ? Does upgrading proxmoxer to 2.0.1 fix the problem you are having?
Thanks for the hint, I'll look into that.
Tested proxmoxer 2.0.1, still the same issue. Downgraded to 1.3.1 (latest version before 2.0.0) which solved it.
This is a super crude way to fix this, but until proxmoxer updates their utilization of the requests library, it seems like this is the only way to do it without editing the library code:
I changed the service to set the environment variable: PYTHONWARNINGS=ignore
The service declaration of my systemd service now looks like:
$ systemctl cat prometheus-pve-exporter.service
# /etc/systemd/system/prometheus-pve-exporter.service
[Unit]
Description=Prometheus Proxmox VE Exporter
Documentation=https://github.com/prometheus-pve/prometheus-pve-exporter
[Service]
Environment=PYTHONWARNINGS=ignore
Restart=always
User=pve-exporter
ExecStart=/opt/prometheus-pve-exporter/bin/pve_exporter /etc/prometheus/pve.yml
[Install]
WantedBy=multi-user.target
After that, reload the systemd daemon: systemctl daemon-reload
and restart the application: systemctl restart prometheus-pve-exporter.service
Note, that this will also squash other legitimate python warnings, but most people probably aren't looking at the service output anyway.
Just to complement the last answer, you can also do:
PYTHONWARNINGS=ignore:Unverified HTTPS request
Tried with verify_ssl: false but still get this warning on every scrape