|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.collectd.JMXCollector
public abstract class JMXCollector
This class performs the collection and storage of data. The derived class manages the connection and configuration. The SNMPCollector class was used as the starting point for this class so anyone familiar with it should be able to easily understand it.
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 retieve 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 appraoch:
key-alias="this-name-is-long|thisIsNot,name-way-2-long,goodName"exclude="name1,name2,name3"
| Field Summary |
|---|
| Fields inherited from interface org.opennms.netmgt.collectd.ServiceCollector |
|---|
COLLECTION_FAILED, COLLECTION_SUCCEEDED, COLLECTION_UNKNOWN, statusType |
| Constructor Summary | |
|---|---|
JMXCollector()
|
|
| Method Summary | |
|---|---|
CollectionSet |
collect(CollectionAgent agent,
EventProxy eproxy,
Map<String,String> map)
Perform data collection. |
abstract ConnectionWrapper |
getMBeanServerConnection(Map parameterMap,
InetAddress address)
|
RrdRepository |
getRrdRepository(String collectionName)
|
String |
getRRDValue_isthis_used_(JMXDataSource ds,
JMXCollectorEntry collectorEntry)
|
void |
initialize(CollectionAgent agent,
Map parameters)
Responsible for performing all necessary initialization for the specified interface in preparation for data collection. |
void |
initialize(Map parameters)
Initialize the service collector. |
void |
release()
Responsible for freeing up any resources held by the collector. |
void |
release(CollectionAgent agent)
Responsible for releasing any resources associated with the specified interface. |
String |
serviceName()
Returns the name of the service that the plug-in collects ("JMX"). |
void |
setServiceName(String name)
|
void |
setUseFriendlyName(boolean useFriendlyName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JMXCollector()
| Method Detail |
|---|
public String serviceName()
Returns the name of the service that the plug-in collects ("JMX").
public void setServiceName(String name)
public void initialize(Map parameters)
Initialize the service collector.
During initialization the JMX collector: - Initializes various configuration factories. - Verifies access to the database - Verifies access to RRD file repository - Verifies access to JNI RRD shared library - Determines if JMX to be stored for only the node'sprimary interface or for all interfaces.
initialize in interface ServiceCollectorparameters - Not currently used.
RuntimeException - Thrown if an unrecoverable error occurs that prevents
the plug-in from functioning.public void release()
release in interface ServiceCollector
public void initialize(CollectionAgent agent,
Map parameters)
initialize in interface ServiceCollectoragent - Network interface to be prepped for collection.parameters - Key/value pairs associated with the package to which the
interface belongs..public void release(CollectionAgent agent)
release in interface ServiceCollectoragent - Network interface to be released.
public abstract ConnectionWrapper getMBeanServerConnection(Map parameterMap,
InetAddress address)
public CollectionSet collect(CollectionAgent agent,
EventProxy eproxy,
Map<String,String> map)
collect in interface ServiceCollectoragent - Network interface to be data collectedeproxy - Eventy proxy for sending events.parameters - Key/value pairs from the package to which the interface
belongs.
public String getRRDValue_isthis_used_(JMXDataSource ds,
JMXCollectorEntry collectorEntry)
throws IllegalArgumentException
ds - collectorEntry - - dsVal -
Exception
IllegalArgumentExceptionpublic void setUseFriendlyName(boolean useFriendlyName)
useFriedlyName - The useFriedlyName to set.public RrdRepository getRrdRepository(String collectionName)
getRrdRepository in interface ServiceCollector
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||