3
# determine the list of all hosts that respond to a ping
5
# (c) Thomas Lange, Institut fuer Informatik, Uni Koeln, 1998,2001
7
# define a netgroup called allhosts which is the list of all hostnames
13
# example for a Beowulf cluster
17
# create the list of all hosts
19
while [ $i -le $endnum ]; do
20
num=`printf "%.2d" $i`
21
nodes="$nodes $nodeprefix$num"
24
allhosts="$server $nodes"
29
Usage: all_hosts [parameter]
31
all_hosts without any option show all answering hosts.
33
-h print this message.
34
-n show all non answering hosts.
35
-p print only the list of all hosts
41
# - - - - - - - - - - - - - - - - - - - -
42
# if using NIS this is very nice
43
# prtnetgr prints all hosts belonging to a netgroup
44
allhosts=`prtnetgr allhosts`
47
while getopts anhp opt
50
n) fping $fpingopt -u $allhosts 2>/dev/null ;;
57
[ -n "$1" ] || fping $fpingopt -a $allhosts 2>/dev/null