import thread
from java.util import Date
from java.text import SimpleDateFormat
# Configured user credentials with storeUserConfig
def monitorThrds():
connect("weblogic", "pwd", "t3://IP:Port");
serverNames = getRunningServerNames()
domainRuntime()
for i in range(10000):
print '[' + SimpleDateFormat('d MMM yyyy HH:mm:ss').format(java.util.Date()) + ']'
for sname in serverNames:
try:
cd("domainRuntime:/ServerRuntimes/" + sname.getName() + "/MaxThreadsConstraintRuntimes/MaxThreadConstraint-oms")
automaxexecnt=get('ExecutingRequests')
automaxdefcnt = get('DeferredRequests')
cd("domainRuntime:/ServerRuntimes/" + sname.getName() + "/MaxThreadsConstraintRuntimes/MaxThreadsConstraint-oms.ws.jms")
jmsmaxexecnt=get('ExecutingRequests')
jmsmaxdefcnt = get('DeferredRequests')
cd("domainRuntime:/ServerRuntimes/" + sname.getName() + "/MinThreadsConstraintRuntimes/MinThreadsConstraint-oms.automation")
autominexecnt=get('ExecutingRequests')
autominpendcnt = get('PendingRequests')
cd("domainRuntime:/ServerRuntimes/" + sname.getName() + "/MinThreadsConstraintRuntimes/MinThreadsConstraint-oms.ws.jms")
jmsminexecnt=get('ExecutingRequests')
jmsminpendcnt = get('PendingRequests')
print '%8s %10s Min = ( E:%4d P:%4d ) Max = ( E:%4d D:%4d )' % ("(auto)", sname.getName(), autominexecnt, autominpendcnt, automaxexecnt, automaxdefcnt)
print '%8s %10s Min = ( E:%4d P:%4d ) Max = ( E:%4d D:%4d )' % ("(jms)", sname.getName(), jmsminexecnt, jmsminpendcnt, jmsmaxexecnt, jmsmaxdefcnt)
except WLSTException,e:
# this typically means the server is not active, just ignore
pass
print '======================================================================'
print ''
import time
time.sleep(3)
def getRunningServerNames():
domainConfig()
return cmo.getServers()
if __name__== "main":
monitorThrds()
disconnect()
댓글 없음:
댓글 쓰기