command to check whether the remote host is up or not

Hi,

My script needs to check whether the remote host is up or not.

If it is up i need to start few servers in that host or else just a notification should be sent that the remote host is down?

Could someone help me out in this?

Regards
Arun

you can use following commands :

#ping <host_IP>
#ssh <host> ifconfig -a

:b:

If you use ksh, you can also use the
/dev/tcp/host/port, or
/dev/udp/host/port to check if a specific port is up in a host.
For more info:

ksh93 does that, not ksh (which is ksh88, but it is named just ksh- /bin/ksh)

Why not just go ahead and run the server starting code, without any separate host check? If the host is down, presumably the code (ssh?) will fail and you can send a notification then. You should be handling the failure anyway, since it's possible for the host to go down immediately after a successful check but prior to the execution of the server starting code.

Regards,
Alister