lots of stuff

This commit is contained in:
bee
2026-08-16 14:48:04 +02:00
parent c63db540e8
commit 49fa352476
45 changed files with 32520 additions and 93 deletions
@@ -0,0 +1,713 @@
{
"apiVersion": "dashboard.grafana.app/v2",
"kind": "Dashboard",
"metadata": {
"name": "admltw2"
},
"spec": {
"annotations": [
{
"kind": "AnnotationQuery",
"spec": {
"builtIn": true,
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"query": {
"datasource": {
"name": "-- Grafana --"
},
"group": "grafana",
"kind": "DataQuery",
"spec": {},
"version": "v0"
}
}
}
],
"cursorSync": "Off",
"editable": true,
"elements": {
"panel-1": {
"kind": "Panel",
"spec": {
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"hidden": false,
"query": {
"datasource": {
"name": "bfkfq6kdpznr4e"
},
"group": "loki",
"kind": "DataQuery",
"spec": {
"direction": "backward",
"editorMode": "builder",
"expr": "{host=\"beepi\", filename=\"/var/log/ufw.log\"} |= `[UFW BLOCK]` | detected_level != `info`",
"queryType": "range"
},
"version": "v0"
},
"refId": "A"
}
}
],
"queryOptions": {},
"transformations": []
}
},
"description": "",
"id": 1,
"links": [],
"title": "UFW Blocks",
"vizConfig": {
"group": "logs",
"kind": "VizConfig",
"spec": {
"fieldConfig": {
"defaults": {},
"overrides": []
},
"options": {
"dedupStrategy": "numbers",
"enableInfiniteScrolling": false,
"enableLogDetails": true,
"prettifyLogMessage": true,
"showControls": false,
"showFieldSelector": false,
"showLabels": false,
"showLevel": true,
"showTime": true,
"sortOrder": "Descending",
"syntaxHighlighting": true,
"timestampResolution": "ms",
"unwrappedColumns": false,
"wrapLogMessage": false
}
},
"version": "13.0.1"
}
}
},
"panel-2": {
"kind": "Panel",
"spec": {
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"hidden": false,
"query": {
"datasource": {
"name": "bfkfq6kdpznr4e"
},
"group": "loki",
"kind": "DataQuery",
"spec": {
"direction": "backward",
"editorMode": "builder",
"expr": "{filename=\"/var/log/fail2ban.log\"} |= `NOTICE`",
"queryType": "range"
},
"version": "v0"
},
"refId": "A"
}
}
],
"queryOptions": {},
"transformations": []
}
},
"description": "",
"id": 2,
"links": [],
"title": "Fail2Ban bans",
"vizConfig": {
"group": "logs",
"kind": "VizConfig",
"spec": {
"fieldConfig": {
"defaults": {},
"overrides": []
},
"options": {
"dedupStrategy": "none",
"enableInfiniteScrolling": false,
"enableLogDetails": true,
"prettifyLogMessage": true,
"showControls": false,
"showFieldSelector": false,
"showLabels": false,
"showLevel": true,
"showTime": false,
"sortOrder": "Descending",
"timestampResolution": "ms",
"unwrappedColumns": false,
"wrapLogMessage": false
}
},
"version": "13.0.1"
}
}
},
"panel-3": {
"kind": "Panel",
"spec": {
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"hidden": false,
"query": {
"datasource": {
"name": "bfkfq6kdpznr4e"
},
"group": "loki",
"kind": "DataQuery",
"spec": {
"direction": "backward",
"editorMode": "builder",
"expr": "count_over_time({filename=\"/var/log/fail2ban.log\"} |= `NOTICE` |= `Ban` != `Restore` [$__auto])",
"legendFormat": "",
"queryType": "range",
"step": "10m"
},
"version": "v0"
},
"refId": "A"
}
}
],
"queryOptions": {},
"transformations": []
}
},
"description": "",
"id": 3,
"links": [],
"title": "Fail2Ban Over Time",
"vizConfig": {
"group": "barchart",
"kind": "VizConfig",
"spec": {
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineWidth": 1,
"scaleDistribution": {
"type": "linear"
},
"thresholdsStyle": {
"mode": "off"
}
},
"decimals": 0,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
}
]
},
"unit": "none"
},
"overrides": []
},
"options": {
"barRadius": 0,
"barWidth": 0.97,
"fullHighlight": false,
"groupWidth": 0.7,
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"orientation": "auto",
"showValue": "auto",
"stacking": "none",
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
},
"xTickLabelRotation": 0,
"xTickLabelSpacing": 0
}
},
"version": "13.0.1"
}
}
},
"panel-4": {
"kind": "Panel",
"spec": {
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"hidden": false,
"query": {
"datasource": {
"name": "bfkfq6kdpznr4e"
},
"group": "loki",
"kind": "DataQuery",
"spec": {
"direction": "backward",
"editorMode": "builder",
"expr": "{type=\"Ban\"}",
"queryType": "range"
},
"version": "v0"
},
"refId": "A"
}
}
],
"queryOptions": {},
"transformations": [
{
"group": "extractFields",
"kind": "Transformation",
"spec": {
"options": {
"delimiter": ",",
"format": "json",
"keepTime": false,
"replace": false,
"source": "labels"
}
}
},
{
"group": "convertFieldType",
"kind": "Transformation",
"spec": {
"options": {
"conversions": [
{
"destinationType": "number",
"targetField": "geoip_location_latitude"
},
{
"destinationType": "number",
"targetField": "geoip_location_longitude"
}
],
"fields": {}
}
}
}
]
}
},
"description": "",
"id": 4,
"links": [],
"title": "Fail2Ban Worldmap",
"vizConfig": {
"group": "geomap",
"kind": "VizConfig",
"spec": {
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": 0
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "geoip_location_latitude",
"scope": "series"
},
"properties": [
{
"id": "decimals",
"value": 4
}
]
},
{
"matcher": {
"id": "byName",
"options": "geoip_location_longitude",
"scope": "series"
},
"properties": [
{
"id": "decimals",
"value": 4
}
]
},
{
"matcher": {
"id": "byName",
"options": "__error__",
"scope": "series"
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"legend": true,
"tooltip": true,
"viz": true
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "__error_details__",
"scope": "series"
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"legend": true,
"tooltip": true,
"viz": true
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "labels",
"scope": "series"
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"legend": true,
"tooltip": true,
"viz": true
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "labelTypes",
"scope": "series"
},
"properties": [
{
"id": "custom.hideFrom",
"value": {
"legend": true,
"tooltip": true,
"viz": true
}
}
]
}
]
},
"options": {
"basemap": {
"config": {},
"name": "Layer 0",
"noRepeat": false,
"type": "default"
},
"controls": {
"mouseWheelZoom": true,
"showAttribution": true,
"showDebug": false,
"showMeasure": false,
"showScale": false,
"showZoom": true
},
"layers": [
{
"config": {
"blur": 17,
"radius": 9,
"weight": {
"fixed": 0.5,
"max": 1,
"min": 0
}
},
"layer-tooltip": false,
"location": {
"latitude": "geoip_location_latitude",
"longitude": "geoip_location_longitude",
"mode": "coords"
},
"name": "Bans",
"opacity": 1,
"tooltip": true,
"type": "heatmap"
}
],
"tooltip": {
"mode": "details"
},
"view": {
"allLayers": true,
"dashboardVariable": false,
"id": "zero",
"lat": 0,
"lon": 0,
"noRepeat": false,
"zoom": 1
}
}
},
"version": "13.0.1"
}
}
},
"panel-5": {
"kind": "Panel",
"spec": {
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"hidden": false,
"query": {
"datasource": {
"name": "bfkfq6kdpznr4e"
},
"group": "loki",
"kind": "DataQuery",
"spec": {
"direction": "backward",
"editorMode": "builder",
"expr": "{job=\"varlog\"} |= `ERROR` or `WARN` or `CRITICAL` != `queryType` or `query_hash` | logfmt",
"queryType": "range"
},
"version": "v0"
},
"refId": "A"
}
}
],
"queryOptions": {},
"transformations": []
}
},
"description": "",
"id": 5,
"links": [],
"title": "New panel",
"vizConfig": {
"group": "logs",
"kind": "VizConfig",
"spec": {
"fieldConfig": {
"defaults": {},
"overrides": []
},
"options": {
"dedupStrategy": "none",
"enableInfiniteScrolling": false,
"enableLogDetails": true,
"prettifyLogMessage": true,
"showControls": false,
"showFieldSelector": false,
"showLevel": true,
"showTime": false,
"sortOrder": "Descending",
"timestampResolution": "ms",
"unwrappedColumns": false,
"wrapLogMessage": false
}
},
"version": "13.0.1"
}
}
}
},
"layout": {
"kind": "GridLayout",
"spec": {
"items": [
{
"kind": "GridLayoutItem",
"spec": {
"element": {
"kind": "ElementReference",
"name": "panel-5"
},
"height": 8,
"width": 24,
"x": 0,
"y": 0
}
},
{
"kind": "GridLayoutItem",
"spec": {
"element": {
"kind": "ElementReference",
"name": "panel-4"
},
"height": 8,
"width": 12,
"x": 0,
"y": 8
}
},
{
"kind": "GridLayoutItem",
"spec": {
"element": {
"kind": "ElementReference",
"name": "panel-3"
},
"height": 8,
"width": 12,
"x": 12,
"y": 8
}
},
{
"kind": "GridLayoutItem",
"spec": {
"element": {
"kind": "ElementReference",
"name": "panel-2"
},
"height": 7,
"width": 24,
"x": 0,
"y": 16
}
},
{
"kind": "GridLayoutItem",
"spec": {
"element": {
"kind": "ElementReference",
"name": "panel-1"
},
"height": 8,
"width": 24,
"x": 0,
"y": 23
}
}
]
}
},
"links": [],
"liveNow": false,
"preferences": {
"layout": {
"kind": "GridLayout",
"spec": {
"items": []
}
}
},
"preload": false,
"tags": [],
"timeSettings": {
"autoRefresh": "",
"autoRefreshIntervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"fiscalYearStartMonth": 0,
"from": "now-6h",
"hideTimepicker": false,
"timezone": "browser",
"to": "now"
},
"title": "Logging",
"variables": [
{
"datasource": {
"name": "bfkfq6kdpznr4e"
},
"group": "loki",
"kind": "AdhocVariable",
"spec": {
"allowCustomValue": true,
"baseFilters": [],
"defaultKeys": [],
"enableGroupBy": false,
"filters": [],
"hide": "dontHide",
"name": "Filters",
"skipUrlSync": false
}
}
]
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,215 @@
{
"id": null,
"uid": "beepi-backups",
"title": "Backups",
"tags": ["beepi", "backup"],
"timezone": "browser",
"schemaVersion": 39,
"version": 1,
"refresh": "1m",
"time": {"from": "now-7d", "to": "now"},
"panels": [
{
"type": "table",
"title": "Backup jobs",
"id": 1,
"gridPos": {"h": 7, "w": 24, "x": 0, "y": 0},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "age",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "time() - max by (backup_job) (backup_last_success_timestamp_seconds{backup_job!=\"\"})",
"instant": true,
"format": "table"
},
{
"refId": "status",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "max by (backup_job) (backup_last_status{backup_job!=\"\"})",
"instant": true,
"format": "table"
},
{
"refId": "duration",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "max by (backup_job) (backup_last_duration_seconds{backup_job!=\"\"})",
"instant": true,
"format": "table"
},
{
"refId": "size",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "max by (backup_job) (backup_last_archive_bytes{backup_job!=\"\"})",
"instant": true,
"format": "table"
}
],
"transformations": [
{"id": "joinByField", "options": {"byField": "backup_job", "mode": "outer"}},
{"id": "organize", "options": {
"excludeByName": {"Time": true, "Time 1": true, "Time 2": true, "Time 3": true, "Time 4": true},
"renameByName": {
"backup_job": "Job",
"Value #age": "Age",
"Value #status": "Status",
"Value #duration": "Duration",
"Value #size": "Archive"
}
}}
],
"fieldConfig": {
"defaults": {"custom": {"align": "auto", "cellOptions": {"type": "auto"}}},
"overrides": [
{"matcher": {"id": "byName", "options": "Age"}, "properties": [
{"id": "unit", "value": "s"},
{"id": "custom.cellOptions", "value": {"type": "color-background"}},
{"id": "thresholds", "value": {"mode": "absolute", "steps": [
{"color": "green", "value": null},
{"color": "orange", "value": 90000},
{"color": "red", "value": 172800}
]}}
]},
{"matcher": {"id": "byName", "options": "Duration"}, "properties": [{"id": "unit", "value": "s"}]},
{"matcher": {"id": "byName", "options": "Archive"}, "properties": [{"id": "unit", "value": "bytes"}]},
{"matcher": {"id": "byName", "options": "Status"}, "properties": [
{"id": "custom.cellOptions", "value": {"type": "color-background"}},
{"id": "mappings", "value": [{"type": "value", "options": {
"0": {"text": "FAILED", "color": "red", "index": 0},
"1": {"text": "ok", "color": "green", "index": 1}
}}]},
{"id": "thresholds", "value": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]}}
]}
]
},
"options": {"showHeader": true}
},
{
"type": "timeseries",
"title": "Archive size",
"id": 2,
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 7},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "backup_archive_newest_bytes",
"legendFormat": "newest {{ '{{' }}kind{{ '}}' }}"
},
{
"refId": "B",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "backup_archive_total_bytes",
"legendFormat": "total {{ '{{' }}kind{{ '}}' }}"
}
],
"fieldConfig": {
"defaults": {"unit": "bytes", "custom": {"lineWidth": 2, "fillOpacity": 8}},
"overrides": []
},
"options": {"legend": {"displayMode": "list", "placement": "bottom", "showLegend": true}, "tooltip": {"mode": "multi"}}
},
{
"type": "timeseries",
"title": "Backup duration",
"id": 3,
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 7},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "backup_last_duration_seconds{backup_job!=\"\"}",
"legendFormat": "{{ '{{' }}backup_job{{ '}}' }}"
}
],
"fieldConfig": {
"defaults": {"unit": "s", "custom": {"lineWidth": 2, "fillOpacity": 8}},
"overrides": []
},
"options": {"legend": {"displayMode": "list", "placement": "bottom", "showLegend": true}, "tooltip": {"mode": "multi"}}
},
{
"type": "stat",
"title": "Retained archives",
"id": 4,
"gridPos": {"h": 5, "w": 6, "x": 0, "y": 15},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "backup_archive_count",
"legendFormat": "{{ '{{' }}kind{{ '}}' }}",
"instant": true
}
],
"fieldConfig": {"defaults": {"unit": "short", "color": {"mode": "thresholds"}, "thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 2}]}}, "overrides": []},
"options": {"colorMode": "background", "graphMode": "none", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}}
},
{
"type": "stat",
"title": "RAID mounted",
"id": 5,
"gridPos": {"h": 5, "w": 6, "x": 6, "y": 15},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "max(backup_raid_mounted) or vector(0)",
"instant": true
}
],
"fieldConfig": {
"defaults": {
"mappings": [{"type": "value", "options": {"0": {"text": "NOT MOUNTED", "color": "red", "index": 0}, "1": {"text": "mounted", "color": "green", "index": 1}}}],
"thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]}
},
"overrides": []
},
"options": {"colorMode": "background", "graphMode": "none", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}}
},
{
"type": "timeseries",
"title": "RAID free space",
"id": 6,
"gridPos": {"h": 5, "w": 12, "x": 12, "y": 15},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "node_filesystem_avail_bytes{mountpoint=\"{{ backup_raid_mount }}\"}",
"legendFormat": "free"
}
],
"fieldConfig": {"defaults": {"unit": "bytes", "custom": {"lineWidth": 2, "fillOpacity": 8}}, "overrides": []},
"options": {"legend": {"displayMode": "list", "placement": "bottom", "showLegend": true}, "tooltip": {"mode": "single"}}
},
{
"type": "logs",
"title": "Backup log",
"id": 7,
"gridPos": {"h": 12, "w": 24, "x": 0, "y": 20},
"datasource": {"type": "loki", "uid": "{{ grafana_loki_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "loki", "uid": "{{ grafana_loki_uid }}"},
"expr": "{job=\"backup\"}",
"queryType": "range"
}
],
"options": {
"showTime": true,
"sortOrder": "Descending",
"wrapLogMessage": true,
"enableLogDetails": true,
"dedupStrategy": "none",
"prettifyLogMessage": false
}
}
]
}
@@ -0,0 +1,364 @@
{
"id": null,
"uid": "beepi-map",
"title": "Infrastructure Map",
"tags": ["beepi", "overview"],
"timezone": "browser",
"schemaVersion": 39,
"version": 1,
"refresh": "30s",
"time": {"from": "now-6h", "to": "now"},
"panels": [
{
"type": "stat",
"title": "Services down",
"id": 1,
"gridPos": {"h": 4, "w": 4, "x": 0, "y": 0},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "count(min by (service) (probe_success{vantage=\"local\"}) == 0 and on (service) (max by (service) (service_enabled) == 1)) or vector(0)",
"instant": true
}
],
"fieldConfig": {
"defaults": {
"thresholds": {
"mode": "absolute",
"steps": [
{"color": "green", "value": null},
{"color": "red", "value": 1}
]
},
"unit": "short"
},
"overrides": []
},
"options": {
"colorMode": "background",
"graphMode": "none",
"textMode": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}
}
},
{
"type": "stat",
"title": "Last daily backup",
"id": 2,
"gridPos": {"h": 4, "w": 4, "x": 4, "y": 0},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "time() - max(backup_last_success_timestamp_seconds{backup_job=\"daily\"})",
"instant": true
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"thresholds": {
"mode": "absolute",
"steps": [
{"color": "green", "value": null},
{"color": "orange", "value": 90000},
{"color": "red", "value": 172800}
]
}
},
"overrides": []
},
"options": {
"colorMode": "background",
"graphMode": "none",
"textMode": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}
}
},
{
"type": "stat",
"title": "Last offsite sync",
"id": 3,
"gridPos": {"h": 4, "w": 4, "x": 8, "y": 0},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "time() - max(backup_last_success_timestamp_seconds{backup_job=\"offsite\"})",
"instant": true
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"thresholds": {
"mode": "absolute",
"steps": [
{"color": "green", "value": null},
{"color": "orange", "value": 90000},
{"color": "red", "value": 172800}
]
}
},
"overrides": []
},
"options": {
"colorMode": "background",
"graphMode": "none",
"textMode": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}
}
},
{
"type": "stat",
"title": "Tunnel handshake",
"id": 4,
"gridPos": {"h": 4, "w": 4, "x": 12, "y": 0},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "max(wireguard_peer_handshake_age_seconds{peer=\"beepi\"})",
"instant": true
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"thresholds": {
"mode": "absolute",
"steps": [
{"color": "green", "value": null},
{"color": "orange", "value": 180},
{"color": "red", "value": 300}
]
}
},
"overrides": []
},
"options": {
"colorMode": "background",
"graphMode": "none",
"textMode": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}
}
},
{
"type": "stat",
"title": "Ingress",
"id": 5,
"gridPos": {"h": 4, "w": 4, "x": 16, "y": 0},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "min(up{job=\"node\",host=\"ingress\"}) or vector(0)",
"instant": true
}
],
"fieldConfig": {
"defaults": {
"mappings": [
{"type": "value", "options": {"0": {"text": "DOWN", "color": "red", "index": 0}, "1": {"text": "UP", "color": "green", "index": 1}}}
],
"thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]}
},
"overrides": []
},
"options": {
"colorMode": "background",
"graphMode": "none",
"textMode": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}
}
},
{
"type": "stat",
"title": "RAID free",
"id": 6,
"gridPos": {"h": 4, "w": 4, "x": 20, "y": 0},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "min(node_filesystem_avail_bytes{mountpoint=\"{{ backup_raid_mount }}\"})",
"instant": true
}
],
"fieldConfig": {
"defaults": {
"unit": "bytes",
"thresholds": {
"mode": "absolute",
"steps": [
{"color": "red", "value": null},
{"color": "orange", "value": 100000000000},
{"color": "green", "value": 200000000000}
]
}
},
"overrides": []
},
"options": {
"colorMode": "background",
"graphMode": "none",
"textMode": "auto",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}
}
},
{
"type": "nodeGraph",
"title": "Infrastructure",
"id": 10,
"gridPos": {"h": 18, "w": 18, "x": 0, "y": 4},
"datasource": {"type": "yesoreyeram-infinity-datasource", "uid": "{{ grafana_infinity_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "yesoreyeram-infinity-datasource", "uid": "{{ grafana_infinity_uid }}"},
"type": "json",
"source": "url",
"parser": "backend",
"format": "table",
"url": "http://topology:8088/topology.json",
"url_options": {"method": "GET", "data": ""},
"root_selector": "nodes",
"columns": [
{"selector": "id", "text": "id", "type": "string"},
{"selector": "title", "text": "title", "type": "string"},
{"selector": "subtitle", "text": "subtitle", "type": "string"},
{"selector": "mainstat", "text": "mainstat", "type": "string"},
{"selector": "arc__ok", "text": "arc__ok", "type": "number"},
{"selector": "arc__fail", "text": "arc__fail", "type": "number"},
{"selector": "arc__disabled", "text": "arc__disabled", "type": "number"},
{"selector": "arc__unknown", "text": "arc__unknown", "type": "number"},
{"selector": "arc__used", "text": "arc__used", "type": "number"},
{"selector": "arc__free", "text": "arc__free", "type": "number"},
{"selector": "detail__status", "text": "detail__status", "type": "string"},
{"selector": "detail__group", "text": "detail__group", "type": "string"},
{"selector": "detail__used", "text": "detail__used", "type": "string"},
{"selector": "dashboard", "text": "dashboard", "type": "string"}
]
},
{
"refId": "B",
"datasource": {"type": "yesoreyeram-infinity-datasource", "uid": "{{ grafana_infinity_uid }}"},
"type": "json",
"source": "url",
"parser": "backend",
"format": "table",
"url": "http://topology:8088/topology.json",
"url_options": {"method": "GET", "data": ""},
"root_selector": "edges",
"columns": [
{"selector": "id", "text": "id", "type": "string"},
{"selector": "source", "text": "source", "type": "string"},
{"selector": "target", "text": "target", "type": "string"},
{"selector": "mainstat", "text": "mainstat", "type": "string"},
{"selector": "color", "text": "color", "type": "string"},
{"selector": "thickness", "text": "thickness", "type": "number"}
]
}
],
"transformations": [
{
"id": "convertFieldType",
"options": {
"conversions": [
{"targetField": "arc__ok", "destinationType": "number"},
{"targetField": "arc__fail", "destinationType": "number"},
{"targetField": "arc__disabled", "destinationType": "number"},
{"targetField": "arc__unknown", "destinationType": "number"},
{"targetField": "arc__used", "destinationType": "number"},
{"targetField": "arc__free", "destinationType": "number"}
]
}
}
],
"options": {
"nodes": {
"mainStatUnit": "",
"secondaryStatUnit": "",
"arcs": [
{"field": "arc__ok", "color": "green"},
{"field": "arc__fail", "color": "red"},
{"field": "arc__disabled", "color": "text"},
{"field": "arc__unknown", "color": "orange"},
{"field": "arc__used", "color": "semi-dark-orange"},
{"field": "arc__free", "color": "semi-dark-green"}
]
},
"edges": {"mainStatUnit": ""},
"zoomMode": "cooperative"
},
"fieldConfig": {
"defaults": {},
"overrides": [
{
"matcher": {"id": "byName", "options": "arc__ok"},
"properties": [{"id": "color", "value": {"mode": "fixed", "fixedColor": "green"}}]
},
{
"matcher": {"id": "byName", "options": "arc__fail"},
"properties": [{"id": "color", "value": {"mode": "fixed", "fixedColor": "red"}}]
},
{
"matcher": {"id": "byName", "options": "arc__disabled"},
"properties": [{"id": "color", "value": {"mode": "fixed", "fixedColor": "text"}}]
},
{
"matcher": {"id": "byName", "options": "arc__unknown"},
"properties": [{"id": "color", "value": {"mode": "fixed", "fixedColor": "orange"}}]
},
{
"matcher": {"id": "byName", "options": "arc__used"},
"properties": [{"id": "color", "value": {"mode": "fixed", "fixedColor": "semi-dark-orange"}}]
},
{
"matcher": {"id": "byName", "options": "arc__free"},
"properties": [{"id": "color", "value": {"mode": "fixed", "fixedColor": "semi-dark-green"}}]
},
{
"matcher": {"id": "byName", "options": "id"},
"properties": [
{
"id": "links",
"value": [
{
"title": "Open related dashboard",
"url": "${__data.fields.dashboard}",
"targetBlank": false
}
]
}
]
}
]
}
},
{
"type": "alertlist",
"title": "Firing alerts",
"id": 11,
"gridPos": {"h": 18, "w": 6, "x": 18, "y": 4},
"options": {
"alertInstanceLabelFilter": "",
"alertName": "",
"dashboardAlerts": false,
"groupBy": [],
"groupMode": "default",
"maxItems": 30,
"sortOrder": 3,
"stateFilter": {"error": true, "firing": true, "noData": true, "normal": false, "pending": true},
"viewMode": "list"
}
}
]
}
@@ -0,0 +1,260 @@
{
"id": null,
"uid": "beepi-ingress",
"title": "Ingress",
"tags": ["beepi", "ingress"],
"timezone": "browser",
"schemaVersion": 39,
"version": 1,
"refresh": "30s",
"time": {"from": "now-24h", "to": "now"},
"panels": [
{
"type": "stat",
"title": "Ingress uptime",
"id": 1,
"gridPos": {"h": 4, "w": 5, "x": 0, "y": 0},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "time() - max(node_boot_time_seconds{host=\"ingress\"})",
"instant": true
}
],
"fieldConfig": {"defaults": {"unit": "s", "color": {"mode": "fixed", "fixedColor": "blue"}}, "overrides": []},
"options": {"colorMode": "value", "graphMode": "none", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}}
},
{
"type": "stat",
"title": "Tunnel RTT",
"id": 2,
"gridPos": {"h": 4, "w": 5, "x": 5, "y": 0},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "max(probe_duration_seconds{probe=\"tunnel-rtt\"})",
"instant": true
}
],
"fieldConfig": {
"defaults": {"unit": "s", "thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}, {"color": "orange", "value": 0.1}, {"color": "red", "value": 0.3}]}},
"overrides": []
},
"options": {"colorMode": "background", "graphMode": "none", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}}
},
{
"type": "stat",
"title": "Banned hosts (24h)",
"id": 3,
"gridPos": {"h": 4, "w": 5, "x": 10, "y": 0},
"datasource": {"type": "loki", "uid": "{{ grafana_loki_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "loki", "uid": "{{ grafana_loki_uid }}"},
"expr": "sum(count_over_time({job=\"fail2ban\", host=\"ingress\"} |= \"Ban\" [24h]))",
"queryType": "instant"
}
],
"fieldConfig": {"defaults": {"unit": "short", "color": {"mode": "fixed", "fixedColor": "orange"}}, "overrides": []},
"options": {"colorMode": "value", "graphMode": "none", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}}
},
{
"type": "stat",
"title": "Blocked packets (24h)",
"id": 4,
"gridPos": {"h": 4, "w": 9, "x": 15, "y": 0},
"datasource": {"type": "loki", "uid": "{{ grafana_loki_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "loki", "uid": "{{ grafana_loki_uid }}"},
"expr": "sum(count_over_time({job=\"ufw\", host=\"ingress\"} [24h]))",
"queryType": "instant"
}
],
"fieldConfig": {"defaults": {"unit": "short", "color": {"mode": "fixed", "fixedColor": "purple"}}, "overrides": []},
"options": {"colorMode": "value", "graphMode": "none", "reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false}}
},
{
"type": "table",
"title": "WireGuard peers",
"id": 5,
"gridPos": {"h": 7, "w": 12, "x": 0, "y": 4},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "age",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "max by (peer) (wireguard_peer_handshake_age_seconds)",
"instant": true,
"format": "table"
},
{
"refId": "rx",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "max by (peer) (wireguard_peer_receive_bytes_total)",
"instant": true,
"format": "table"
},
{
"refId": "tx",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "max by (peer) (wireguard_peer_transmit_bytes_total)",
"instant": true,
"format": "table"
}
],
"transformations": [
{"id": "joinByField", "options": {"byField": "peer", "mode": "outer"}},
{"id": "organize", "options": {
"excludeByName": {"Time": true, "Time 1": true, "Time 2": true, "Time 3": true},
"renameByName": {"peer": "Peer", "Value #age": "Last handshake", "Value #rx": "Received", "Value #tx": "Sent"}
}}
],
"fieldConfig": {
"defaults": {"custom": {"align": "auto"}},
"overrides": [
{"matcher": {"id": "byName", "options": "Last handshake"}, "properties": [
{"id": "unit", "value": "s"},
{"id": "custom.cellOptions", "value": {"type": "color-background"}},
{"id": "thresholds", "value": {"mode": "absolute", "steps": [{"color": "green", "value": null}, {"color": "orange", "value": 300}, {"color": "red", "value": 3600}]}}
]},
{"matcher": {"id": "byRegexp", "options": "Received|Sent"}, "properties": [{"id": "unit", "value": "bytes"}]}
]
},
"options": {"showHeader": true}
},
{
"type": "state-timeline",
"title": "Tunnel path probes",
"id": 6,
"gridPos": {"h": 7, "w": 12, "x": 12, "y": 4},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "min by (probe) (probe_success{vantage=\"ingress\"})",
"legendFormat": "{{ '{{' }}probe{{ '}}' }}"
}
],
"fieldConfig": {
"defaults": {
"custom": {"fillOpacity": 90, "lineWidth": 0},
"mappings": [{"type": "value", "options": {"0": {"text": "down", "color": "red", "index": 0}, "1": {"text": "up", "color": "green", "index": 1}}}],
"thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]}
},
"overrides": []
},
"options": {"mergeValues": true, "showValue": "never", "legend": {"displayMode": "list", "placement": "bottom", "showLegend": false}}
},
{
"type": "timeseries",
"title": "Ingress host",
"id": 7,
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 11},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "100 - (avg(rate(node_cpu_seconds_total{host=\"ingress\",mode=\"idle\"}[5m])) * 100)",
"legendFormat": "cpu"
},
{
"refId": "B",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "(1 - (node_memory_MemAvailable_bytes{host=\"ingress\"} / node_memory_MemTotal_bytes{host=\"ingress\"})) * 100",
"legendFormat": "memory"
},
{
"refId": "C",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "(1 - (node_filesystem_avail_bytes{host=\"ingress\",mountpoint=\"/\"} / node_filesystem_size_bytes{host=\"ingress\",mountpoint=\"/\"})) * 100",
"legendFormat": "disk"
}
],
"fieldConfig": {"defaults": {"unit": "percent", "max": 100, "min": 0, "custom": {"lineWidth": 2, "fillOpacity": 8}}, "overrides": []},
"options": {"legend": {"displayMode": "list", "placement": "bottom", "showLegend": true}, "tooltip": {"mode": "multi"}}
},
{
"type": "timeseries",
"title": "Ingress network",
"id": 8,
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 11},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "rate(node_network_receive_bytes_total{host=\"ingress\",device!~\"lo\"}[5m]) * 8",
"legendFormat": "in {{ '{{' }}device{{ '}}' }}"
},
{
"refId": "B",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "rate(node_network_transmit_bytes_total{host=\"ingress\",device!~\"lo\"}[5m]) * 8",
"legendFormat": "out {{ '{{' }}device{{ '}}' }}"
}
],
"fieldConfig": {"defaults": {"unit": "bps", "custom": {"lineWidth": 2, "fillOpacity": 8}}, "overrides": []},
"options": {"legend": {"displayMode": "list", "placement": "bottom", "showLegend": true}, "tooltip": {"mode": "multi"}}
},
{
"type": "geomap",
"title": "Ban origins",
"id": 9,
"gridPos": {"h": 11, "w": 12, "x": 0, "y": 19},
"datasource": {"type": "loki", "uid": "{{ grafana_loki_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "loki", "uid": "{{ grafana_loki_uid }}"},
"expr": "sum by (geoip_location_latitude, geoip_location_longitude, geoip_country_name) (count_over_time({job=\"fail2ban\"} |= \"Ban\" [$__range]))",
"queryType": "instant"
}
],
"options": {
"basemap": {"type": "default", "name": "Basemap"},
"layers": [
{
"type": "markers",
"name": "bans",
"location": {"mode": "coords", "latitude": "geoip_location_latitude", "longitude": "geoip_location_longitude"},
"config": {"style": {"color": {"fixed": "red"}, "size": {"field": "Value", "min": 4, "max": 20}, "opacity": 0.6}}
}
],
"view": {"id": "zero", "lat": 25, "lon": 10, "zoom": 1.6}
},
"fieldConfig": {"defaults": {}, "overrides": []}
},
{
"type": "logs",
"title": "Ingress journal and firewall",
"id": 10,
"gridPos": {"h": 11, "w": 12, "x": 12, "y": 19},
"datasource": {"type": "loki", "uid": "{{ grafana_loki_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "loki", "uid": "{{ grafana_loki_uid }}"},
"expr": "{host=\"ingress\"}",
"queryType": "range"
}
],
"options": {
"showTime": true,
"sortOrder": "Descending",
"wrapLogMessage": true,
"enableLogDetails": true,
"dedupStrategy": "none",
"prettifyLogMessage": false
}
}
]
}
@@ -0,0 +1,195 @@
{
"id": null,
"uid": "beepi-services",
"title": "Services",
"tags": ["beepi", "services"],
"timezone": "browser",
"schemaVersion": 39,
"version": 1,
"refresh": "30s",
"time": {"from": "now-24h", "to": "now"},
"panels": [
{
"type": "table",
"title": "Service health",
"id": 1,
"gridPos": {"h": 10, "w": 24, "x": 0, "y": 0},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "enabled",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "max by (service) (service_enabled)",
"instant": true,
"format": "table"
},
{
"refId": "units",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "max by (service) (service_units_active) / max by (service) (service_units_total)",
"instant": true,
"format": "table"
},
{
"refId": "local",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "min by (service) (probe_success{vantage=\"local\"})",
"instant": true,
"format": "table"
},
{
"refId": "vhost",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "min by (service) (probe_success{vantage=\"nginx\"})",
"instant": true,
"format": "table"
},
{
"refId": "latency",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "max by (service) (probe_duration_seconds{vantage=\"nginx\"})",
"instant": true,
"format": "table"
}
],
"transformations": [
{"id": "joinByField", "options": {"byField": "service", "mode": "outer"}},
{"id": "organize", "options": {
"excludeByName": {"Time": true, "Time 1": true, "Time 2": true, "Time 3": true, "Time 4": true, "Time 5": true},
"renameByName": {
"service": "Service",
"Value #enabled": "Expected",
"Value #units": "Units",
"Value #local": "Local probe",
"Value #vhost": "Public vhost",
"Value #latency": "Latency"
}
}}
],
"fieldConfig": {
"defaults": {"custom": {"align": "auto", "cellOptions": {"type": "auto"}}},
"overrides": [
{"matcher": {"id": "byName", "options": "Expected"}, "properties": [
{"id": "mappings", "value": [{"type": "value", "options": {"0": {"text": "disabled", "color": "text", "index": 0}, "1": {"text": "yes", "color": "green", "index": 1}}}]},
{"id": "custom.cellOptions", "value": {"type": "color-text"}}
]},
{"matcher": {"id": "byName", "options": "Units"}, "properties": [
{"id": "unit", "value": "percentunit"},
{"id": "custom.cellOptions", "value": {"type": "color-background"}},
{"id": "thresholds", "value": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "orange", "value": 0.5}, {"color": "green", "value": 1}]}}
]},
{"matcher": {"id": "byName", "options": "Local probe"}, "properties": [
{"id": "custom.cellOptions", "value": {"type": "color-background"}},
{"id": "mappings", "value": [
{"type": "value", "options": {"0": {"text": "DOWN", "color": "red", "index": 0}, "1": {"text": "up", "color": "green", "index": 1}}},
{"type": "special", "options": {"match": "null", "result": {"text": "no check", "color": "#3a3f47", "index": 2}}}
]},
{"id": "noValue", "value": "no check"},
{"id": "thresholds", "value": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]}}
]},
{"matcher": {"id": "byName", "options": "Public vhost"}, "properties": [
{"id": "custom.cellOptions", "value": {"type": "color-background"}},
{"id": "mappings", "value": [
{"type": "value", "options": {"0": {"text": "DOWN", "color": "red", "index": 0}, "1": {"text": "up", "color": "green", "index": 1}}},
{"type": "special", "options": {"match": "null", "result": {"text": "internal only", "color": "#3a3f47", "index": 2}}}
]},
{"id": "noValue", "value": "internal only"},
{"id": "thresholds", "value": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]}}
]},
{"matcher": {"id": "byName", "options": "Latency"}, "properties": [{"id": "unit", "value": "s"}]}
]
},
"options": {"showHeader": true, "sortBy": [{"displayName": "Service", "desc": false}]}
},
{
"type": "state-timeline",
"title": "Probe history",
"id": 2,
"gridPos": {"h": 9, "w": 24, "x": 0, "y": 10},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "min by (service) (probe_success{vantage=\"local\"})",
"legendFormat": "{{ '{{' }}service{{ '}}' }}"
}
],
"fieldConfig": {
"defaults": {
"custom": {"fillOpacity": 90, "lineWidth": 0},
"mappings": [{"type": "value", "options": {"0": {"text": "down", "color": "red", "index": 0}, "1": {"text": "up", "color": "green", "index": 1}}}],
"thresholds": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]}
},
"overrides": []
},
"options": {"mergeValues": true, "showValue": "never", "legend": {"displayMode": "list", "placement": "bottom", "showLegend": false}}
},
{
"type": "table",
"title": "Units and containers",
"id": 3,
"gridPos": {"h": 10, "w": 12, "x": 0, "y": 19},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "service_unit_active",
"instant": true,
"format": "table"
}
],
"transformations": [
{"id": "organize", "options": {
"excludeByName": {"Time": true, "__name__": true, "instance": true, "job": true, "host": true},
"renameByName": {"service": "Service", "unit": "Unit", "kind": "Kind", "Value": "Active"}
}}
],
"fieldConfig": {
"defaults": {"custom": {"align": "auto"}},
"overrides": [
{"matcher": {"id": "byName", "options": "Active"}, "properties": [
{"id": "custom.cellOptions", "value": {"type": "color-background"}},
{"id": "mappings", "value": [{"type": "value", "options": {"0": {"text": "stopped", "color": "red", "index": 0}, "1": {"text": "running", "color": "green", "index": 1}}}]},
{"id": "thresholds", "value": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "green", "value": 1}]}}
]}
]
},
"options": {"showHeader": true}
},
{
"type": "table",
"title": "TLS certificates",
"id": 4,
"gridPos": {"h": 10, "w": 12, "x": 12, "y": 19},
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "prometheus", "uid": "{{ grafana_prometheus_uid }}"},
"expr": "min by (service, instance) (probe_ssl_earliest_cert_expiry - time())",
"instant": true,
"format": "table"
}
],
"transformations": [
{"id": "organize", "options": {
"excludeByName": {"Time": true},
"renameByName": {"service": "Service", "instance": "Endpoint", "Value": "Expires in"}
}}
],
"fieldConfig": {
"defaults": {"custom": {"align": "auto"}},
"overrides": [
{"matcher": {"id": "byName", "options": "Expires in"}, "properties": [
{"id": "unit", "value": "s"},
{"id": "custom.cellOptions", "value": {"type": "color-background"}},
{"id": "thresholds", "value": {"mode": "absolute", "steps": [{"color": "red", "value": null}, {"color": "orange", "value": 1209600}, {"color": "green", "value": 2592000}]}}
]}
]
},
"options": {"showHeader": true}
}
]
}
@@ -0,0 +1,149 @@
{
"id": null,
"uid": "beepi-uptimerobot",
"title": "External Checks",
"tags": ["beepi", "uptimerobot"],
"timezone": "browser",
"schemaVersion": 39,
"version": 1,
"refresh": "5m",
"time": {"from": "now-24h", "to": "now"},
"panels": [
{
"type": "stat",
"title": "Monitors down",
"id": 1,
"gridPos": {"h": 5, "w": 6, "x": 0, "y": 0},
"datasource": {"type": "yesoreyeram-infinity-datasource", "uid": "{{ grafana_uptimerobot_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "yesoreyeram-infinity-datasource", "uid": "{{ grafana_uptimerobot_uid }}"},
"type": "json",
"source": "url",
"parser": "backend",
"format": "table",
"url": "https://api.uptimerobot.com/v2/getMonitors?format=json&custom_uptime_ratios=1-7-30",
"url_options": {"method": "POST", "data": ""},
"root_selector": "monitors",
"columns": [
{"selector": "friendly_name", "text": "Monitor", "type": "string"},
{"selector": "status", "text": "Status", "type": "number"}
],
"filterExpression": "status == 8 || status == 9"
}
],
"transformations": [{"id": "reduce", "options": {"reducers": ["count"]}}],
"fieldConfig": {
"defaults": {
"thresholds": {"mode": "absolute", "steps": [{"color": "green", "value": null}, {"color": "red", "value": 1}]},
"unit": "short"
},
"overrides": []
},
"options": {
"colorMode": "background",
"graphMode": "none",
"textMode": "value",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "/^Status$/", "values": false}
}
},
{
"type": "table",
"title": "UptimeRobot monitors",
"id": 2,
"gridPos": {"h": 12, "w": 18, "x": 6, "y": 0},
"datasource": {"type": "yesoreyeram-infinity-datasource", "uid": "{{ grafana_uptimerobot_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "yesoreyeram-infinity-datasource", "uid": "{{ grafana_uptimerobot_uid }}"},
"type": "json",
"source": "url",
"parser": "backend",
"format": "table",
"url": "https://api.uptimerobot.com/v2/getMonitors?format=json&custom_uptime_ratios=1-7-30",
"url_options": {"method": "POST", "data": ""},
"root_selector": "monitors",
"columns": [
{"selector": "friendly_name", "text": "Monitor", "type": "string"},
{"selector": "status", "text": "Status", "type": "number"},
{"selector": "custom_uptime_ratio", "text": "Uptime 1d-7d-30d", "type": "string"},
{"selector": "interval", "text": "Interval", "type": "number"},
{"selector": "url", "text": "URL", "type": "string"}
]
}
],
"fieldConfig": {
"defaults": {"custom": {"align": "auto", "cellOptions": {"type": "auto"}}},
"overrides": [
{
"matcher": {"id": "byName", "options": "Status"},
"properties": [
{"id": "custom.cellOptions", "value": {"type": "color-background"}},
{"id": "mappings", "value": [{"type": "value", "options": {
"0": {"text": "paused", "color": "text", "index": 0},
"1": {"text": "not checked", "color": "blue", "index": 1},
"2": {"text": "UP", "color": "green", "index": 2},
"8": {"text": "SEEMS DOWN", "color": "orange", "index": 3},
"9": {"text": "DOWN", "color": "red", "index": 4}
}}]},
{"id": "custom.width", "value": 130}
]
},
{
"matcher": {"id": "byName", "options": "Interval"},
"properties": [{"id": "unit", "value": "s"}, {"id": "custom.width", "value": 100}]
},
{
"matcher": {"id": "byName", "options": "Uptime 1d-7d-30d"},
"properties": [{"id": "custom.width", "value": 190}]
}
]
},
"options": {"showHeader": true, "sortBy": [{"displayName": "Status", "desc": true}]}
},
{
"type": "stat",
"title": "Monitors configured",
"id": 3,
"gridPos": {"h": 5, "w": 6, "x": 0, "y": 5},
"datasource": {"type": "yesoreyeram-infinity-datasource", "uid": "{{ grafana_uptimerobot_uid }}"},
"targets": [
{
"refId": "A",
"datasource": {"type": "yesoreyeram-infinity-datasource", "uid": "{{ grafana_uptimerobot_uid }}"},
"type": "json",
"source": "url",
"parser": "backend",
"format": "table",
"url": "https://api.uptimerobot.com/v2/getMonitors?format=json",
"url_options": {"method": "POST", "data": ""},
"root_selector": "monitors",
"columns": [{"selector": "status", "text": "Status", "type": "number"}]
}
],
"transformations": [{"id": "reduce", "options": {"reducers": ["count"]}}],
"fieldConfig": {
"defaults": {"color": {"mode": "fixed", "fixedColor": "blue"}, "unit": "short"},
"overrides": []
},
"options": {
"colorMode": "value",
"graphMode": "none",
"textMode": "value",
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "/^Status$/", "values": false}
}
},
{
"type": "text",
"title": "About",
"id": 4,
"gridPos": {"h": 4, "w": 24, "x": 0, "y": 12},
"options": {
"mode": "markdown",
"content": "External reachability is checked by UptimeRobot from outside the network, which is the one thing this stack cannot do for itself: everything else runs on beepi, so it cannot report that beepi is down.\n\nThe free plan allows 10 API requests per minute. This dashboard refreshes every 5 minutes."
}
}
]
}
@@ -0,0 +1,34 @@
apiVersion: 1
contactPoints:
- orgId: 1
name: discord
receivers:
- uid: discord-beepi
type: discord
settings:
url: {{ discord_webhook }}
title: '{{ '{{' }} template "default.title" . {{ '}}' }}'
message: |
{{ '{{' }} range .Alerts {{ '}}' }}**{{ '{{' }} .Labels.alertname {{ '}}' }}** {{ '{{' }} if .Labels.service {{ '}}' }}({{ '{{' }} .Labels.service {{ '}}' }}){{ '{{' }} end {{ '}}' }}
{{ '{{' }} .Annotations.summary {{ '}}' }}
{{ '{{' }} end {{ '}}' }}
use_discord_username: true
disableResolveMessage: false
policies:
- orgId: 1
receiver: discord
group_by:
- alertname
- service
- job
group_wait: 30s
group_interval: 5m
repeat_interval: 12h
routes:
- receiver: discord
object_matchers:
- ['severity', '=', 'critical']
group_wait: 10s
repeat_interval: 4h
@@ -0,0 +1,57 @@
apiVersion: 1
groups:
{% for group in alert_groups %}
- orgId: 1
name: {{ group.name }}
folder: {{ grafana_folder }}
interval: {{ group.interval }}
rules:
{% for rule in group.rules %}
- uid: {{ rule.uid }}
title: {{ rule.title }}
condition: C
for: {{ rule['for'] }}
noDataState: {{ rule.no_data | default('NoData') }}
execErrState: Alerting
labels:
severity: {{ rule.severity }}
annotations:
summary: {{ rule.summary }}
data:
- refId: A
relativeTimeRange:
from: 600
to: 0
datasourceUid: {{ grafana_loki_uid if rule.source | default('prometheus') == 'loki' else grafana_prometheus_uid }}
model:
refId: A
expr: '{{ rule.expr }}'
instant: true
{% if rule.source | default('prometheus') == 'loki' %}
queryType: instant
{% else %}
range: false
{% endif %}
- refId: B
datasourceUid: __expr__
model:
refId: B
type: reduce
expression: A
reducer: last
settings:
mode: dropNN
- refId: C
datasourceUid: __expr__
model:
refId: C
type: threshold
expression: B
conditions:
- evaluator:
type: {{ rule.op }}
params:
- {{ rule.threshold }}
{% endfor %}
{% endfor %}
@@ -0,0 +1,26 @@
apiVersion: 1
providers:
- name: beepi
orgId: 1
folder: {{ grafana_folder }}
folderUid: {{ grafana_folder_uid }}
type: file
disableDeletion: false
updateIntervalSeconds: 30
allowUiUpdates: false
options:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: false
- name: general
orgId: 1
folder: {{ grafana_general_folder }}
folderUid: {{ grafana_general_folder_uid }}
type: file
disableDeletion: false
updateIntervalSeconds: 30
allowUiUpdates: false
options:
path: /var/lib/grafana/dashboards-general
foldersFromFilesStructure: false
@@ -0,0 +1,49 @@
apiVersion: 1
datasources:
- name: prometheus
uid: {{ grafana_prometheus_uid }}
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
editable: false
jsonData:
timeInterval: 15s
httpMethod: POST
- name: loki
uid: {{ grafana_loki_uid }}
type: loki
access: proxy
url: http://loki:3100
editable: false
jsonData:
maxLines: 2000
- name: topology
uid: {{ grafana_infinity_uid }}
type: yesoreyeram-infinity-datasource
access: proxy
editable: false
jsonData:
allowedHosts:
- http://topology:8088
global_queries: []
{% if uptimerobot_enabled %}
- name: uptimerobot
uid: {{ grafana_uptimerobot_uid }}
type: yesoreyeram-infinity-datasource
access: proxy
editable: false
jsonData:
auth_method: apiKey
apiKeyKey: api_key
apiKeyType: query
allowedHosts:
- https://api.uptimerobot.com
global_queries: []
secureJsonData:
apiKeyValue: {{ uptimerobot_api_key }}
{% endif %}