ops: glance borg-backup-widget via prometheus + synthwave/matrix presets
- glance zusaetzlich in monitoring_net (nur lesende Prometheus-Query, kein neuer Listener) - Borg-Widget: Backup-Alter aus homelab_borg_last_completed_timestamp_seconds, Status aus homelab_borg_last_success - Theme-Presets synthwave und matrix Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,19 @@ theme:
|
|||||||
primary-color: 212 100 35
|
primary-color: 212 100 35
|
||||||
positive-color: 140 70 30
|
positive-color: 140 70 30
|
||||||
negative-color: 0 70 45
|
negative-color: 0 70 45
|
||||||
|
synthwave:
|
||||||
|
background-color: 265 35 10
|
||||||
|
primary-color: 320 100 65
|
||||||
|
positive-color: 175 100 50
|
||||||
|
negative-color: 0 100 65
|
||||||
|
contrast-multiplier: 1.3
|
||||||
|
matrix:
|
||||||
|
background-color: 130 25 6
|
||||||
|
primary-color: 130 100 55
|
||||||
|
positive-color: 130 100 45
|
||||||
|
negative-color: 35 100 55
|
||||||
|
contrast-multiplier: 1.25
|
||||||
|
text-saturation-multiplier: 1.2
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
$include: pages.yml
|
$include: pages.yml
|
||||||
|
|||||||
@@ -455,6 +455,34 @@
|
|||||||
username: ${GLANCE_ADGUARD_USERNAME}
|
username: ${GLANCE_ADGUARD_USERNAME}
|
||||||
password: ${GLANCE_ADGUARD_PASSWORD}
|
password: ${GLANCE_ADGUARD_PASSWORD}
|
||||||
|
|
||||||
|
- type: custom-api
|
||||||
|
title: Borg Backup
|
||||||
|
title-url: https://borg.kaleschke.info
|
||||||
|
cache: 15m
|
||||||
|
url: http://monitoring-prometheus:9090/api/v1/query?query=homelab_borg_last_completed_timestamp_seconds
|
||||||
|
subrequests:
|
||||||
|
success:
|
||||||
|
url: http://monitoring-prometheus:9090/api/v1/query?query=homelab_borg_last_success
|
||||||
|
template: |
|
||||||
|
{{ $ts := .JSON.Float "data.result.0.value.1" }}
|
||||||
|
{{ $archive := .JSON.String "data.result.0.metric.archive" }}
|
||||||
|
{{ $succ := .Subrequest "success" }}
|
||||||
|
{{ $ok := $succ.JSON.Float "data.result.0.value.1" }}
|
||||||
|
{{ $status := $succ.JSON.String "data.result.0.metric.status" }}
|
||||||
|
{{ if eq $ts 0.0 }}
|
||||||
|
<div class="text-center color-subdue">Keine Backup-Metrik gefunden</div>
|
||||||
|
{{ else }}
|
||||||
|
{{ $ageHours := div (sub (toFloat now.Unix) $ts) 3600.0 }}
|
||||||
|
<div class="text-center">
|
||||||
|
<div class="size-h2 {{ if gt $ageHours 30.0 }}color-negative{{ else }}color-positive{{ end }}">vor {{ printf "%.0f" $ageHours }} h</div>
|
||||||
|
<div class="size-h6 color-subdue" style="margin-top: 4px;">letztes abgeschlossenes Backup</div>
|
||||||
|
<div class="size-h6 {{ if eq $ok 1.0 }}color-positive{{ else }}color-negative{{ end }}" style="margin-top: 6px;">
|
||||||
|
{{ if eq $ok 1.0 }}letzter Job erfolgreich{{ else }}letzter Job: {{ $status }}{{ end }}
|
||||||
|
</div>
|
||||||
|
{{ if ne $archive "" }}<div class="size-h6 color-subdue text-truncate" style="margin-top: 2px;">{{ $archive }}</div>{{ end }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
- type: group
|
- type: group
|
||||||
widgets:
|
widgets:
|
||||||
- type: docker-containers
|
- type: docker-containers
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- frontend_net
|
- frontend_net
|
||||||
- glance_socket_net
|
- glance_socket_net
|
||||||
|
# monitoring_net nur lesend fuer Prometheus-Query des Borg-Backup-Widgets
|
||||||
|
- monitoring_net
|
||||||
depends_on:
|
depends_on:
|
||||||
- glance-docker-socket-proxy
|
- glance-docker-socket-proxy
|
||||||
labels:
|
labels:
|
||||||
@@ -56,6 +58,8 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
frontend_net:
|
frontend_net:
|
||||||
external: true
|
external: true
|
||||||
|
monitoring_net:
|
||||||
|
external: true
|
||||||
glance_socket_net:
|
glance_socket_net:
|
||||||
name: glance_socket_net
|
name: glance_socket_net
|
||||||
internal: true
|
internal: true
|
||||||
|
|||||||
Reference in New Issue
Block a user