Mark config-only nodes as unreachable when they have no IPs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ian Gulliver
2026-01-31 10:03:38 -08:00
parent bb22e16460
commit 280e786b73
3 changed files with 27 additions and 1 deletions

View File

@@ -91,7 +91,8 @@
"Bash(du:*)", "Bash(du:*)",
"Bash(tree:*)", "Bash(tree:*)",
"Bash(go get:*)", "Bash(go get:*)",
"Bash(go test:*)" "Bash(go test:*)",
"Bash(git stash:*)"
], ],
"ask": [ "ask": [
"Bash(rm *)" "Bash(rm *)"

View File

@@ -6,27 +6,35 @@ locations:
nodes: nodes:
- names: ["lighting-2"] - names: ["lighting-2"]
- names: ["Pixie Driver 8k 2 Port 1"] - names: ["Pixie Driver 8k 2 Port 1"]
ips: ["10.50.1.72"]
macs: ["48:59:00:41:00:29"] macs: ["48:59:00:41:00:29"]
avoid: true avoid: true
- names: ["Pixie Driver 8k 2 Port 2"] - names: ["Pixie Driver 8k 2 Port 2"]
ips: ["10.50.1.73"]
macs: ["48:59:00:28:00:27"] macs: ["48:59:00:28:00:27"]
avoid: true avoid: true
- names: ["Pixie Driver 8k 2 Port 3"] - names: ["Pixie Driver 8k 2 Port 3"]
ips: ["10.50.1.74"]
macs: ["48:59:00:43:00:29"] macs: ["48:59:00:43:00:29"]
avoid: true avoid: true
- names: ["Pixie Driver 8k 2 Port 4"] - names: ["Pixie Driver 8k 2 Port 4"]
ips: ["10.50.1.75"]
macs: ["48:59:00:42:00:29"] macs: ["48:59:00:42:00:29"]
avoid: true avoid: true
- names: ["Pixie Driver 8k 2 Port 5"] - names: ["Pixie Driver 8k 2 Port 5"]
ips: ["10.50.1.76"]
macs: ["48:59:00:3c:00:3e"] macs: ["48:59:00:3c:00:3e"]
avoid: true avoid: true
- names: ["Pixie Driver 8k 2 Port 6"] - names: ["Pixie Driver 8k 2 Port 6"]
ips: ["10.50.1.77"]
macs: ["48:59:00:3f:00:3e"] macs: ["48:59:00:3f:00:3e"]
avoid: true avoid: true
- names: ["Pixie Driver 8k 2 Port 7"] - names: ["Pixie Driver 8k 2 Port 7"]
ips: ["10.50.1.78"]
macs: ["48:59:00:25:00:3e"] macs: ["48:59:00:25:00:3e"]
avoid: true avoid: true
- names: ["Pixie Driver 8k 2 Port 8"] - names: ["Pixie Driver 8k 2 Port 8"]
ips: ["10.50.1.79"]
macs: ["48:59:00:41:00:3e"] macs: ["48:59:00:41:00:3e"]
avoid: true avoid: true
- names: ["DMXG"] # cyc1 - names: ["DMXG"] # cyc1
@@ -71,27 +79,35 @@ locations:
nodes: nodes:
- names: ["lighting-1"] - names: ["lighting-1"]
- names: ["Pixie Driver 8k 1 Port 1"] - names: ["Pixie Driver 8k 1 Port 1"]
ips: ["10.50.1.64"]
macs: ["48:59:00:27:00:27"] macs: ["48:59:00:27:00:27"]
avoid: true avoid: true
- names: ["Pixie Driver 8k 1 Port 2"] - names: ["Pixie Driver 8k 1 Port 2"]
ips: ["10.50.1.65"]
macs: ["48:59:00:37:00:27"] macs: ["48:59:00:37:00:27"]
avoid: true avoid: true
- names: ["Pixie Driver 8k 1 Port 3"] - names: ["Pixie Driver 8k 1 Port 3"]
ips: ["10.50.1.66"]
macs: ["48:59:00:3e:00:27"] macs: ["48:59:00:3e:00:27"]
avoid: true avoid: true
- names: ["Pixie Driver 8k 1 Port 4"] - names: ["Pixie Driver 8k 1 Port 4"]
ips: ["10.50.1.67"]
macs: ["48:59:00:3f:00:27"] macs: ["48:59:00:3f:00:27"]
avoid: true avoid: true
- names: ["Pixie Driver 8k 1 Port 5"] - names: ["Pixie Driver 8k 1 Port 5"]
ips: ["10.50.1.68"]
macs: ["48:59:00:47:00:1a"] macs: ["48:59:00:47:00:1a"]
avoid: true avoid: true
- names: ["Pixie Driver 8k 1 Port 6"] - names: ["Pixie Driver 8k 1 Port 6"]
ips: ["10.50.1.69"]
macs: ["48:59:00:44:00:1a"] macs: ["48:59:00:44:00:1a"]
avoid: true avoid: true
- names: ["Pixie Driver 8k 1 Port 7"] - names: ["Pixie Driver 8k 1 Port 7"]
ips: ["10.50.1.70"]
macs: ["48:59:00:42:00:19"] macs: ["48:59:00:42:00:19"]
avoid: true avoid: true
- names: ["Pixie Driver 8k 1 Port 8"] - names: ["Pixie Driver 8k 1 Port 8"]
ips: ["10.50.1.71"]
macs: ["48:59:00:44:00:19"] macs: ["48:59:00:44:00:19"]
avoid: true avoid: true

View File

@@ -158,6 +158,15 @@ func (t *Tendrils) pingNode(node *Node) {
t.nodes.mu.RUnlock() t.nodes.mu.RUnlock()
if len(ips) == 0 { if len(ips) == 0 {
t.ping.mu.Lock()
t.ping.failures[nodeID]++
failures := t.ping.failures[nodeID]
t.ping.mu.Unlock()
if failures >= pingFailureThreshold {
if node.SetUnreachable(true) {
log.Printf("[ping] %s is unreachable (no ip addresses)", nodeName)
}
}
return return
} }