#!/bin/ksh
clear
echo "Do you want to flush the log data before running ping test (y/n): "
read choice
case $choice in
y)
cat /dev/null > /tmp/pnaidu/err.txt
cat /dev/null > /tmp/pnaidu/ok
cat /dev/null > /tmp/pnaidu/NOTOK
for A in `awk '{print $1}' /script/testpnhost.txt`
do
ping ${A} -n 1 >>/tmp/pnaidu/out.txt 2>>/tmp/pnaidu/err.txt
if [ $? = 0 ]; then
{
echo "${A} is able to connect" >> /tmp/pnaidu/ok
}
else
{
echo "${A} NOT able to connect" >> /tmp/pnaidu/NOTOK
}
fi
done
echo "Hosts which couldn't ping throw them all from the 7th Floor"
echo "Check the log files under /tmp/pnaidu \n "
;;
n)
echo "Hasta la vista"
exit 0
;;
*)
echo "Invalid Choice "
echo "Exiting....... Wake up and get a cup of coffee"
exit 1
esac
Thursday, February 26, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment