Weblogic takes Thread Dumps With WLST
概述:
weblogic获取threadDump,每隔15s一次,做3次,threadDump名为:节点名称+时间。
connect('weblogic','weblogic123','localhost:7001')
from java.lang import *
from java.util import Date
serverName = 'AdminServer'
counter = 0
sleepTime = 15000
threadNumber = 3
d= Date()
for counter in range(threadNumber):
currentFile = 'Thread_Dump_%s_%s_%s.log' % (serverName, d.time,counter)
threadDump(writeToFile='true', fileName=currentFile,serverName=serverName)
currentFileRead = open(currentFile, 'r')
currentFileRead.close()
Thread.sleep(sleepTime)
disconnect()
分享给大家