propagation: single registry drives all node references
New bin/netvm-registry.py parses NODES.md (node -> cdp_port); every consumer reads from it instead of hardcoding: - onboard-driver.py: CDP_PORTS dict -> registry lookup (new nodes work) - muse-signin.py: hardcoded 9410 -> --node/--cdp-port args - muse-chat-api.py: hardcoded ACCOUNTS -> registry-built - agent-health.sh: hardcoded muse/pip blocks -> loop over all active nodes (646 and opm now get health coverage too) NODES.md: record opm node (9440).
This commit is contained in:
+19
-20
@@ -49,28 +49,27 @@ restart_browser() {
|
||||
# Main
|
||||
echo "=== Health check $(date -Iseconds) ===" >> "$LOG"
|
||||
|
||||
# muse (node muse, CDP 9410)
|
||||
if ! check_agent "muse" "muse" "9410"; then
|
||||
restart_browser "muse" "9410"
|
||||
sleep 5
|
||||
if ! check_agent "muse" "muse" "9410"; then
|
||||
echo "$(date -Iseconds) muse: CRITICAL - still down after restart" >> "$LOG"
|
||||
# TODO: Alert operator (e.g., via board post or email)
|
||||
else
|
||||
echo "$(date -Iseconds) muse: RECOVERED after restart" >> "$LOG"
|
||||
check_one() {
|
||||
local agent=$1
|
||||
local cdp_port=$2
|
||||
# node == agent == profile (unified naming)
|
||||
if ! check_agent "$agent" "$agent" "$cdp_port"; then
|
||||
restart_browser "$agent" "$cdp_port"
|
||||
sleep 5
|
||||
if ! check_agent "$agent" "$agent" "$cdp_port"; then
|
||||
echo "$(date -Iseconds) $agent: CRITICAL - still down after restart" >> "$LOG"
|
||||
# TODO: Alert operator (e.g., via board post or email)
|
||||
else
|
||||
echo "$(date -Iseconds) $agent: RECOVERED after restart" >> "$LOG"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# pip (node pip, CDP 9420)
|
||||
if ! check_agent "pip" "pip" "9420"; then
|
||||
restart_browser "pip" "9420"
|
||||
sleep 5
|
||||
if ! check_agent "pip" "pip" "9420"; then
|
||||
echo "$(date -Iseconds) pip: CRITICAL - still down after restart" >> "$LOG"
|
||||
else
|
||||
echo "$(date -Iseconds) pip: RECOVERED after restart" >> "$LOG"
|
||||
fi
|
||||
fi
|
||||
# Every active node in the NODES.md registry gets checked — new nodes
|
||||
# propagate automatically, no per-node blocks to add.
|
||||
"$NETVM_BIN/netvm-registry.py" 2>/dev/null | while IFS=: read -r node port; do
|
||||
[ -n "$node" ] && [ -n "$port" ] && check_one "$node" "$port"
|
||||
done
|
||||
|
||||
# Trim log (keep last 1000 lines)
|
||||
tail -1000 "$LOG" > "$LOG.tmp" && mv "$LOG.tmp" "$LOG"
|
||||
|
||||
Reference in New Issue
Block a user