import thread
from java.util import Date
from java.text import SimpleDateFormat
# Configured user credentials with storeUserConfig
def monitorJMS():
connect("weblogic", "pwd", "t3://IP:Port");
servers = domainRuntimeService.getServerRuntimes();
for i in range(10000):
print '[' + SimpleDateFormat('d MMM yyyy HH:mm:ss').format(java.util.Date()) + ']'
if (len(servers) > 0):
for server in servers:
print ' Server Name ' , server
jmsRuntime = server.getJMSRuntime();
jmsServers = jmsRuntime.getJMSServers();
for jmsServer in jmsServers:
destinations = jmsServer.getDestinations();
for destination in destinations:
print destination.getName()
print ' MessagesCurrentCount ' , destination.getMessagesCurrentCount()
print ' MessagesHighCount ' , destination.getMessagesHighCount()
print ' MessagesMovedCurrentCount ' , destination.getMessagesMovedCurrentCount()
print ' MessagesPendingCount ' , destination.getMessagesPendingCount()
print ' MessagesReceivedCount ' , destination.getMessagesReceivedCount()
print ''
import time
time.sleep(10)
if __name__== "main":
monitorJMS()
disconnect()
댓글 없음:
댓글 쓰기