!--a11y-->
Retrieving Monitoring Data from an External
Client via JMX 
Use this procedure to extract monitoring data from the Monitoring Service using JMX.
...
1. Ensure that class loader of the component or standalone client can load the classes form the JMX library
a. for a component deployed on the J2EE Engine, you must set a reference in its provider.xml:
<reference reference-type="weak"> <reference-target target-type="library"> tc~jmx </reference-target> </reference> |
b. for a standalone client, ensure that the JMX library is in your classpath
2. Connect to the MBean Server
For more information about how you can connect to the MBean Server, see Connect to an MBeanServer.
3. Create the ObjectName corresponding to the monitor whose value you want to retrieve.
To do this, you must first know the attribute's path, that is, where the value you are interested in is situated in the monitoring tree. The monitor tree is visualized in the monitor browser within the Visual Administrator tool. For a delimiter, you must use a slash (“/”).
From the path of the monitor within the tree, the ObjectName is built using the getNameForMonitorPerNode(..) method in com.sap.jmx.ObjectNameFactory.
For example, for a monitor with path /Applications/Bank Information/General Information/Bank ranking, you can build the ObjectName using the following lines of code:
String pathInTheTree = “/Applications/Bank Information/General Information/Bank ranking”; ObjectName monitorObjectName = ObjectNameFactory.getNameForMonitorPerNode(ObjectName.quote(pathInTheTree), null, null);
|
4. Invoke the proper method on the MBean that has the ObjectName built in step 3.
For more information about the methods of the different types of monitors, see:
Performance monitors and their methods – contains a list of methods and examples of the availability monitor, integer monitor, long monitor, frequency monitor, quality-rate monitor, and duration monitor.
Non-performance monitors and their methods – contains a list of methods and examples of the text-monitor, state-monitor, table-monitor, version-monitor, and configuration-monitor.
