SUMMARY:How to find out if machine is up remotely

From: Manish Doshi (mdoshi@guanine.bchs.uh.edu)
Date: Thu Sep 26 1996 - 13:00:03 CDT


Hi,

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 <TrevorPaquette@aec.ca>
From: "Trevor Paquette" <TrevorPaquette@aec.ca>

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
close
EOF
grep "Connection timed out" t.out >& /dev/null
if ( $status = 0 ) then
  /bin/rm t.out
  machine is up
else
  /bin/rm t.out
  machine is down
endif

From: Stephen Potter <spp@psa.pencom.com>

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

-spp

From: uvaghela@mpc-uk.com (Umesh Vaghela)

Manish,

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 <hwe@uebemc.siemens.de>

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 ?

Regards,

Herbert

From: mattb@deakin.edu.au

        Use a series of the r* commands.

        ie: rcp (remote cp)

                ruptime (uptime executed on another machine)

             rusers (list of users on remote machine.)

        etc...

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

You could do

if rup remote_host
then
        rdist -c something remote_host
fi

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

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.

Anchi

From: Bob Fulwiler <bobf@psa.pencom.com>

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 <shollatz@d.umn.edu>

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: bern@penthesilea.uni-trier.de (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: kpischke@cadence.com (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
1
mybox.kpischke.268% rsh machineOK -n "ls > /dev/null"
mybox.kpischke.269% echo $status
0
mybox.kpischke.270%

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 :- mdoshi@uh.edu Work:(408)285-6561 Home:(415)967-3445 URL: http://www.bchs.uh.edu/~mdoshi



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