Files
proxmox/scripts/audit-ip-conflicts-all-hosts.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

33 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Audit IP conflicts across all Proxmox hosts
# Outputs: vmid|ip|host
HOSTS="${PROXMOX_HOST_ML110:-192.168.11.10} ${PROXMOX_HOST_R630_01:-192.168.11.11} ${PROXMOX_HOST_R630_02:-192.168.11.12}"
TMPF=$(mktemp)
trap "rm -f $TMPF" EXIT
for host in $HOSTS; do
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5 root@$host "
for vmid in \$(pct list 2>/dev/null | awk 'NR>1{print \$1}'); do
pct config \$vmid 2>/dev/null | grep -oE 'ip=[0-9.]+/[0-9]+' | sed 's|ip=||;s|/.*||' | while read ip; do
echo \"\$vmid|\$ip|$host\"
done
done
" 2>/dev/null >> "$TMPF"
done
echo "=== All VMID|IP|Host ==="
sort -t'|' -k2,2 "$TMPF"
echo ""
echo "=== Duplicate IPs (conflicts) ==="
awk -F'|' '{ips[$2]=ips[$2] ? ips[$2] " + " $1"@"$3 : $1"@"$3; count[$2]++}
END {for (ip in count) if (count[ip]>1) print ip " -> " ips[ip]}' "$TMPF" | sort -V || echo "None found"
echo ""
echo "=== Invalid IPs (.0 or .255) ==="
awk -F'|' '{
split($2,a,".");
if (a[4]=="0" || a[4]=="255") print $1, $2, $3
}' "$TMPF" || echo "None found"