Determining availability of a remote machine

Ian Matters Ian.Matters at iristech.com.au
Wed Apr 2 15:04:07 EST 2003


A shell script technique that I have used is this:

#!/bin/sh
NETWORK=some.address.com
if /bin/ping -c 1 -f $NETWORK &> 
/dev/null
then 

#       blah
#       blah
#       blah
else 

         echo 

         echo "ERROR: Cannot access network"
         echo 

fi 


Ian M.
---
At 07:50 AM 2/04/2003, you wrote:

>Hey,
>
>I need to be able to determine if a remote machine is available without
>living through a long timeout. For network configuration reasons I can't
>use ICMP.
>
>Anyone have a brilliant idea as to how to determine if a machine is alive
>in code without using ICMP? I thought of just connecting to a port, but I
>can't gaurantee that certain ports are open on the remote side, and
>firewalls might get in my way.
>
>Thanks,
>Mikal
>
>--
>
>Michael Still (mikal at stillhq.com) | Stage 1: Steal underpants
>http://www.stillhq.com            | Stage 2: ????
>UTC + 10                          | Stage 3: Profit




More information about the linux mailing list