怎么用db2cos监控db2diag中的特定错误信息并抓取相应的app信息

这篇文章主要介绍了怎么用db2cos监控db2diag中的特定错误信息并抓取相应的app信息,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

天元ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为成都创新互联公司的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:18982081108(备注:SSL证书合作)期待与您的合作!

Copy the db2cos script /sqllib/bin/ to /sqllib/adm/ and modify below section(uncomment one line of errstring as you need):
Modify below section:
   "DIAGSTRING")
      echo "Diag String Caught"                                      >> $logfile
      if [ ! -n "$database" ]
      then
         db2pd -inst                                                 >> $db2pd_outfile
      else
         diagfile=$diagpath\db2diag.log
         #get lastest MAX_LOG or NUM_LOG_SPAN or lock_escalation info from diag
         echo "-------info from diag" >> $logfile
         #MAX_LOG
         #errstring='ADM1542W'
         #NUM_LOG_SPAN
         #errstring='ADM1541W'
         #lock_escalation
         errstring='ADM5502W'
         grep -ip $errstring $diagfile|tail -11 >> $logfile
         #get application handle
         appnum=`echo $apphdl|awk -F '-' '{print $2}'`
         #get snapshot for this application
         echo "The application info which causing the error - APPID:$appnum" >> $logfile
         db2 get snapshot for application agentid $appnum >> $logfile
      fi
   ;;

Run command as below:
Run command to start catch info:
MAX_LOG:
db2pdcfg -catch diagstr='ADM1542W' count=1
NUM_LOG_SPAN:
db2pdcfg -catch diagstr='ADM1541W' count=1
lock escalation:
db2pdcfg -catch diagstr='ADM5502W' count=1

clear catch after things happened:
db2pdcfg -catch clear

check diagpath for file like *.cos.txt

感谢你能够认真阅读完这篇文章,希望小编分享的“怎么用db2cos监控db2diag中的特定错误信息并抓取相应的app信息”这篇文章对大家有帮助,同时也希望大家多多支持创新互联,关注创新互联行业资讯频道,更多相关知识等着你来学习!


名称栏目:怎么用db2cos监控db2diag中的特定错误信息并抓取相应的app信息
网站网址:http://scyanting.com/article/jhoeis.html