272 lines
9.5 KiB
YAML
272 lines
9.5 KiB
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: grafana-dashboard-wireguard
|
|
namespace: monitoring
|
|
labels:
|
|
grafana_dashboard: '1'
|
|
annotations:
|
|
grafana_dashboard_folder: 🏠 Home
|
|
data:
|
|
wireguard.json: |
|
|
{
|
|
"uid": "wireguard",
|
|
"title": "🛡️ WireGuard VPN",
|
|
"tags": ["network", "vpn", "infrastructure", "prometheus"],
|
|
"timezone": "browser",
|
|
"schemaVersion": 39,
|
|
"version": 3,
|
|
"refresh": "10s",
|
|
"editable": false,
|
|
"graphTooltip": 2,
|
|
"time": {
|
|
"from": "now-24h",
|
|
"to": "now"
|
|
},
|
|
"panels": [
|
|
{
|
|
"title": "⚡ VPN Status",
|
|
"type": "row",
|
|
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 0},
|
|
"collapsed": false
|
|
},
|
|
{
|
|
"title": "Exporter Status",
|
|
"type": "stat",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"gridPos": {"h": 4, "w": 4, "x": 0, "y": 1},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"mappings": [
|
|
{"type": "value", "options": {"0": {"text": "OFFLINE", "color": "red"}, "1": {"text": "ONLINE", "color": "green"}}}
|
|
],
|
|
"color": {"mode": "thresholds"}
|
|
}
|
|
},
|
|
"options": {
|
|
"graphMode": "none",
|
|
"colorMode": "background",
|
|
"textMode": "auto",
|
|
"reduceOptions": {"values": false, "calcs": ["lastNotNull"]}
|
|
},
|
|
"targets": [
|
|
{"expr": "up{job=\"wireguard-exporter\"}", "legendFormat": "Exporter Connectivity", "refId": "A"}
|
|
]
|
|
},
|
|
{
|
|
"title": "Interface wg0",
|
|
"type": "stat",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"gridPos": {"h": 4, "w": 5, "x": 4, "y": 1},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"mappings": [
|
|
{"type": "value", "options": {"0": {"text": "DOWN", "color": "red"}, "1": {"text": "UP", "color": "green"}}}
|
|
],
|
|
"color": {"mode": "thresholds"}
|
|
}
|
|
},
|
|
"options": {
|
|
"graphMode": "none",
|
|
"colorMode": "background",
|
|
"textMode": "auto",
|
|
"reduceOptions": {"values": false, "calcs": ["lastNotNull"]}
|
|
},
|
|
"targets": [
|
|
{"expr": "count(wireguard_sent_bytes_total{interface=\"wg0\"}) or on() vector(0)", "legendFormat": "wg0 Status", "refId": "A"}
|
|
]
|
|
},
|
|
{
|
|
"title": "Tunnel Uptime",
|
|
"type": "stat",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"gridPos": {"h": 4, "w": 5, "x": 9, "y": 1},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s",
|
|
"color": {"mode": "fixed", "fixedColor": "blue"}
|
|
}
|
|
},
|
|
"options": {
|
|
"graphMode": "none",
|
|
"colorMode": "value",
|
|
"textMode": "auto",
|
|
"reduceOptions": {"values": false, "calcs": ["lastNotNull"]}
|
|
},
|
|
"targets": [
|
|
{"expr": "time() - kube_pod_start_time{namespace=\"wireguard\", pod=~\"wireguard-.*\"}", "legendFormat": "Uptime", "refId": "A"}
|
|
]
|
|
},
|
|
{
|
|
"title": "FritzBox Peer Status",
|
|
"type": "stat",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"gridPos": {"h": 4, "w": 5, "x": 14, "y": 1},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"mappings": [
|
|
{"type": "value", "options": {"0": {"text": "DISCONNECTED", "color": "red"}, "1": {"text": "CONNECTED", "color": "green"}}}
|
|
],
|
|
"color": {"mode": "thresholds"}
|
|
}
|
|
},
|
|
"options": {
|
|
"graphMode": "none",
|
|
"colorMode": "background",
|
|
"textMode": "auto",
|
|
"reduceOptions": {"values": false, "calcs": ["lastNotNull"]}
|
|
},
|
|
"targets": [
|
|
{"expr": "(time() - wireguard_latest_handshake_seconds{interface=\"wg0\"} < 300) or on() vector(0)", "legendFormat": "Peer Connectivity", "refId": "A"}
|
|
]
|
|
},
|
|
{
|
|
"title": "FritzBox Last Handshake",
|
|
"type": "stat",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"gridPos": {"h": 4, "w": 5, "x": 19, "y": 1},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s",
|
|
"color": {"mode": "thresholds"},
|
|
"thresholds": {
|
|
"mode": "absolute",
|
|
"steps": [
|
|
{"color": "green", "value": null},
|
|
{"color": "orange", "value": 300},
|
|
{"color": "red", "value": 600}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"graphMode": "none",
|
|
"colorMode": "value",
|
|
"textMode": "auto",
|
|
"reduceOptions": {"values": false, "calcs": ["lastNotNull"]}
|
|
},
|
|
"targets": [
|
|
{"expr": "time() - wireguard_latest_handshake_seconds{interface=\"wg0\"}", "legendFormat": "Handshake Delay", "refId": "A"}
|
|
]
|
|
},
|
|
{
|
|
"title": "Interface Status Timeline",
|
|
"type": "state-timeline",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"gridPos": {"h": 4, "w": 24, "x": 0, "y": 5},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"mappings": [
|
|
{"type": "value", "options": {"0": {"text": "DOWN", "color": "red"}, "1": {"text": "UP", "color": "green"}}}
|
|
],
|
|
"color": {"mode": "thresholds"},
|
|
"custom": {
|
|
"fillOpacity": 70,
|
|
"lineWidth": 1
|
|
}
|
|
}
|
|
},
|
|
"options": {
|
|
"showValue": "never",
|
|
"tooltip": {"mode": "single"},
|
|
"legend": {"showLegend": true, "displayMode": "list"}
|
|
},
|
|
"targets": [
|
|
{"expr": "count(wireguard_sent_bytes_total{interface=\"wg0\"}) or on() vector(0)", "legendFormat": "wg0 Status", "refId": "A"}
|
|
]
|
|
},
|
|
{
|
|
"title": "📊 Traffic & Performance",
|
|
"type": "row",
|
|
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 9},
|
|
"collapsed": false
|
|
},
|
|
{
|
|
"title": "FritzBox Traffic Rate",
|
|
"type": "timeseries",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"gridPos": {"h": 10, "w": 24, "x": 0, "y": 10},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "Bps",
|
|
"custom": {
|
|
"lineWidth": 2,
|
|
"fillOpacity": 10,
|
|
"spanNulls": true,
|
|
"showPoints": "never"
|
|
}
|
|
},
|
|
"overrides": [
|
|
{
|
|
"matcher": {"id": "byName", "options": "Received (Rx)"},
|
|
"properties": [
|
|
{"id": "color", "value": {"fixedColor": "#4CAF50", "mode": "fixed"}}
|
|
]
|
|
},
|
|
{
|
|
"matcher": {"id": "byName", "options": "Sent (Tx)"},
|
|
"properties": [
|
|
{"id": "color", "value": {"fixedColor": "#2196F3", "mode": "fixed"}}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"options": {
|
|
"legend": {"displayMode": "table", "placement": "bottom", "calcs": ["lastNotNull", "mean", "max"]},
|
|
"tooltip": {"mode": "multi", "sort": "desc"}
|
|
},
|
|
"targets": [
|
|
{"expr": "rate(wireguard_received_bytes_total{interface=\"wg0\"}[5m])", "legendFormat": "Received (Rx)", "refId": "A"},
|
|
{"expr": "rate(wireguard_sent_bytes_total{interface=\"wg0\"}[5m])", "legendFormat": "Sent (Tx)", "refId": "B"}
|
|
]
|
|
},
|
|
{
|
|
"title": "Total Data Transferred",
|
|
"type": "stat",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"gridPos": {"h": 5, "w": 12, "x": 0, "y": 20},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "bytes",
|
|
"color": {"mode": "palette-classic"}
|
|
}
|
|
},
|
|
"options": {
|
|
"graphMode": "none",
|
|
"colorMode": "value",
|
|
"textMode": "auto",
|
|
"reduceOptions": {"values": true, "calcs": ["lastNotNull"]}
|
|
},
|
|
"targets": [
|
|
{"expr": "wireguard_received_bytes_total{interface=\"wg0\"}", "legendFormat": "Total Received (Rx)", "refId": "A"},
|
|
{"expr": "wireguard_sent_bytes_total{interface=\"wg0\"}", "legendFormat": "Total Sent (Tx)", "refId": "B"}
|
|
]
|
|
},
|
|
{
|
|
"title": "Handshake Delay History",
|
|
"type": "timeseries",
|
|
"datasource": {"type": "prometheus", "uid": "prometheus"},
|
|
"gridPos": {"h": 5, "w": 12, "x": 12, "y": 20},
|
|
"fieldConfig": {
|
|
"defaults": {
|
|
"unit": "s",
|
|
"custom": {
|
|
"lineWidth": 2,
|
|
"fillOpacity": 5,
|
|
"spanNulls": true,
|
|
"showPoints": "never"
|
|
},
|
|
"color": {"mode": "fixed", "fixedColor": "#FF9800"}
|
|
}
|
|
},
|
|
"options": {
|
|
"legend": {"displayMode": "list", "placement": "bottom", "calcs": ["lastNotNull", "max"]},
|
|
"tooltip": {"mode": "single"}
|
|
},
|
|
"targets": [
|
|
{"expr": "time() - wireguard_latest_handshake_seconds{interface=\"wg0\"}", "legendFormat": "Handshake Delay", "refId": "A"}
|
|
]
|
|
}
|
|
]
|
|
}
|