One of the best way is to do a rsh to the client.
Pinging -> Does not eliminate the possibility that the server id down at ok promp but network is alive.
If you have security concern regarding rsh, you can use ftp to do that.
You can check use .netrc to search google on how to automate ftp or look at my monitoring script below...
#!/bin/ksh
#
# Created: Steven Koh on Apr 1st 2004
# Last Amended: Steven Koh on Apr 1st 2004
# Last checked: Steven Koh on xxx
#
# Solaris Monitor Ftp Script
# Purpose: Monitors servers via use of the ftp command
# and notifies via email.
# Usage: Execute from crontab every 15 minutes.
# Dependencies: $HOME/.netrc
# Outputs: E-mail, SNMP
#***************************************************
CONF_FILE=/usr/local/scripts/monitor.conf
SCRIPTDIR=`grep "SCRIPTDIR" $CONF_FILE | awk -F= '{print $NF}'`
# The directory this script resides in
ADMINDIR=$SCRIPTDIR/monitorFTP
MAILADD=$LOGNAME@localhost
SMS_LIST=$HOME/sms.List
# Define the hostname of the server
SRVNM=`uname -n`
# Define the hostname of the SNMP server
SNMP_SRV=`grep "SNMP_SRV" $CONF_FILE | awk -F= '{print $NF}'`
SEND_TRAP=`grep "SEND_TRAP" $CONF_FILE | awk -F= '{print $NF}'`
SEND_SMS=`grep "SEND_SMS" $CONF_FILE | awk -F= '{print $NF}'`
touch ftp.test
grep machine $HOME/.netrc | awk '{print $2}' > $HOME/mon_ftp.dat
grep -v "#" $HOME/mon_ftp.dat |
while read -r SRVNM
do
echo "put ftp.test" | ftp $SRVNM
if test `echo "ls ftp.test" | ftp $SRVNM | grep -v "No such file or directory" | grep -c ftp.test` -ne
1; then
echo "Unable to FTP to $SRVNM"
\# Wait 1 min before checking again
sleep 60
if test \`echo "ls ftp.test" | ftp $SRVNM | grep -v "No such file or directory" | grep -c ftp.test\` \-
ne 1; then
echo "Unable to FTP to $SRVNM"
mail $MAILADD <<EOF
From: $0
To: $MAILADD
Subject: Unable to FTP to $SRVNM
Unable to FTP to $SRVNM
EOF
# Sending SMS
$SEND_SMS $SMS_LIST "FTP001_$SRVNM: Unable to FTP to $SRVNM. Check if network/ftp is down"
fi
fi
done
exit 0