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()
serverRuntime()
for i in range(10000):
print '[' + SimpleDateFormat('d MMM yyyy HH:mm:ss').format(java.util.Date()) + ']'
print '======================================================================'
for sname in serverNames:
try:
cd("domainRuntime:/ServerRuntimes/" + sname.getName() + "/SAFRuntime/" +sname.getName() + ".saf/Agents")
try:
agents=cmo.getAgents()
for agName in agents:
#print agName.getName()
cd(agName.getName())
msgpend=cmo.getMessagesPendingCount()
msgcur=cmo.getMessagesCurrentCount()
msgtot=cmo.getMessagesReceivedCount()
#print '%s messages received %s = %d %d %d' % (agName.getName(), sname.getName(), msgcur, msgpend, msgtot)
#print '%-30s %s CUR:%5d PEND:%5d RECV:%5d' % (agName.getName(), sname.getName(), msgcur,msgpend,msgtot )
print '%-30s CUR:%5d PEND:%5d RECV:%8d' % (agName.getName(), msgcur,msgpend,msgtot )
cd("..")
except WLSTException,e:
pass
except WLSTException,e:
# this typically means the server is not active, just ignore
pass
print '======================================================================'
print ''
import time
time.sleep(10)
def getRunningServerNames():
domainConfig()
return cmo.getServers()
if __name__== "main":
monitorThrds()
disconnect()
댓글 없음:
댓글 쓰기