public class JMXCollector extends AbstractRemoteServiceCollector
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"| Constructor and Description |
|---|
JMXCollector() |
| Modifier and Type | Method and Description |
|---|---|
protected static Map<String,JMXDataSource> |
buildDataSourceList(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,
Map<String,Object> map)
Invokes a collection on the object.
|
protected JmxConnectors |
getConnectionName() |
RrdRepository |
getRrdRepository(String collectionName)
Retrieve the
RrdRepository configuration for the given collection. |
Map<String,Object> |
getRuntimeAttributes(CollectionAgent agent,
Map<String,Object> parameters)
Invoked before every call to
#collect(CollectionAgent, EventProxy, Map) in order
to retrieve state/runtime information required for perform the collection. |
void |
initialize()
Initialize the collector.
|
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. |
getEffectiveLocation, marshalParameters, unmarshalParametersvalidateAgentpublic 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()
ServiceCollectorinitialize in interface ServiceCollectorinitialize in class AbstractServiceCollectorpublic Map<String,Object> getRuntimeAttributes(CollectionAgent agent, Map<String,Object> parameters)
ServiceCollector#collect(CollectionAgent, EventProxy, Map) in order
to retrieve state/runtime information required for perform the collection.
This call will always be performed in OpenNMS.getRuntimeAttributes in interface ServiceCollectorgetRuntimeAttributes in class AbstractServiceCollectoragent - Includes details about to the agent from which we wish to collect.parameters - Includes the service parameters defined in collectd-configuration.xml.#collect(CollectionAgent, EventProxy, Map).protected JmxConnectors getConnectionName()
public CollectionSet collect(CollectionAgent agent, Map<String,Object> map)
ServiceCollectoragent - a org.opennms.netmgt.collectd.CollectionAgent object.map - a Map object.org.opennms.netmgt.config.collector.CollectionSet object.protected static Map<String,JMXDataSource> buildDataSourceList(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)
RrdRepository configuration for the given collection.
This call will always be performed in OpenNMS.collectionName - a String object.RrdRepository object.public void setJmxConfigDao(JmxConfigDao jmxConfigDao)
public void setJmxDataCollectionConfigDao(JMXDataCollectionConfigDao jmxDataCollectionConfigDao)
Copyright © 2022. All rights reserved.