SUMMARY:How to find out if machine is up remotely

From: Manish Doshi (
Date: Thu Sep 26 1996 - 13:00:03 CDT


My Original Post was:

> Subject: How to find out if machine is up remotely
> Hi managers,
> I update my printer files using rdist. We have variety of architectures
> and operating systems. My rdist always hangs and never finishes. I want to
make sure that machine is up and can do my rdist before I actually
> start the rdist. I don't want to use ping as it doesn't guarantee that
> my rdist will run for sure. Any better suggestions?? I would appreciate
> the reason for the suggestions. I will summarize.
> Thanks,
> Manish Doshi

One of the solution is to get new versin of rdist but that will require
me to compile is for every architecture that we have and every operating
system we have. So I will have to use a wrap around script like
rup or rsh with a timeout and then move on.

Thanks to everybody who replied.

Following were the replies:

Sender: Trevor Paquette <>
From: "Trevor Paquette" <>

Do a telnet to the daytime port. IF you get back the string
"Connection timed out" then the machine really isn't up..

/bin/rm t.out
telnet davinci daytime << EOF >& t.out
grep "Connection timed out" t.out >& /dev/null
if ( $status = 0 ) then
  /bin/rm t.out
  machine is up
  /bin/rm t.out
  machine is down

From: Stephen Potter <>

Check the 'echo' port. That should make sure the machine is in a usable
state as it is run from inetd.


From: (Umesh Vaghela)


You can use ping to find out if the machine is up or not. Ping returns
an exit status of 0 if it is up or else 1 if it fails for some reason.

I hope this helps.

From: Herbert Wengatz <>

How about an:
"rsh HOSTNAME uname -n" ?

This makes a remote login, executes a program, and delivers the hostname
back. - So you can be sure, that the program was actually running on the
machine you want to reach. You can login and execute programs...
What do you want more ?




        Use a series of the r* commands.

        ie: rcp (remote cp)

                ruptime (uptime executed on another machine)

             rusers (list of users on remote machine.)


From: Anchi Zhang <anchi@Starbase.NeoSoft.COM>

You could do

if rup remote_host
        rdist -c something remote_host

Though rup does not give you 100% guarantee, it is much better than

You could use "rsh remote_host date" but your rsh may hang too. A
sure solution is to have a timed rsh using perl or something but perl
adds a lot of overhead and thus not pratical if you have to reach many
remote hosts.


From: Bob Fulwiler <>

See if you can execute a simple rsh on the target machine. If it returns
ok, then you know that things should work.

From: scott hollatz <>

If I remember correctly, there is a program named 'fping' that will use TCP
packets instead of ICMP packets to ping the host. This will at least tell
you if the operating system is running.

From: (Jochen Bern)

This will have Side Effects, but you could replace rsh/rlogin/rcp
with ssh altogether (good_Thing (tm) for various Reasons, encrypted
Connection, Host Verification, automated DISPLAY Magic, to name a few)
and then configure it not to fall back to the original rsh (if the ssh
Connection fails) for local Connections. As far as I've observed it so
far, attempted ssh Connections time out pretty fast (several Seconds).

From: (Karlheinz Pischke)

I have interactively tested in a csh environment:
mybox.kpischke.266% rsh machineX -n "ls > /dev/null"
Permission denied.
mybox.kpischke.267% echo $status
mybox.kpischke.268% rsh machineOK -n "ls > /dev/null"
mybox.kpischke.269% echo $status

You see that the status returned by rsh gives you the decision you need.

In generel "rdist" depends as well as "rsh" on ~/.rhost or /etc/hosts.equiv
So you can use rsh" for the test !

You may take a more "genious" command instead of -n "ls > /dev/null"

Happy rdisting.

"You can not discover new oceans unless you have the courage to lose 
sight of the shore" - Anonymous

"There is nothing more constant than change" - Anonymous

Manish Doshi, .............. ___ _/| .. __ __ .. ___ _/| ........... Dept. of Computer Science \ x x ' / o O \ \ o O University of Houston ( ^ ) ( ^ ) ( ^ ) Houston, TX 77004 ............. U ........ U ........ ~ ...............

Email :- Work:(408)285-6561 Home:(415)967-3445 URL:

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:10 CDT