This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Wireguard logging and monitoring tool. | |
Logs the following events along with the peer state in JSON format to stdout: | |
- Peer connected (= successfull handshake after period of no handshakes) | |
- Peer disconnected (= no handshake for longer than 5 minutes) | |
- Peer roamed (= source IP of the peer changed) | |
Additionally, the tool exposes a Prometheus-compatible monitoring endpoint | |
on port 9000 that exports the following metrics: |