Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ping script

Status
Not open for further replies.

icu812

MIS
Sep 10, 2001
52
US
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
 
Look at the program "pingscan" at
It's a cool little program, you feed it the hosts from a file and away you go. It requires perl and a couple of modules. d3funct
zimmer.jon@cfwy.com
The software required `Windows 95 or better', so I installed Linux.
 
I could not get pingscan working properly on my AIX box. Thanks for the suggestion though.
 
I had the same problem with printers. I used a ping -c5 and it works. I thing that 2 may be to short if the network is real buzy not sure just know it works. Learn something everyday or you wasted a day of your life.
 
Thank you, I've changed my script. We'll see how that works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top