¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 56°Ç
   
ping check ½ºÅ©¸³Æ®
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2010-03-25 (¸ñ) 19:47 Á¶È¸ : 9598
±ÛÁÖ¼Ò :
                          

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


À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.