Script to check if server is up or down

[root@labserver]# cat  ping.sh

a=`ping -c 1 192.168.1.35|head -n 2|tail -n 1|awk {‘print $1}’`
if [ “$a” -eq “64” ] then
echo $a
echo “server is up”
else
echo “server is down”
fi
[root@labserver]#

Leave a Reply

Your email address will not be published. Required fields are marked *