Example: Identify running objects
Use queryNames to see running MBean objects.
Jython...
print AdminControl.queryNames('*')Jacl:
$AdminControl queryNames *This command returns a list of all MBean types.
- If the client attaches to a stand-alone WAS, the list contains MBeans that run on that server.
- If the client attaches to a node agent, the list contains MBeans that run in the node agent and MBeans that run on all appservers on that node.
- If the client attaches to a dmgr, the list contains...
- MBeans that run in the dmgr
- all of the node agents communicating with that dmgr
- all appservers on the nodes served by those node agents
The list that queryNames returns is a string representation of JMX ObjectName objects. For example:
WebSphere:cell=MyCell,name=TraceService,mbeanIdentifier=TraceService, type=TraceService,node=MyNode,process=server1This example represents a TraceServer object that runs in server1 on MyNode.
The single queryNames argument represents the ObjectName object for which we are searching. The asterisk ("*") in the example means return all objects, but it is possible to be more specific. As shown in the example, ObjectName has two parts:
- domain
- list of key properties
For MBeans created by the WAS, the domain is WebSphere. If we do not specify a domain when you invoke queryNames, the scripting client assumes the domain is WebSphere.
This means that the first example query above is equivalent to:
Jython...
AdminControl.queryNames('WebSphere:*')Jacl...
$AdminControl queryNames WebSphere:*
ObjectName object:
- name
- type
- cell
- node
- process
- mbeanIdentifier
These key properties are common. There are other key properties that exist. Use any of these key properties to narrow the scope of queryNames.
For example:
Jython...
AdminControl.queryNames('WebSphere:type=Server,node=myNode,*')Jacl...
$AdminControl queryNames WebSphere:type=Server,node=myNode,*This example returns a list of all MBeans that represent server objects running the node myNode. The, * at the end of the ObjectName object is a JMX wildcard designation.
For example, if we enter the following...
Jython...
print AdminControl.queryNames('WebSphere:type=Server,node=myNode')Jacl:
$AdminControl queryNames WebSphere:type=Server,node=myNode...you get an empty list back because the argument to queryNames is not a wildcard.
There is no Server MBean running that has exactly these key properties and no others.
To see all the MBeans representing applications running on a particular node, invoke the following example:
Jython...
print AdminControl.queryNames('WebSphere:type=Application,node=myNode,*')Jacl...
$AdminControl queryNames WebSphere:type=Application,node=myNode,*
Related tasks
Use AdminControl for scripted administration