From 0001d1cbbc02831ec080dccf383af9c6ae639b41 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Mon, 22 Dec 2025 22:12:04 +0000 Subject: [PATCH] feat: add PBS datastores to unified Storage view (#869) PBS datastores are now displayed in the Storage overview alongside PVE storage. Each PBS datastore is converted to a Storage entry with: - type: 'pbs' - content: 'backup' - shared: true - active: based on PBS instance status This provides a complete picture of all storage resources in one view while keeping detailed PBS info in the dedicated PBS section. Closes #869 --- internal/monitoring/monitor.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/internal/monitoring/monitor.go b/internal/monitoring/monitor.go index edbff1288..ecdd7f51c 100644 --- a/internal/monitoring/monitor.go +++ b/internal/monitoring/monitor.go @@ -7182,6 +7182,37 @@ func (m *Monitor) pollPBSInstance(ctx context.Context, instanceName string, clie Int("datastores", len(pbsInst.Datastores)). Msg("PBS instance updated in state") + // Convert PBS datastores to Storage entries for unified storage view + if len(pbsInst.Datastores) > 0 && instanceCfg.MonitorDatastores { + var pbsStorages []models.Storage + for _, ds := range pbsInst.Datastores { + // Create a storage entry for this PBS datastore + storageID := fmt.Sprintf("pbs-%s-%s", instanceName, ds.Name) + pbsStorage := models.Storage{ + ID: storageID, + Name: ds.Name, + Node: instanceName, // Use PBS instance name as "node" + Instance: "pbs-" + instanceName, + Type: "pbs", + Status: ds.Status, + Total: ds.Total, + Used: ds.Used, + Free: ds.Free, + Usage: ds.Usage, + Content: "backup", // PBS datastores are for backups + Shared: true, // PBS datastores are typically shared/network storage + Enabled: true, + Active: pbsInst.Status == "online", + } + pbsStorages = append(pbsStorages, pbsStorage) + } + m.state.UpdateStorageForInstance("pbs-"+instanceName, pbsStorages) + log.Debug(). + Str("instance", instanceName). + Int("storageEntries", len(pbsStorages)). + Msg("Added PBS datastores to unified storage view") + } + if m.alertManager != nil { m.alertManager.CheckPBS(pbsInst) }