1. On each server run cron every 5 minutes for a complete day (or even better a few days)
file=/tmp/netstat.`hostname`.`date +%d.%m.%y`
for ((i=1;i<=288;i++));
do
netstat -an | egrep "ESTABLISHED|WAIT|LISTEN " | grep -v 127.0.0.1 | sed -e '1,$s/::ffff://g' | awk ' { print $4 "," $5 "," $6 } ' | tr ':' ',' >> $file.allday
sleep 300
cat $file.allday | sort | uniq > $file; rm $file
done
2. Import CSV files into Excel
No comments:
Post a Comment