IBM Support

JMS queues monitoring scripts provided by WebSphere Level 2 support.

Technical Blog Post


Abstract

JMS queues monitoring scripts provided by WebSphere Level 2 support.

Body

Many customers are wandering how to monitor the JMS queues status without using the WebSphere console.

Please find attached a script that can be used to list the runtime state of all queue points in all Buses known to a DMGR, as well as remote queue points (and the corresponding state associated with the actual queue point).

  Here is how to run it:

Usage: <DMGR_PROFILE_ROOT>/bin/wsadmin.sh -lang jython -f list_all_queues.py

 

# Lookup all ME's and build a UUID->Name hash
mesByUUID = {}
mes = AdminConfig.list("SIBMessagingEngine").split("\n")
for me in mes:
  me = me.strip() # Remove carriage returns on Windows
  meName = AdminConfig.showAttribute(me, "name")
  meUUID = AdminConfig.showAttribute(me, "uuid")
  mesByUUID[meUUID] = meName

# List details of all queue points, including remote transmitters and remote receivers
objName = AdminControl.makeObjectName('WebSphere:type=SIBQueuePoint,*')
qps = AdminControl.queryNames_jmx(objName, None)
for qp in qps:
  name  = qp.getKeyProperty("name")
  me    = qp.getKeyProperty("SIBMessagingEngine");
  try:
    id  = qp.getKeyProperty("ID");
    state = AdminControl.getAttribute_jmx(qp, 'state')
    depth = AdminControl.getAttribute_jmx(qp, 'depth')
    print "QUEUEPOINT("+name+"@"+me+") DEPTH(" + str(depth) + ") STATE(" + state + ") ID(" + id + ")"
    if (state == "ACTIVE"):
      rcts = AdminControl.invoke_jmx(qp, 'listRemoteConsumerTransmitters', [], [])
      for rct in rcts:
        remoteME= mesByUUID[rct.getRemoteEngineUuid()]
        if (remoteME == None): remoteMe = rct.getRemoteEngineUuid()
        print "  RemoteConsumerTransmitter(ME=" + remoteME + ") DEPTH(" + str(rct.getDepth()) + ") COMPLETEDREQ(" + str(rct.getNumberOfCompletedRequests()) + ") RECEIVEDREQ(" + str(rct.getNumberOfRequestsReceived()) + ")";
      ibs = AdminControl.invoke_jmx(qp, 'listInboundReceivers', [], [])
      for ib in ibs:
        remoteME= mesByUUID[ib.getRemoteEngineUuid()]
        if (remoteME == None): remoteMe = ib.getRemoteEngineUuid()
        print "  RemoteInboundReceiver(ME=" + remoteME + ") DEPTH(" + str(ib.getDepth()) + ") MSGSRECEIVED(" + str(ib.getNumberOfMessagesReceived()) + ") LASTTICK(" + str(ib.getLastTickReceived()) + ")";
  except:
    print "Failed while querying " + name + "@" + me;

# List all remote queue points, including outbound transmitters and remote receivers
objName = AdminControl.makeObjectName('WebSphere:type=SIBRemoteQueuePoint,*')
rqps = AdminControl.queryNames_jmx(objName, None)
for rqp in rqps:
  name  = rqp.getKeyProperty("name")
  me    = rqp.getKeyProperty("SIBMessagingEngine");
  uuid  = rqp.getKeyProperty("id");
  try:
    state = AdminControl.getAttribute_jmx(qp, 'state')
    print "REMOTEQUEUEPOINT("+name+"@"+me+") ID(" + uuid + ") STATE(" + state + ")"
    ot = AdminControl.invoke_jmx(rqp, 'getOutboundTransmitter', [], [])
    if (state == "ACTIVE"):
      if (ot != None):
        remoteME= mesByUUID[ot.getRemoteEngineUuid()]
        if (remoteME == None): remoteMe = ot.getRemoteEngineUuid()
        print "  OutboundTransmitter(ME=" + remoteME + ") DEPTH(" + str(ot.getDepth()) + ") CONTAINSGUESSES(" + str(ot.getContainsGuesses()) + ") MSGSSENT(" + str(ot.getNumberOfMessagesSent()) + ")";
      rcr = AdminControl.invoke_jmx(rqp, 'getRemoteConsumerReceiver', [], [])
      if (rcr != None):
        remoteME= mesByUUID[rcr.getRemoteEngineUuid()]
        if (remoteME == None): remoteMe = rcr.getRemoteEngineUuid()
        print "  RemoteConsumerReceiver(ME=" + remoteME + ") LASTTICKRECEIVED(" + str(rcr.getLastTickReceived()) + ") ACTIVEREQ(" + str(rcr.getNumberOfActiveRequests()) + ") COMPLETEDREQ(" + str(rcr.getNumberOfCompletedRequests()) + ") ISSUEDREQ(" + str(rcr.getNumberOfRequestsIssued()) + ")";
  except:
    print "Failed while querying " + name + "@" + me;

 

 

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSLKT6","label":"IBM Maximo Asset Management"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

UID

ibm11132017