Files
proxmox/scripts/run-rpc-node-suite.sh

64 lines
1.7 KiB
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
# One-shot runner: RPC node health suite
#
# Runs:
# - Proxmox storage restriction audit
# - Besu heap sizing audit
# - Idempotent remediation script (dry-run by default)
# - Full RPC JSON-RPC test matrix against all nodes
#
# Usage:
# PROXMOX_HOST=${PROXMOX_HOST_ML110:-192.168.11.10} ./scripts/run-rpc-node-suite.sh
# PROXMOX_HOST=${PROXMOX_HOST_ML110:-192.168.11.10} ./scripts/run-rpc-node-suite.sh --apply --restart-besu
#
# Notes:
# - Remediation is dry-run unless you pass --apply.
# - --restart-besu only works with --apply.
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
PROXMOX_HOST="${PROXMOX_HOST:-192.168.11.10}"
APPLY_ARGS=()
while [[ $# -gt 0 ]]; do
case "$1" in
--apply) APPLY_ARGS+=("--apply"); shift ;;
--restart-besu) APPLY_ARGS+=("--restart-besu"); shift ;;
-h|--help)
sed -n '1,80p' "$0" | sed 's/^# \{0,1\}//'
exit 0
;;
*) echo "Unknown arg: $1" >&2; exit 2 ;;
esac
done
echo "=== RPC Node Health Suite ==="
echo "PROXMOX_HOST=${PROXMOX_HOST}"
echo "Remediation: ${APPLY_ARGS[*]:-(dry-run)}"
echo
echo "== 1) Storage audit =="
PROXMOX_HOST="${PROXMOX_HOST}" ./scripts/audit-proxmox-rpc-storage.sh
echo
echo "== 2) Besu heap audit =="
PROXMOX_HOST="${PROXMOX_HOST}" ./scripts/audit-proxmox-rpc-besu-heap.sh
echo
echo "== 3) Remediation (idempotent) =="
PROXMOX_HOST="${PROXMOX_HOST}" ./scripts/remediate-proxmox-rpc-stability.sh "${APPLY_ARGS[@]}"
echo
echo "== 4) Full RPC matrix test (writes reports/*) =="
python3 ./scripts/test-all-rpc-nodes.py --timeout 4 --threads 12
echo
echo "Done."