This is something that we need to do as well. We have Jenkins instances distributed globally and in one case, we need to trigger jobs remotely on other Jenkins instances.
What we do is have the remote job trigger set to "Trigger builds remotely" with a specific authentication token. On the local machine, we execute a "curl" command to the remote job's URL, passing the authentication token and an additional parameter.
# Start the build
curl $JOB_URL/buildWithParameters?token=AUTH_TOKEN\&myParm=abcd
if [ ! "$?" = "0" ]; then
exit 1
fi
We then use curl with json to poll the remote job for status. If you only care about triggering the job and not the status, you can skip this part.
# Poll every sixty seconds until the build is finished
JOB_STATUS_URL=${JOB_URL}/lastBuild/api/json
while [ $GREP_RETURN_CODE -eq 0 ]
do
sleep 60
# Grep will return 0 while the build is running:
curl --silent $JOB_STATUS_URL | grep result\":null > /dev/null
GREP_RETURN_CODE=$?
done