hello all,
Can someone please assist me with the following: I have a script that pings all of my AIX boxes to make sure that they are up.Lately, I've been getting bogus pages telling me that this system cannot be pinged and that system cannot be pinged. The boxes are always up and running. Here is my script: Can someone please tell me how to modify it so that I don't get missed ping pages at 2 & 3 o'clock in the morning??? Your help would be greatly appreciaed. Thanks in advance.
#!/bin/ksh
dat=`date +%m%d%y`
for HOST in `cat /xping_hostlist`
do
ping -c2 $HOST > /dev/null 2>&1
if [ $? != 0 ]
then
date >>/tmp/ping_unsuccessful.$dat
echo "cannot ping $HOST" >> /tmp/ping_unsuccessful.$dat
echo "-----------------" >> /tmp/ping_unsuccessful.$dat
echo "cannot ping $HOST" | mail -s PING ALERT 4556720@archwireless.net
echo "cannot ping $HOST" | mail -s PING ALERT 4550720@archwireless.net
else
date >>/tmp/ping_successful.$dat
echo "$HOST pinged sucessfully" >> /tmp/ping_successful.$dat
echo "------------------------" >> /tmp/ping_successful.$dat
fi
done
Can someone please assist me with the following: I have a script that pings all of my AIX boxes to make sure that they are up.Lately, I've been getting bogus pages telling me that this system cannot be pinged and that system cannot be pinged. The boxes are always up and running. Here is my script: Can someone please tell me how to modify it so that I don't get missed ping pages at 2 & 3 o'clock in the morning??? Your help would be greatly appreciaed. Thanks in advance.
#!/bin/ksh
dat=`date +%m%d%y`
for HOST in `cat /xping_hostlist`
do
ping -c2 $HOST > /dev/null 2>&1
if [ $? != 0 ]
then
date >>/tmp/ping_unsuccessful.$dat
echo "cannot ping $HOST" >> /tmp/ping_unsuccessful.$dat
echo "-----------------" >> /tmp/ping_unsuccessful.$dat
echo "cannot ping $HOST" | mail -s PING ALERT 4556720@archwireless.net
echo "cannot ping $HOST" | mail -s PING ALERT 4550720@archwireless.net
else
date >>/tmp/ping_successful.$dat
echo "$HOST pinged sucessfully" >> /tmp/ping_successful.$dat
echo "------------------------" >> /tmp/ping_successful.$dat
fi
done