public abstract class JMXCollector extends Object implements ServiceCollector
The jmx-datacollection-config.xml defines a list of MBeans and attributes that may be monitored. This class retrieves the list of MBeans for the specified service name (currently jboss and jsr160) and queries the remote server for the attributes. The values are then stored in RRD files.
Two types of MBeans may be specified in the jmx-datacollection-config.xml file. Standard MBeans which consist of and ObjectName and their attributes, and WildCard MBeans which performs a query to retrieve MBeans based on a criteria. The current implementation looks like: jboss:a=b,c=d,* Future versions may permit enhanced queries. In either case multiple MBeans may be returned and these MBeans would then be queried to obtain their attributes. There are some important issues then using the wild card approach:
key-alias="this-name-is-long|thisIsNot,name-way-2-long,goodName"exclude="name1,name2,name3"| Modifier and Type | Class and Description |
|---|---|
static class |
JMXCollector.JMXCollectionResource |
| Modifier and Type | Field and Description |
|---|---|
protected JmxConfigDao |
m_jmxConfigDao
the config dao to be used
|
COLLECTION_FAILED, COLLECTION_SUCCEEDED, COLLECTION_UNKNOWN, statusType| Constructor and Description |
|---|
JMXCollector() |
| Modifier and Type | Method and Description |
|---|---|
protected static Map<String,JMXDataSource> |
buildDataSourceList(JMXDataCollectionConfigDao jmxDataCollectionConfigDao,
String collectionName,
Map<String,List<Attrib>> attributeMap)
This method is responsible for building a list of RRDDataSource objects
from the provided list of MBeanObject objects.
|
CollectionSet |
collect(CollectionAgent agent,
EventProxy eproxy,
Map<String,Object> map)
Invokes a collection on the object.
|
protected abstract JmxConnectors |
getConnectionName() |
RrdRepository |
getRrdRepository(String collectionName)
getRrdRepository
|
void |
initialize(CollectionAgent agent,
Map<String,Object> parameters)
initialize
|
void |
initialize(Map<String,String> parameters)
initialize
|
void |
release()
Responsible for freeing up any resources held by the collector.
|
void |
release(CollectionAgent agent)
release
|
String |
serviceName()
Returns the name of the service that the plug-in collects ("JMX").
|
void |
setJmxConfigDao(JmxConfigDao jmxConfigDao) |
void |
setJmxDataCollectionConfigDao(JMXDataCollectionConfigDao jmxDataCollectionConfigDao) |
void |
setServiceName(String name)
Setter for the field
serviceName. |
protected JmxConfigDao m_jmxConfigDao
public String serviceName()
Returns the name of the service that the plug-in collects ("JMX").
public void setServiceName(String name)
Setter for the field serviceName.
name - a String object.public void initialize(Map<String,String> parameters)
ServiceCollectorinitialize
initialize in interface ServiceCollectorparameters - a Map object.public void release()
release in interface ServiceCollectorpublic void initialize(CollectionAgent agent, Map<String,Object> parameters)
initialize
Responsible for performing all necessary initialization for the specified interface in preparation for data collection.initialize in interface ServiceCollectoragent - a org.opennms.netmgt.collectd.CollectionAgent object.parameters - a Map object.public void release(CollectionAgent agent)
release
Responsible for releasing any resources associated with the specified interface.release in interface ServiceCollectoragent - a org.opennms.netmgt.collectd.CollectionAgent object.protected abstract JmxConnectors getConnectionName()
public CollectionSet collect(CollectionAgent agent, EventProxy eproxy, Map<String,Object> map)
collect in interface ServiceCollectoragent - a org.opennms.netmgt.collectd.CollectionAgent object.eproxy - a EventProxy object.map - a Map object.org.opennms.netmgt.config.collector.CollectionSet object.protected static Map<String,JMXDataSource> buildDataSourceList(JMXDataCollectionConfigDao jmxDataCollectionConfigDao, String collectionName, Map<String,List<Attrib>> attributeMap)
collectionName - Collection nameattributeMap - List of MBeanObject objects defining the attributes to be collected via JMX.public RrdRepository getRrdRepository(String collectionName)
getRrdRepository
getRrdRepository in interface ServiceCollectorcollectionName - a String object.RrdRepository object.public void setJmxConfigDao(JmxConfigDao jmxConfigDao)
public void setJmxDataCollectionConfigDao(JMXDataCollectionConfigDao jmxDataCollectionConfigDao)
Copyright © 2020. All rights reserved.