如何快速定位CICS进程使用的端口(不使用lsof命令情况下)

如何快速定位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…


发表评论

邮箱地址不会被公开。 必填项已用*标注