SUMMARY: quick rup?

From: Sumner Hushing (hushing@gdwest.gd.com)
Date: Tue Oct 12 1993 - 05:59:27 CDT


Thanks, all you rup/ping experts! My final product's attached at the
end.

I got a bunch of good suggestions, and ended up using ruptime, which
requires the rwhod daemon running on all machines from which I desire a
response. I didn't have my machines configured with the rwhod daemon
running, but I do now, and it works pretty well for me. I get typical
response times of less than one second for a complete list of 20 or so
"up" machines. Plenty fast enough for me.

Of course, since I'm in control of all the machines I want to see, it
was a lot easier. And just so we're clear on this, one should be aware
that rwhod is spending some time regularly gathering this information
into a local table, so that ruptime just lists the table, rather than
going across the net to ask who's up.

So far, that's all fine with me. The CPU time used by rwhod is a very
small fraction of that used by all the processes running in support of
my application.

Suggestions also included:
* Run rup in bg, capture the process ID and kill it a few seconds later
* Use rwho
* Use yuptime
* Use ping with a short timeout to ping a known host list
* Write my own RPC program (some offered theirs)
* Use ping with a broadcast address, then filter out duplicates
* Read the NIS hosts table
* Write a program, use popen with a netmask
* Use fping
* Use the perl script in R.Kolstadt's tutorial
* Use "intr -t 3 rup" (clever! But I can't pipe the output)
* Use getethers

Many thanks for the sample programs and scripts. Really!

Thanks to:

C.Gibson@computer-centre.hull.ac.uk
adaptec!met@uunet.UU.NET
bert@penril.com
celita@taux01.nsc.com
dchunt@ziggy.sanders.lockheed.com
drew@mtu.edu
ekurgpol@Law.USC.EDU
etnibsd!vsh@uunet.UU.NET
fetrow@biostat.washington.edu
fuat@watsun.cc.columbia.edu
glenn@uniq.com.au
grossjoh@ls6.informatik.uni-dortmund.de
jayl@lattice.com
kes@mtb.phil.mop.com
kevin@uniq.com.au
kmah@DCS-Systems.COM
mann@esther.la.asu.edu
miker@il.us.swissbank.com
nate@lattice.com
pjc@denver.ssds.COM
pjw@ccci.com
rjcronin@uop.com
rodo@auspex.com
sid@ingres.com
steffen@gfz-potsdam.de
symanski@gold.nosc.mil
vasey@issi.com
warren@atmos.washington.edu

Whew! That's a lot of cutting and pasting! Thanks to all!

For those that are interested, here's my final script -- I replaced the
template with xxxx to protect the innocent:

***** BEGIN INCLUDE *****

#!/bin/sh
######################################################################
# FILE: util_dosun
#
# PURPOSE: Run a command on all xxxx project Sun workstations
#
# USAGE: util_dosun [ -me ] "<command>"
#
# PARAMETERS:
# -me = don't run the command on this machine (not me, get it?)
#
# NOTES:
# Uses ruptime, so in.rwhod must be running on all machines.
# Filters out all hosts that don't match "xxxx##" template.
# e.g. xxxx1, xxxx7, xxxx22.
#
# MODIFICATION HISTORY
# 92/01/03, SK Hushing III. Original issue.
# 92/12/03, SKH. For Bourne shell.
# 93/10/06, SKH. Only try to run on "up" hosts.
######################################################################

#-----[ Get optional parameters if any ]-----#
me=""
for i do
    if [ "$1" = "-me" ]; then
        me=`uname -n`
        shift
    else
        break
    fi
done

#-----[ Get the list of matching hosts ]-----#
suns=`ruptime | awk '/xxxx[0-9][0-9]* /{print $1}' | tr "\012" " "`

#-----[ Omit this host's name if desired ]-----#
if [ ! "$me" = "" ]; then
    suns=`echo $suns | sed s/$me//`
fi

#-----[ Run the command on all hosts found ]-----#
echo " "
echo "Command: $@"
echo "Hosts: $suns"
for i in $suns
do
    echo "____________________________________________________________ $i"
    rsh $i "$@"
done
echo " "

***** END INCLUDE *****



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:24 CDT