ping_check.sh
#!/bin/bash
while [ 1 ] ; do
NOW=`date +'%Y-%m%d-%H%M-%S'`
FILENAME=üũÇÒ´ë»óÀ» Àû¾îµÐ ÆÄÀÏ
END_NUM=`awk '{print $3}' $FILENAME |wc -l`
NUM=0
while [ $NUM -lt $END_NUM ] ;do
let NUM=$NUM+1
IP=`awk '{print $1}' $FILENAME |sed -n "$NUM"p`
COMPANY=`awk '{print $2}' $FILENAME |sed -n "$NUM"p`
ping -c 1 -w 1 $IP &> /dev/null
if [ "$?" == "0" ]; then
echo "$IP [$COMPANY] SERVER ON !!!"
else
echo "$IP [$COMPANY] SERVER OFF !!!"
fi
done;
echo "######################################################################"
echo "# $NOW #"
echo "######################################################################"
sleep 2
done;
# üũÇÒ´ë»óÀ» Àû¾îµÐ ÆÄÀÏ
(¾ÆÀÌÇÇ¿Í ´ë»ó¼¹öÈ£½ºÆ®³×ÀÓ ÀÌ·±½ÄÀ¸·Î Àû¾îµÎ¸é µÈ´Ù...)
192.168.89.110 1
192.168.10.98 2
192.168.18.226 3
192.168.19.226 4
192.168.239.226 5