Files
proxmox/scripts/archive/consolidated/verify/check-all-vm-ips.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

49 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
# Load IP configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
# Simple IP audit - checks all VMs/containers for IP conflicts
set -e
source "$(dirname "$0")/load-physical-inventory.sh" 2>/dev/null || true
HOSTS="ml110:${PROXMOX_HOST_ML110:-192.168.11.10}:${PROXMOX_PASS_ML110:-L@kers2010} pve:${PROXMOX_HOST_R630_01:-192.168.11.11}:${PROXMOX_PASS_R630_01:-password} pve2:${PROXMOX_HOST_R630_02:-192.168.11.12}:${PROXMOX_PASS_R630_02:-password}"
echo "=== IP Address Audit ==="
echo ""
TMP=$(mktemp)
for host_info in $HOSTS; do
IFS=: read -r hostname ip password <<< "$host_info"
echo "Scanning $hostname ($ip)..."
sshpass -p "$password" ssh -o StrictHostKeyChecking=no root@"$ip" "pct list 2>/dev/null | awk 'NR>1 {print \$1}' | while read vmid; do ip=\$(pct config \$vmid 2>/dev/null | grep -oP 'ip=\K[^,]+' | head -1); if [[ -n \"\$ip\" ]] && [[ \"\$ip\" != \"dhcp\" ]]; then echo \"$hostname:CT:\$vmid:\${ip%/*}\"; fi; done" 2>/dev/null >> "$TMP" || true
done
echo ""
echo "=== All VM/Container IPs ==="
printf "%-15s %-8s %-6s %-15s\n" "IP Address" "Type" "VMID" "Proxmox Host"
echo "------------------------------------------------"
sort -t: -k4 -V "$TMP" | while IFS=: read -r host type vmid ip; do
printf "%-15s %-8s %-6s %-15s\n" "$ip" "$type" "$vmid" "$host"
done
echo ""
echo "=== Conflict Check ==="
conflicts=$(sort -t: -k4 "$TMP" | cut -d: -f4 | uniq -d)
if [[ -z "$conflicts" ]]; then
echo "✓ No IP conflicts found"
else
echo "✗ Conflicts found:"
echo "$conflicts" | while read ip; do
echo " $ip used by:"
grep ":$ip$" "$TMP" | sed 's/^/ /'
done
fi
rm -f "$TMP"