From 3474d53ce5c7d25a66e61e1d3fcfd791f38463e7 Mon Sep 17 00:00:00 2001 From: Micha Date: Fri, 12 Jun 2026 19:05:48 +0200 Subject: [PATCH] ops: glance borg-widget fix - alter via promql berechnen statt now.Unix im template Co-Authored-By: Claude Fable 5 --- ops/glance/config/home.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ops/glance/config/home.yml b/ops/glance/config/home.yml index ea818fd..0be73e7 100644 --- a/ops/glance/config/home.yml +++ b/ops/glance/config/home.yml @@ -459,20 +459,19 @@ 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 + url: http://monitoring-prometheus:9090/api/v1/query?query=(time()-homelab_borg_last_completed_timestamp_seconds)/3600 subrequests: success: url: http://monitoring-prometheus:9090/api/v1/query?query=homelab_borg_last_success template: | - {{ $ts := .JSON.Float "data.result.0.value.1" }} + {{ $ageHours := .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 }} + {{ if eq (len (.JSON.Array "data.result")) 0 }}
Keine Backup-Metrik gefunden
{{ else }} - {{ $ageHours := div (sub (toFloat now.Unix) $ts) 3600.0 }}
vor {{ printf "%.0f" $ageHours }} h
letztes abgeschlossenes Backup