- Template name:
telegram.message - Content:
{{- /* Telegram message to use: {{ template "telegram.message2" . }} */ -}} {{ define "__alerts_list" -}} {{ range . }} {{if ne (index .Labels "alertname") "" -}} {{ if eq .Status "firing" }}🔴{{ else }}🟢{{ end }} {{- if ne (index .Labels "severity") "" -}} <u><b>P{{ index .Labels "severity" }}</b></u> {{ end -}}
| # Temporarily add a normal upstream DNS resolver | |
| /ip dns set servers=1.1.1.1,1.0.0.1 | |
| # CA certificates extracted from Mozilla | |
| /tool fetch url=https://curl.se/ca/cacert.pem | |
| # Import the downloaded ca-store (127 certificates) | |
| /certificate import file-name=cacert.pem passphrase="" | |
| # Set the DoH resolver to cloudflare |
Here's a simple set of scripts that allow you to export wireguard tunnel statistics to a file in Prometheus text format. This file can be read by the node_exporter textfile collector, for example.
You might be asking, why does this exist? Why not MindFlavor/prometheus_wireguard_exporter? The reality is that a full-fledged webserver written in Rust to expose wireguard metrics is a bit overkill. I've accomplished the same thing in ~100 lines of (well documented) Awk. It's dead simple, and a no brainer if you're already using node-exporter.
For those conscious about security, you'll be happy to know the script itself does't run any wireguard commands; it doesn't even need to be run as root. It accepts a wg dump from stdin, and that's it. The metrics exposition is completely isolated from the wiregu