Skip to content

armgit / Pulse

Public Imported from GitHub
0

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.

fix(sensor-proxy): relax pvecm status parsing to support decimal node IDs

[email protected]1ae34285c527
diff --git a/cmd/pulse-sensor-proxy/ssh.go b/cmd/pulse-sensor-proxy/ssh.go
index ff718adf3d..b027af9462 100644
--- a/cmd/pulse-sensor-proxy/ssh.go
+++ b/cmd/pulse-sensor-proxy/ssh.go
@@ -740,24 +740,14 @@ func parseClusterNodes(output string) ([]string, error) {
var nodes []string
lines := strings.Split(output, "\n")
for _, line := range lines {
- // Look for lines with hex ID and IP address
- if !strings.Contains(line, "0x") {
- continue
- }
-
fields := strings.Fields(line)
- // Need at least 3 fields: hex_id votes ip [optional:(local)]
- if len(fields) < 3 {
+ // Need at least 2 fields to be a valid node line (id + ip/name)
+ if len(fields) < 2 {
continue
}
// Iterate through fields to find the IP address
for _, field := range fields {
- // Skip hex ID
- if strings.HasPrefix(field, "0x") {
- continue
- }
-
// Check if it's a valid IP
if ip := net.ParseIP(field); ip != nil {
nodes = append(nodes, field)
diff --git a/cmd/pulse-sensor-proxy/ssh_parsing_test.go b/cmd/pulse-sensor-proxy/ssh_parsing_test.go
index ced9c5891a..a1ff37ebf4 100644
--- a/cmd/pulse-sensor-proxy/ssh_parsing_test.go
+++ b/cmd/pulse-sensor-proxy/ssh_parsing_test.go
@@ -52,6 +52,14 @@ func TestParseClusterNodes(t *testing.T) {
output: "some random text",
wantErr: true,
},
+ {
+ name: "numeric node id format",
+ output: `Membership information
+----------------------
+ Nodeid Votes Name
+1 10.0.0.5 2`,
+ want: []string{"10.0.0.5"},
+ },
}
for _, tt := range tests {