반응형


#!/bin/sh

if [ $# = 0 ]
then
echo "Usage: # ./see_port [port_number]" 
exit 1
fi

while(true)
do
   date
        echo $1 ESTABLISH `netstat -na | grep [서버IP]:$1 | grep EST | wc -l`
        echo $1 CLOSE_WAIT `netstat -na | grep [서버IP]:$1  | grep CLO | wc -l`
        echo $1 TIME_WAIT `netstat -na | grep [서버IP]:$1  | grep TIM | wc -l`
        echo $1 SYN_RECV `netstat -na | grep [서버IP]:$1  | grep SYN | wc -l`
   sleep 1
done





반응형

+ Recent posts