Closed martinjgrunwald closed 2 years ago
same
i enabled verbose mode and got this
TRACE prometheus_wireguard_exporter] wg show all dump stderr == Unable to access interface wg0: Operation not permitted
Hello,
If anyone reading this issue, you have to be net host
for the exporter to see the wireguard interface.
Also, I found out that when running inside a container with the 3.6.1
version, you need to add the PROMETHEUS_WIREGUARD_EXPORTER_PREPEND_SUDO_ENABLED
env var.
My compose:
prometheus-wireguard-exporter:
image: mindflavor/prometheus-wireguard-exporter:3.6.1
restart: unless-stopped
cap_add:
- NET_ADMIN
network_mode: host
environment:
TZ: Europe/Paris
PROMETHEUS_WIREGUARD_EXPORTER_PREPEND_SUDO_ENABLED: true
PROMETHEUS_WIREGUARD_EXPORTER_ADDRESS: 127.0.0.1
PROMETHEUS_WIREGUARD_EXPORTER_INTERFACES: wg0
PROMETHEUS_WIREGUARD_EXPORTER_EXPORT_REMOTE_IP_AND_PORT_ENABLED: true
Thank you so much! My Problem was both the PROMETHEUS_WIREGUARD_EXPORTER_PREPEND_SUDO_ENABLED
env var and the network_mode: host
. I guess I never tried these two together.
My compose now looks like this:
version: "3"
services:
wireguard-exporter:
image: mindflavor/prometheus-wireguard-exporter:latest
container_name: wireguard-exporter
cap_add:
- NET_ADMIN
volumes:
- /etc/localtime:/etc/localtime:ro
network_mode: host
environment:
- TZ=Europe/Berlin
- PROMETHEUS_WIREGUARD_EXPORTER_PREPEND_SUDO_ENABLED=true
- PROMETHEUS_WIREGUARD_EXPORTER_INTERFACES=wg0
- PROMETHEUS_WIREGUARD_EXPORTER_EXPORT_REMOTE_IP_AND_PORT_ENABLED=true
restart: unless-stopped
edit: syntax highlighting
I just cannot get the exporter to show me any information about the peers. All i get is this:
This is my docker-compose:
And this is my wg0.conf:
If I manually type
sudo wg show all dump
however it does show me information about the peers.What did I do wrong? 😑