diff --git a/scripts/multi-node/blockchain-health-check.sh b/scripts/multi-node/blockchain-health-check.sh index 1793d4ae..bed0610f 100755 --- a/scripts/multi-node/blockchain-health-check.sh +++ b/scripts/multi-node/blockchain-health-check.sh @@ -57,7 +57,13 @@ log_warning() { ssh_exec() { local node="$1" local command="$2" - ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no "$node" "$command" 2>&1 || return 1 + + # If node is localhost, execute directly without SSH + if [ "$node" = "localhost" ] || [ "$node" = "$(hostname)" ]; then + bash -c "$command" 2>&1 || return 1 + else + ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no "$node" "$command" 2>&1 || return 1 + fi } # Check RPC endpoint health