script to remotely start an application instance

just wanted to ask if anybody have script template for the subject above so I can make ti as my guide? example

a. server 1.1.1.1: restart script located at /etc/init.d/glassfish.sh
b. server 2.2.2.2: central script that support admin will use to execute to restart the /etc/init.d/glassfish.sh at server 1.1.1.1

note: rlogin, telnet, rsh disabled. server 2.2.2.2 can only ssh 1.1.1.1 asking for login pw.

any ideas so I can make it as my guide? I will create a central script as per my old thread to remotely restart several application instances (like glassfish, sun java etc).

thanks for the guide