#####################################################################
# 功能: 查看Tuxedo服务和队列情况
# 编写: linush
# 版权: CopyRight (C) 2004.03 By linush .
# 版本: ver1.0
#####################################################################
. $HOME/.profile
/tuxedo/app/tuxcmd.sh psr 1> /tuxedo/app/tuxcmd.log 2>/dev/null
/tuxedo/app/tuxcmd.sh pq 1>> /tuxedo/app/tuxcmd.log 2>/dev/null
echo ""
echo "***************************************************************"
echo "*** CopyRight (C) 2004.07 by linush ,Bea Fans . ***"
echo "*** Written by zlwen 2004.07.06 ...... ***"
echo "*** Email: zlwen2003@vip.sina.com, zlwen@laurels.com ***"
echo "***************************************************************"
echo
echo "下面列举的是tuxedo比较繁忙的服务和队列积压情况................."
awk '{ if ($4=="-"&&$6=="-") {
if ($5>0) {print $0}
}
else
{
if ($8!="IDLE") {print $0}
}
}' /tuxedo/app/tuxcmd.log
echo "正在检测系统信息,请稍候......................................."
echo
rm /tuxedo/app/tuxcmd.log
top -s2 -d1 -f /tuxedo/app/tuxcmd.log
awk '{if (NR<15) {print $0} else {if ($9!="sleep") {print $0}}}' /tuxedo/app/tuxcmd.log
其中用到了另外一个shell: /tuxedo/app/tuxcmd.sh
内容如下:
. $HOME/.profile
if (test $# != 1)
then
echo "参数个数不对:tuxcmd.sh cmd,如 tuxcmd.sh psr"
exit
fi
tmadmin << TXADMIN
$1
q
TXADMIN
该脚本运行结果:
***************************************************************
*** CopyRight (C) 2004.07 by linush ,Bea Fans . ***
*** Written by zlwen 2004.07.06 ...... ***
*** Email: zlwen2003@vip.sina.com, zlwen@laurels.com ***
***************************************************************
下面列举的是tuxedo比较繁忙的服务和队列积压情况.................
> Prog Name Queue Name Grp Name ID RqDone Load Done Current Service
--------- ---------- -------- -- ------ --------- ---------------
RecServer 00002.01011 G_YZ 1011 1542 77100 RecServer
RecServer 00002.01013 G_YZ 1013 161 8050 RecServer
ChargeServer 00002.01090 G_YZ 1090 3534 176700 ChargeServer
server 00002.00300 G_YZ 300 14874 743700 SERVER_PROCESS
server 00002.00301 G_YZ 301 9053 452650 SERVER_PROCESS
server 00002.00302 G_YZ 302 3770 188500 SERVER_PROCESS
>
> Prog Name Queue Name # Serve Wk Queued # Queued Ave. Len Machine
--------- ------------------- --------- -------- -------- -------
>
正在检测系统信息,请稍候.......................................
System: yyyyss Mon Jul 5 18:49:56 2004
Load averages: 0.40, 0.38, 0.75
181 processes: 176 sleeping, 5 running
Cpu states:
CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
0 0.31 79.1% 0.0% 7.0% 13.9% 0.0% 0.0% 0.0% 0.0%
1 0.48 76.5% 0.0% 8.0% 15.5% 0.0% 0.0% 0.0% 0.0%
--- ---- ----- ----- ----- ----- ----- ----- ----- -----
avg 0.40 78.0% 0.0% 7.5% 14.5% 0.0% 0.0% 0.0% 0.0%
Memory: 395512K (218488K) real, 405040K (222624K) virtual, 986976K free Page# 1/1
CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
0 ? 25060 tuxedo 154 20 26788K 18988K sleep 16:15 32.64 32.58 server
1 ? 25057 tuxedo 190 20 24740K 18652K run 4:02 12.47 12.45 server
1 ? 25058 tuxedo 196 20 24740K 18668K run 8:31 9.89 9.87 server
1 ? 25119 tuxedo 181 20 8204K 3836K run 6:06 5.74 5.73 ChargeServer
1 ? 33 root 152 20 0K 0K run 130:23 1.22 1.21 vxfsd
0 pts/tb 27922 tuxedo 178 20 1688K 0K run 0:00 0.49 0.05 top