GETTING PORT ADDRESS USED BY SERVICES
+++++++++++++++++++++++++++++++++++++

THIS SCRIPT CALCULATES AND SHOWS WHICH PORT IS USED BY WHICH SERVICE ,VERY IMPORTANT SCRIPT FOR ALL AIX ADMINISTRATORS IN THE EVENT OF PORT CONFLICT

for x in $(netstat -Aan|grep LISTEN|awk '{print $1}')
do
a=$(netstat -Aan|grep LISTEN|grep $x|awk '{print $5}'|cut -f2 -d .)
b=$(rmsock $x tcpcb|awk '{print $9}')
echo PORT $a is used by
ps -ef |grep $b
done
Advertisements