From 4167f0f98876f39a05105db9e7d1a68ae69a2400 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Fri, 3 Apr 2026 17:53:42 -0300 Subject: [PATCH] monitoring(power): add UPS status snapshot table and climate placeholders --- scripts/dashboards_render_atlas.py | 11 ++++ .../monitoring/dashboards/atlas-power.json | 51 +++++++++++++++++++ .../monitoring/grafana-dashboard-power.yaml | 51 +++++++++++++++++++ 3 files changed, 113 insertions(+) diff --git a/scripts/dashboards_render_atlas.py b/scripts/dashboards_render_atlas.py index bff5c523..0f51403a 100644 --- a/scripts/dashboards_render_atlas.py +++ b/scripts/dashboards_render_atlas.py @@ -2982,6 +2982,17 @@ def build_power_dashboard(): "Future climate collector panel: fan RPM by position (inside inlet, outside inlet, outlet, interior)." ) panels.append(climate_fan_panel) + status_panel = table_panel( + 15, + "UPS Status Snapshot (OL/OB/LB)", + f"max by (instance, source, status, target) ({HECATE_UPS_RUNTIME_BY_SOURCE})", + {"h": 6, "w": 24, "x": 0, "y": 32}, + unit="s", + transformations=[{"id": "labelsToFields", "options": {}}, {"id": "sortBy", "options": {"fields": ["instance"], "order": "asc"}}], + instant=True, + ) + status_panel["description"] = "NUT status flags: OL=on line (utility), OB=on battery, LB=low battery." + panels.append(status_panel) return { "uid": "atlas-power", diff --git a/services/monitoring/dashboards/atlas-power.json b/services/monitoring/dashboards/atlas-power.json index 09ac2e43..dc02d35c 100644 --- a/services/monitoring/dashboards/atlas-power.json +++ b/services/monitoring/dashboards/atlas-power.json @@ -769,6 +769,57 @@ } }, "description": "Future climate collector panel: fan RPM by position (inside inlet, outside inlet, outlet, interior)." + }, + { + "id": 15, + "type": "table", + "title": "UPS Status Snapshot (OL/OB/LB)", + "datasource": { + "type": "prometheus", + "uid": "atlas-vm" + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 32 + }, + "targets": [ + { + "expr": "max by (instance, source, status, target) (hecate_ups_runtime_seconds{job=\"hecate-power\"})", + "refId": "A", + "instant": true + } + ], + "fieldConfig": { + "defaults": { + "unit": "s", + "custom": { + "filterable": true + } + }, + "overrides": [] + }, + "options": { + "showHeader": true, + "columnFilters": false + }, + "transformations": [ + { + "id": "labelsToFields", + "options": {} + }, + { + "id": "sortBy", + "options": { + "fields": [ + "instance" + ], + "order": "asc" + } + } + ], + "description": "NUT status flags: OL=on line (utility), OB=on battery, LB=low battery." } ], "time": { diff --git a/services/monitoring/grafana-dashboard-power.yaml b/services/monitoring/grafana-dashboard-power.yaml index f7214ddf..c2a770fe 100644 --- a/services/monitoring/grafana-dashboard-power.yaml +++ b/services/monitoring/grafana-dashboard-power.yaml @@ -778,6 +778,57 @@ data: } }, "description": "Future climate collector panel: fan RPM by position (inside inlet, outside inlet, outlet, interior)." + }, + { + "id": 15, + "type": "table", + "title": "UPS Status Snapshot (OL/OB/LB)", + "datasource": { + "type": "prometheus", + "uid": "atlas-vm" + }, + "gridPos": { + "h": 6, + "w": 24, + "x": 0, + "y": 32 + }, + "targets": [ + { + "expr": "max by (instance, source, status, target) (hecate_ups_runtime_seconds{job=\"hecate-power\"})", + "refId": "A", + "instant": true + } + ], + "fieldConfig": { + "defaults": { + "unit": "s", + "custom": { + "filterable": true + } + }, + "overrides": [] + }, + "options": { + "showHeader": true, + "columnFilters": false + }, + "transformations": [ + { + "id": "labelsToFields", + "options": {} + }, + { + "id": "sortBy", + "options": { + "fields": [ + "instance" + ], + "order": "asc" + } + } + ], + "description": "NUT status flags: OL=on line (utility), OB=on battery, LB=low battery." } ], "time": {