#!/bin/sh
# probe for nall (see http://brouits.free.fr/nall)
# tell the global number of alive machines
# need: fping
#
HOSTNAMES="www.example.com www.example.org www.example.net ftp.example.net"

NUM_TOTAL=`echo $HOSTNAMES|wc -w`
NUM_ALIVE=`fping -a $HOSTNAMES 2>/dev/null | wc -l`

if [ $NUM_ALIVE -le 1 ]
then
 ALIVE_MACHINES="alive machine"
else
 ALIVE_MACHINES="alive machines"
fi
echo "$NUM_ALIVE/$NUM_TOTAL $ALIVE_MACHINES"
