- 내부접속, 외부접속 구분하여 카운트
--------------------------------------------------------------
#!/bin/sh
while true; 
do 
date=`date '+%Y-%m-%d %H:%M:%S'` 
totCnt80I=`netstat -na | grep 192.168.12.133.80 | wc -l`
totCnt80O=`netstat -na | grep 192.41.260.167.80 | wc -l`
totCnt=`expr $totCnt80I + $totCnt80O`

estCnt80I=`netstat -na | grep 192.168.12.133.80 | grep EST | wc -l`
estCnt80O=`netstat -na | grep 192.41.260.167.80 | grep EST | wc -l`
estCnt=`expr $estCnt80I + $estCnt80O`

totCntDB=`netstat -na | grep 192.168.12.118.1521 | wc -l`
estCntDB=`netstat -na | grep 192.168.12.118.1521 | grep EST | wc -l`

echo "${date} => TOTAL : ${estCnt} / ${totCnt},     IN : ${estCnt80I} / ${totCnt80I},       OUT : ${estCnt80O} / ${totCnt80O},      DB : ${estCntDB} / ${totCntDB}"
sleep 1; 
done