Retrieves list of wdr.control.MBean instances matching specified criteria.

queryMBeans( [<domain>,] <criteria> )

Arguments

domain

JMX domain being searched; optional argument, defauts to value of ‘WebSphere’; in most of the cases you can skip this argument and rely on the default value

criteria

list of key/value pairs

Result

List of wdr.control.MBean instances.

Examples

  • Printing free and available memory for each JVM MBean found
for jvm in queryMBeans(type='JVM'):
    print 'Free/max memory: %d/%d' % (jvm.freeMemory, jvm.maxMemory)
  • Printing attribute value of one of custom MBeans, registered in ‘ACME’ domain
for tp in queryMBeans('ACME', type='com.acme.tasks.TaskProcessor', module='OrderProcessing'):
    print 'Failed/total number of orders: %d/%d' % (tp.failed, tp.total)

See also