ITM Agent Insights: Gathering CompositeData MBean attributes with custom JMX monitoring agent
DougDoering 120000E6GG Visits (10537)
IBM Tivoli Monitoring Agent Builder allows for the creation of custom monitoring agents using a JMX data source. JMX data sources gather attribute metrics based on MBean data. By default, custom agent attributes will not dig into a "CompositeData" MBean. This post will explain how to define custom agent attributes to gather the details for CompositeData MBeans by specifying the "Name" value for a sub-attribute to be passed to the "get" method.
For general example of creating a JMX monitoring agent with Agent Builder, refer to DCF 1963798.
An example of a CompositeData MBean is the HeapMemoryUsage and NonHeapMemoryUsage objects.
"Heap Memory Usage" values as seen through jconsole:
"Heap Memory Usage" MBean definition as seen through jconsole:
In Agent Builder, first create an attribute group by browsing for the CompositeData MBean, in this example browse for MBeans with type=Memory:
After adding the MBean that contains the CompositeData, go to "Data Sources" tab and highlight the attribute group for the CompositeData MBean, in this example "Memory (JMX)":
Either "Add to Selected" and respond when prompted for attribute information.
IBM Tivoli Monitoring Agent Component Wizard -> Attribute Information:
Alternately, edit an existing attribute and change the value in the "JMX Attribute Information" tab for the "Metric name" to include the get method and the sub-attribute name:
After adding the attributes using the "get" method and the sub-attribute values from the CompositeData MBean, highlight the attribute group - in this example "Memory (JMX)"
Then click on the "Test" button and verify the attributes created for the sub-attribute values populate with valid information:
After verifying that the Composite Mbean attribute definitions allow the metrics to be gathered, proceed to build / generate the custom agent as with any other custom agent in Agent Builder.
Additional ITM Agent Insights series of IBM Tivoli Monitoring Agent blogs are indexed under ITM
Subscribe and follow us for all the latest information directly on your social feeds: