Wireguard Prometheus Exporter with Grafana Dashboard

1 min read
Wireguard Prometheus Exporter with Grafana Dashboard

A lightweight, bash-based Prometheus exporter for WireGuard VPN statistics. This exporter uses only bash and socat to provide comprehensive WireGuard metrics for monitoring with Prometheus and Grafana.

Features

  • Pure Bash Implementation: No external dependencies except socat and wireguard-tools
  • Comprehensive Metrics: Exports WireGuard statistics including:
    • Interface status and configuration
    • Per-peer connection status
    • Latest handshake timestamps
    • Data transfer statistics (bytes sent/received)
    • Peer endpoint information
    • Persistent keepalive settings
    • Allowed IP ranges count
  • Multi-Interface Support: Monitor all WireGuard interfaces or specific ones
  • Docker Container Support: Monitor WireGuard running in Docker containers
  • HTTP Server: Built-in HTTP server using socat for serving metrics
  • Systemd Integration: Ready-to-use systemd service file
  • Security: Runs with minimal privileges using Linux capabilities
  • Auto-Discovery: Automatically detects all WireGuard interfaces

Github Repo