From 2efb4326bfe71352e28141c13f7662b92dce4e6d Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Sun, 17 Aug 2025 19:06:06 +0000 Subject: [PATCH] fix: set PBS status to offline when connection fails (addresses #326) When both GetVersion and GetDatastores fail for PBS, properly set the Status field to 'offline' and ConnectionHealth to 'error'. This prevents the red dot from appearing when the instance state is undefined. --- internal/monitoring/monitor.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/monitoring/monitor.go b/internal/monitoring/monitor.go index 2e110e553..5909545e0 100644 --- a/internal/monitoring/monitor.go +++ b/internal/monitoring/monitor.go @@ -1516,6 +1516,8 @@ func (m *Monitor) pollPBSInstance(ctx context.Context, instanceName string, clie Msg("PBS connected (version unavailable but datastores accessible)") } else { // Both failed - PBS is offline + pbsInst.Status = "offline" + pbsInst.ConnectionHealth = "error" monErr := errors.WrapConnectionError("get_pbs_version", instanceName, versionErr) log.Error().Err(monErr).Str("instance", instanceName).Msg("Failed to connect to PBS") m.state.SetConnectionHealth("pbs-"+instanceName, false)