6.1
Table Of Contents
- Endpoint Operations Management Agent Plug-in Development Kit
- Contents
- About the Endpoint Operations Management Agent Plug-in Development Kit
- Introduction to Plug-in Development
- The Role of the Server and Agent in Plug-ins
- Technical Overview
- Plug-in Implementations
- Using Support Classes to Simplify a Plug-in
- Writing Plug-ins
- JMX Plug-in
- Script Plug-ins
- SNMP Plug-in
- JMX-Based Management
- Auto-Discovery of JMX Resources
- Configuration Properties for JMX Monitoring
- Creating a Custom JMX Plug-in
- Defining Service Types to Provide Management via Custom MBeans
- Defining an ObjectName to Access Custom MBeans
- Defining Configuration Properties to Appear in the User Interface
- Defining and Gathering Metrics
- Specifying the Availability Metric for MBeans
- Implementing Control Actions
- Defining the Server Auto-Inventory Element
- Discovering Custom Properties
- Running and Testing Plug-ins from the Command Line
- Using Auto-Discovery Support Classes in Plug-ins
- Working with Plug-in Descriptors
- Plug-In Support Classes
- Index
The plug-in must also define the control implementation class, which resides in the hq-jmx.jar file.
<plugin type="control"
class="org.hyperic.hq.product.jmx.MxControlPlugin"/>
The control actions are invoked as MBean operations by the plug-in, as follows
ObjectName name = new ObjectName("Catalina:type=StringCache");
return MbeanServer.invoke(name, "reset", new Object[0], new String[0]);
which maps to the following MBean operation
public interface StringCacheMBean {
public void reset();
}
Example: WebApp Cache Control Actions
The WebApp Cache plug-in example provides the following control actions:
<actions include="unload,lookup,allocate"/>
which maps to the following MBean operations:
public interface WebAppCacheMBean {
public boolean unload(String name);
public CacheEntry lookup(String name);
public boolean allocate(int value);
}
Defining the Server Auto-Inventory Element
To implement auto-discovery at the server level, you must invoke an autoinventory plug-in with the
MxServerDetectorclass within the server tag.
Implement auto-discovery as follows,
<server name="Java Server Name" version ="version #">
...
<plugin type="autoinventory" class="org.hyperic.hq.product.jmx.MxServerDetector"/>
...
</server>
In the case of service, auto-discovery is supported for custom MBean services, driven by the OBJECT_NAME
property. To implement auto-discovery at the service level, invoke the autoinventory plug-in, leaving out
the class attribute, within a service tag.
<service name="Java Service Name">
...
<plugin type="autoinventory"/>
...
</service>
The JMX plug-in uses the MBeanServer.queryNames method to discover a service for each MBean instance. In
the case in which the OBJECT_NAME contains configuration properties, the properties are auto-configured.
Endpoint Operations Management Agent Plug-in Development Kit
24 VMware, Inc.