如何快速定位CICS進程使用的端口(不使用lsof命令情況下)
如果在您的環境中沒有安裝lsof,仍需要快速定位CICS進程使用的端口,那麼,可以結合使用“netstat -Aan”和“rmsock”命令達到同樣效果,詳細信息參照如下腳本:
#!/usr/bin/ksh
netstat -Aan | grep LISTEN | awk ‘{print $1 ” ” $5}’ | while read pcbs port; do
out=`rmsock $pcbs tcpcb | grep cics `
if [ -n “$out” ]; then
echo “The socket” $port “is being held by CICS proccess”
echo “$out” | awk ‘{print $9 ” ” $10}’
fi
done
腳本運行結果如下:
bash-4.2# ./getports.sh
The socket *.10017 is being held by CICS proccess 25296944 (cicsas).
The socket *.10017 is being held by CICS proccess 25755712 (cicsas).
The socket *.10079 is being held by CICS proccess 9699372 (cicspc).
The socket *.10084 is being held by CICS proccess 15532154 (cicsip).
The socket *.10211 is being held by CICS proccess 10813568 (cicsas).
The socket *.10930 is being held by CICS proccess 28573846 (cicstermu).
The socket *.11090 is being held by CICS proccess 25428138 (cicsrl).
The socket *.11144 is being held by CICS proccess 17104922 (cicstermu).
The socket *.11336 is being held by CICS proccess 26083520 (cicsas).
The socket *.11337 is being held by CICS proccess 14352516 (cicsas).
The socket *.11963 is being held by CICS proccess 7143486 (cics).
以下文章點擊率最高
Loading…