洞察探索open banking如何通过小程序容器技术助力金融企业实现数据安全和数字化转型
606
2022-10-07
WebSphere MQ Check脚本
#!/bin/shcreateCheckDir(){ if [ ! -d /yunwei/Release/$(date +%y%m%d%H%M) ];then mkdir -p /yunwei/Release/$(date +%y%m%d%H%M) chmod 767 /yunwei/Release/$(date +%y%m%d%H%M) current_date="/yunwei/Release/$(date +%y%m%d%H%M)" fi}getmqMaxChannel(){ cat /var/mqm/mqs.ini | grep -v DefaultPrefix | grep -E "Name" | awk -F '=' '{print}' | grep -v "^$" | grep -v "Installation1" > /tmp/qmgrs.txt cat /var/mqm/mqs.ini | grep -v DefaultPrefix | grep -E "Prefix" | awk -F '=' '{print}' | grep -v "^$" | grep -v "Installation1" > /tmp/qmgrspath.txt for qmgrpath in `awk '{ printf
#!/bin/shcreateCheckDir(){ if [ ! -d /yunwei/Release/$(date +%y%m%d%H%M) ];then mkdir -p /yunwei/Release/$(date +%y%m%d%H%M) chmod 767 /yunwei/Release/$(date +%y%m%d%H%M) current_date="/yunwei/Release/$(date +%y%m%d%H%M)" fi}getmqMaxChannel(){ cat /var/mqm/mqs.ini | grep -v DefaultPrefix | grep -E "Name" | awk -F '=' '{print$2}' | grep -v "^$" | grep -v "Installation1" > /tmp/qmgrs.txt cat /var/mqm/mqs.ini | grep -v DefaultPrefix | grep -E "Prefix" | awk -F '=' '{print$2}' | grep -v "^$" | grep -v "Installation1" > /tmp/qmgrspath.txt for qmgrpath in `awk '{ printf $0; getline<"/tmp/qmgrs.txt"; print "/qmgrs/" $0 }' /tmp/qmgrspath.txt`;do MaxChannels=`cat $qmgrpath/qm.ini | grep MaxChannels` if [ "$MaxChannels" = "" ];then echo "MaxChannels is 0, MaxChannels must set 1000" else MaxChannels=`cat $qmgrpath/qm.ini | grep MaxChannels | awk -F '=' '{print $2}'` echo "MaxChannels is $MaxChannels" fi MaxActiveChannels=`cat $qmgrpath/qm.ini | grep MaxActiveChannels` if [ "$MaxActiveChannels" = "" ];then echo "MaxActiveChannels is 0, MaxActiveChannels must set 1000" else MaxActiveChannels=`cat $qmgrpath/qm.ini | grep MaxActiveChannels | awk -F '=' '{print $2}'` echo "MaxActiveChannels is $MaxActiveChannels" fi keepAlive=`cat $qmgrpath/qm.ini | grep keepAlive` if [ "$keepAlive" = "" ];then echo "keepAlive is NO, keepAlive must set YES" else keepAlive=`cat $qmgrpath/qm.ini | grep keepAlive | awk -F '=' '{print $2}'` echo "keepAlive is $keepAlive" fi done}getChannelDiscint(){Channelname=`su - mqm -c "echo 'dis chl(*)' | runmqsc $qmgr" | grep -Ev "One|No commands have a syntax erro|All valid MQSC commands were processed|"AMQ8414I"|"SYSTEM"" | sed '1,3d' | awk '{print $1}' | awk -F '(' '{print $2}' | awk -F ')' '{print $1}' | grep -v '^$'` if [ "$Channelname" = "" ];then echo "$qmgr have no Channel" else DISCINTNUM=`su - mqm -c "echo 'dis chl($Channelname) DISCINT' | runmqsc $qmgr" | grep "DISCINT" | sed '1d' | awk -F '(' '{print $2}' | awk -F ')' '{print $1}'` echo "$qmgr $Channelname DISCINT is $DISCINTNUM" fi}getMAXDEPTH(){ QueueName=`su - mqm -c "echo 'dis ql(*)' | runmqsc $qmgr" | grep -v "AMQ8409I" | grep -v "QUEUE(SYSTEM" | grep "QUEUE" | awk '{print $1}' | awk -F '(' '{print $2}' | awk -F ')' '{print $1}'` if [ "$QueueName" = '' ];then echo "$qmgr have no Queue" else MaxDepth=`su - mqm -c "echo 'dis ql($QueueName) MAXDEPTH' | runmqsc $qmgr" | grep -v '^$' | sed '1,4d' | grep -v "One MQSC command read" | grep -v "No commands have a syntax error" | grep -v "All valid MQSC" | grep MAXDEPTH | awk -F '(' '{print $2}' | awk -F ')' '{print $1}'` echo "$qmgr $QueueName is $MaxDepth" fi}main(){ createCheckDir getmqMaxChannelfor qmgr in `su - mqm -c "dspmq | awk '{print $1}'" | awk -F '(' '{print $2}' | awk -F ')' '{print $1}' | uniq`;do getChannelDiscint getMAXDEPTHdone}main
; getline<"/tmp/qmgrs.txt"; print "/qmgrs/"#!/bin/shcreateCheckDir(){ if [ ! -d /yunwei/Release/$(date +%y%m%d%H%M) ];then mkdir -p /yunwei/Release/$(date +%y%m%d%H%M) chmod 767 /yunwei/Release/$(date +%y%m%d%H%M) current_date="/yunwei/Release/$(date +%y%m%d%H%M)" fi}getmqMaxChannel(){ cat /var/mqm/mqs.ini | grep -v DefaultPrefix | grep -E "Name" | awk -F '=' '{print$2}' | grep -v "^$" | grep -v "Installation1" > /tmp/qmgrs.txt cat /var/mqm/mqs.ini | grep -v DefaultPrefix | grep -E "Prefix" | awk -F '=' '{print$2}' | grep -v "^$" | grep -v "Installation1" > /tmp/qmgrspath.txt for qmgrpath in `awk '{ printf $0; getline<"/tmp/qmgrs.txt"; print "/qmgrs/" $0 }' /tmp/qmgrspath.txt`;do MaxChannels=`cat $qmgrpath/qm.ini | grep MaxChannels` if [ "$MaxChannels" = "" ];then echo "MaxChannels is 0, MaxChannels must set 1000" else MaxChannels=`cat $qmgrpath/qm.ini | grep MaxChannels | awk -F '=' '{print $2}'` echo "MaxChannels is $MaxChannels" fi MaxActiveChannels=`cat $qmgrpath/qm.ini | grep MaxActiveChannels` if [ "$MaxActiveChannels" = "" ];then echo "MaxActiveChannels is 0, MaxActiveChannels must set 1000" else MaxActiveChannels=`cat $qmgrpath/qm.ini | grep MaxActiveChannels | awk -F '=' '{print $2}'` echo "MaxActiveChannels is $MaxActiveChannels" fi keepAlive=`cat $qmgrpath/qm.ini | grep keepAlive` if [ "$keepAlive" = "" ];then echo "keepAlive is NO, keepAlive must set YES" else keepAlive=`cat $qmgrpath/qm.ini | grep keepAlive | awk -F '=' '{print $2}'` echo "keepAlive is $keepAlive" fi done}getChannelDiscint(){Channelname=`su - mqm -c "echo 'dis chl(*)' | runmqsc $qmgr" | grep -Ev "One|No commands have a syntax erro|All valid MQSC commands were processed|"AMQ8414I"|"SYSTEM"" | sed '1,3d' | awk '{print $1}' | awk -F '(' '{print $2}' | awk -F ')' '{print $1}' | grep -v '^$'` if [ "$Channelname" = "" ];then echo "$qmgr have no Channel" else DISCINTNUM=`su - mqm -c "echo 'dis chl($Channelname) DISCINT' | runmqsc $qmgr" | grep "DISCINT" | sed '1d' | awk -F '(' '{print $2}' | awk -F ')' '{print $1}'` echo "$qmgr $Channelname DISCINT is $DISCINTNUM" fi}getMAXDEPTH(){ QueueName=`su - mqm -c "echo 'dis ql(*)' | runmqsc $qmgr" | grep -v "AMQ8409I" | grep -v "QUEUE(SYSTEM" | grep "QUEUE" | awk '{print $1}' | awk -F '(' '{print $2}' | awk -F ')' '{print $1}'` if [ "$QueueName" = '' ];then echo "$qmgr have no Queue" else MaxDepth=`su - mqm -c "echo 'dis ql($QueueName) MAXDEPTH' | runmqsc $qmgr" | grep -v '^$' | sed '1,4d' | grep -v "One MQSC command read" | grep -v "No commands have a syntax error" | grep -v "All valid MQSC" | grep MAXDEPTH | awk -F '(' '{print $2}' | awk -F ')' '{print $1}'` echo "$qmgr $QueueName is $MaxDepth" fi}main(){ createCheckDir getmqMaxChannelfor qmgr in `su - mqm -c "dspmq | awk '{print $1}'" | awk -F '(' '{print $2}' | awk -F ')' '{print $1}' | uniq`;do getChannelDiscint getMAXDEPTHdone}main
}' /tmp/qmgrspath.txt`;do MaxChannels=`cat $qmgrpath/qm.ini | grep MaxChannels` if [ "$MaxChannels" = "" ];then echo "MaxChannels is 0, MaxChannels must set 1000" else MaxChannels=`cat $qmgrpath/qm.ini | grep MaxChannels | awk -F '=' '{print }'` echo "MaxChannels is $MaxChannels" fi MaxActiveChannels=`cat $qmgrpath/qm.ini | grep MaxActiveChannels` if [ "$MaxActiveChannels" = "" ];then echo "MaxActiveChannels is 0, MaxActiveChannels must set 1000" else MaxActiveChannels=`cat $qmgrpath/qm.ini | grep MaxActiveChannels | awk -F '=' '{print }'` echo "MaxActiveChannels is $MaxActiveChannels" fi keepAlive=`cat $qmgrpath/qm.ini | grep keepAlive` if [ "$keepAlive" = "" ];then echo "keepAlive is NO, keepAlive must set YES" else keepAlive=`cat $qmgrpath/qm.ini | grep keepAlive | awk -F '=' '{print }'` echo "keepAlive is $keepAlive" fi done}getChannelDiscint(){Channelname=`su - mqm -c "echo 'dis chl(*)' | runmqsc $qmgr" | grep -Ev "One|No commands have a syntax erro|All valid MQSC commands were processed|"AMQ8414I"|"SYSTEM"" | sed '1,3d' | awk '{print }' | awk -F '(' '{print }' | awk -F ')' '{print }' | grep -v '^$'` if [ "$Channelname" = "" ];then echo "$qmgr have no Channel" else DISCINTNUM=`su - mqm -c "echo 'dis chl($Channelname) DISCINT' | runmqsc $qmgr" | grep "DISCINT" | sed '1d' | awk -F '(' '{print }' | awk -F ')' '{print }'` echo "$qmgr $Channelname DISCINT is $DISCINTNUM" fi}getMAXDEPTH(){ QueueName=`su - mqm -c "echo 'dis ql(*)' | runmqsc $qmgr" | grep -v "AMQ8409I" | grep -v "QUEUE(SYSTEM" | grep "QUEUE" | awk '{print }' | awk -F '(' '{print }' | awk -F ')' '{print }'` if [ "$QueueName" = '' ];then echo "$qmgr have no Queue" else MaxDepth=`su - mqm -c "echo 'dis ql($QueueName) MAXDEPTH' | runmqsc $qmgr" | grep -v '^$' | sed '1,4d' | grep -v "One MQSC command read" | grep -v "No commands have a syntax error" | grep -v "All valid MQSC" | grep MAXDEPTH | awk -F '(' '{print }' | awk -F ')' '{print }'` echo "$qmgr $QueueName is $MaxDepth" fi}main(){ createCheckDir getmqMaxChannelfor qmgr in `su - mqm -c "dspmq | awk '{print }'" | awk -F '(' '{print }' | awk -F ')' '{print }' | uniq`;do getChannelDiscint getMAXDEPTHdone}mainMQ
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~