Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
fix: propagate unified agent version and improve legacy cleanup
rcourtmanae3b78d661dc
diff --git a/cmd/pulse-agent/main.go b/cmd/pulse-agent/main.goindex b4fd784903..d8033a59ce 100644--- a/cmd/pulse-agent/main.go+++ b/cmd/pulse-agent/main.go@@ -82,6 +82,7 @@ func main() {HostnameOverride: cfg.HostnameOverride,AgentID: cfg.AgentID, // Shared ID? Or separate? Usually separate for now.AgentType: "unified",+ AgentVersion: Version, // Pass unified agent versionTags: cfg.Tags,InsecureSkipVerify: cfg.InsecureSkipVerify,LogLevel: cfg.LogLevel,@@ -111,6 +112,7 @@ func main() {HostnameOverride: cfg.HostnameOverride,AgentID: cfg.AgentID,AgentType: "unified",+ AgentVersion: Version, // Pass unified agent versionInsecureSkipVerify: cfg.InsecureSkipVerify,DisableAutoUpdate: true, // Unified agent handles updatesLogLevel: cfg.LogLevel,diff --git a/internal/dockeragent/agent.go b/internal/dockeragent/agent.goindex 7cef43aaa5..cd0249bf77 100644--- a/internal/dockeragent/agent.go+++ b/internal/dockeragent/agent.go@@ -48,6 +48,7 @@ type Config struct {HostnameOverride stringAgentID stringAgentType string // "unified" when running as part of pulse-agent, empty for standalone+ AgentVersion string // Version to report; if empty, uses dockeragent.VersionInsecureSkipVerify boolDisableAutoUpdate boolTargets []TargetConfig@@ -88,6 +89,7 @@ type Agent struct {daemonHost stringruntime RuntimeKindruntimeVer string+ agentVersion stringsupportsSwarm boolhttpClients map[bool]*http.Clientlogger zerolog.Logger@@ -226,12 +228,19 @@ func New(cfg Config) (*Agent, error) {}}+ // Use configured version or fall back to package version+ agentVersion := cfg.AgentVersion+ if agentVersion == "" {+ agentVersion = Version+ }+agent := &Agent{cfg: cfg,docker: dockerClient,daemonHost: dockerClient.DaemonHost(),runtime: runtimeKind,runtimeVer: info.ServerVersion,+ agentVersion: agentVersion,supportsSwarm: runtimeKind == RuntimeDocker,httpClients: httpClients,logger: *logger,@@ -656,7 +665,7 @@ func (a *Agent) buildReport(ctx context.Context) (agentsdocker.Report, error) {report := agentsdocker.Report{Agent: agentsdocker.AgentInfo{ID: agentID,- Version: Version,+ Version: a.agentVersion,Type: a.cfg.AgentType,IntervalSeconds: int(a.cfg.Interval / time.Second),},diff --git a/internal/hostagent/agent.go b/internal/hostagent/agent.goindex fe6efc3cd7..def8bbb82c 100644--- a/internal/hostagent/agent.go+++ b/internal/hostagent/agent.go@@ -28,6 +28,7 @@ type Config struct {HostnameOverride stringAgentID stringAgentType string // "unified" when running as part of pulse-agent, empty for standalone+ AgentVersion string // Version to report; if empty, uses hostagent.VersionTags []stringInsecureSkipVerify boolRunOnce bool@@ -51,6 +52,7 @@ type Agent struct {architecture stringmachineID stringagentID string+ agentVersion stringinterval time.DurationtrimmedPulseURL string}@@ -156,6 +158,12 @@ func New(cfg Config) (*Agent, error) {}cfg.Tags = trimmedTags+ // Use configured version or fall back to package version+ agentVersion := cfg.AgentVersion+ if agentVersion == "" {+ agentVersion = Version+ }+return &Agent{cfg: cfg,logger: logger,@@ -170,6 +178,7 @@ func New(cfg Config) (*Agent, error) {architecture: arch,machineID: machineID,agentID: agentID,+ agentVersion: agentVersion,interval: cfg.Interval,trimmedPulseURL: pulseURL,}, nil@@ -241,7 +250,7 @@ func (a *Agent) buildReport(ctx context.Context) (agentshost.Report, error) {report := agentshost.Report{Agent: agentshost.AgentInfo{ID: a.agentID,- Version: Version,+ Version: a.agentVersion,Type: a.cfg.AgentType,IntervalSeconds: int(a.interval / time.Second),Hostname: a.hostname,diff --git a/scripts/install.ps1 b/scripts/install.ps1index f637f2eda3..a43d4b1dd9 100644--- a/scripts/install.ps1+++ b/scripts/install.ps1@@ -70,6 +70,26 @@ try {Exit 1}+# --- Legacy Cleanup ---+# Remove old agents if they exist to prevent conflicts+Write-Host "Checking for legacy agents..." -ForegroundColor Cyan++if (Get-Service "PulseHostAgent" -ErrorAction SilentlyContinue) {+ Write-Host "Removing legacy PulseHostAgent..." -ForegroundColor Yellow+ Stop-Service "PulseHostAgent" -Force -ErrorAction SilentlyContinue+ sc.exe delete "PulseHostAgent" | Out-Null+ Remove-Item "C:\Program Files\Pulse\pulse-host-agent.exe" -Force -ErrorAction SilentlyContinue+ Start-Sleep -Seconds 2+}++if (Get-Service "PulseDockerAgent" -ErrorAction SilentlyContinue) {+ Write-Host "Removing legacy PulseDockerAgent..." -ForegroundColor Yellow+ Stop-Service "PulseDockerAgent" -Force -ErrorAction SilentlyContinue+ sc.exe delete "PulseDockerAgent" | Out-Null+ Remove-Item "C:\Program Files\Pulse\pulse-docker-agent.exe" -Force -ErrorAction SilentlyContinue+ Start-Sleep -Seconds 2+}+# --- Service Installation ---Write-Host "Configuring Windows Service..." -ForegroundColor Cyandiff --git a/scripts/install.sh b/scripts/install.shindex 32d4219334..fdb2564514 100644--- a/scripts/install.sh+++ b/scripts/install.sh@@ -166,6 +166,12 @@ if [[ "$OS" == "darwin" ]]; thenrm -f /Library/LaunchDaemons/com.pulse.host-agent.plistrm -f /usr/local/bin/pulse-host-agentfi+ if launchctl list | grep -q "com.pulse.docker-agent"; then+ log_warn "Removing legacy com.pulse.docker-agent..."+ launchctl unload /Library/LaunchDaemons/com.pulse.docker-agent.plist 2>/dev/null || true+ rm -f /Library/LaunchDaemons/com.pulse.docker-agent.plist+ rm -f /usr/local/bin/pulse-docker-agent+ fifi# --- Service Installation ---