to check if a remote server is up

I need to check if a remote server is up before i send a file to it through FTP. I thought of using "ping" command to check it. But the problem is, my script needs to run from 2 different servers, one is Solaris and other is HP-UX. And ping works in different way in each of them

when I do - ping "IPaddress"
In Solaris, it gives me IPaddress is alive
But in HP-UX, it keeps on pinging the remote server by sending packets and doesn't break until I press ctrl+C.

Is there any common way, I can check if a remote server is up from any OS???

do this

ping -s IP or hostname

There is no "-s" switch to "ping" in HP-UX .

To send one ping packet in HP-UX:

ping servername -n 1

You'll probably need to test for the O/S in the script and issue the appropriate command:

uname -s

yes... I am planning to do that...

I also thought of
telnet IP 22 << ! >1.log
^]
q
!
where 22 is default port

but this may create give me failure if telnet on the remote is down and not neccassarily the server itself.

So will go with something like:
case `uname` in
HP-UX) ping IP -n 1
SOLARIS) ping IP
...
...
esac

Thanks for your help!!!!