Plugin Development CenterTopics marked with * relate to HQ Enterprise-only features. Plugins are the interface between Hyperic HQ and products on the network you want to manage. HQ can detect hundreds of products thanks to its standard plugins, but you can extend HQ's functionality to products (or parts of products) not yet covered by HQ by developing your own custom plugins. This page gives you an overview of plugins and points you to detailed instructions for specific plugin types. All HQ bundled plugins are available in both the Enterprise and Open Source versions of HQ. The only difference is that, as reflected in the HQ feature list, plugins in the Enterprise version enable more management features. For a soup-to-nuts lesson on writing your own custom plugins, please see our Plugins Tutorial.
Feedback is welcome. Click Add Comment at the bottom of the page. What Do Plugins Do? An OverviewProper development and functioning of HQ plugins rely on a thorough understanding of the HQ inventory model and of the four HQ functions that plugins implement:
In addition, the Product Plugin provides the deployment entry point on both the Server and Agent. It defines the resource types and plugin implementations for measurement, control, and auto-discovery (auto-inventory). You can use plugins discover, collect data from, and control resources; plugins cannot be used to change alerting, reporting, or similar, Server-side functionality. How Plugins Use the HQ Inventory ModelWhen writing a resource plugin, it is important to take into account the HQ inventory model and its relationship to the structure of a plugin. A plugin should implement a hierarchy that reflects the hierarchy of the inventory model; it should not be flat. The tutorials and example plugins in the Plugin Development Center illustrate how the servers and services (and, less frequently, platforms) being targeted by the plugin are organized according to the inventory model. For example, to discover a service, first discover its hosting server, and then discover the services running on the server. For a more specific example: SNMP has multiple network interfaces. Each of those network interfaces should be mapped to/treated as a separate service in the plugin, not all combined into one big platform. One of the benefits of modeling a plugin after the Inventory Model is that you can then implement actions (gathering metrics, controlling, etc.) at each inventory level and there will no confusion or difficulty about which level of resource the plugin should be acting on. What Role do the Server and Agent Play in PluginsPlugins must be deployed on both the Server and Agent. The Server and Agent each play different roles vis-a-vis plugins: The Agent does the work of gathering all the data from resources and generally communicating with the resource. Using the plugin, the Agent can:
The Server deals in meta-data, which is to say, it knows about:
Technical OverviewHyperic HQ plugins are self-contained .jar or .xml files which are deployed on both the Server and every Agent that you want to run the plugin. Every plugin contains, at a minimum, an XML descriptor, which is either a standalone .xml file or embedded in the .jar file. Learn more about the XML descriptor syntax. Plugin ImplementationsFor the sake of discussion, we'll call measurement, control, etc. the "types" of plugins. They can be created for any kind of resource. Depending on the kind of resource and how it communicates and surfaces its data, however, you will write different "implementations" of those plugin types. The different implementations are:
Using Support Classes to Simplify Your PluginHQ provides a bunch of "support classes" (that is, plugins) that you can invoke in your own plugins to abstract and simplify its construction. HQ provides the following support classes:
How Do I Write a Plugin?The interface with HQ plugins is simple. For example, the HQ-provided Measurement plugin has only one method (getValue); the Autoinventory plugin has only one method for each inventory level. The hard part of writing a plugin is figuring out:
The easiest way to write your first plugin is to start with an existing plugin that does almost what you want and tweak it to fit your needs. You can start with these example plugins or with our Plugins Tutorial. Testing Your PluginThe PDK allows you to invoke your plugin methods from the command line for quick testing. To perform any of the following tasks (targeted mainly at measurement plugins), run the associated commands from the command line in the HQ Agent directory: Check the syntax of the plugin: (simply initializes the plugin) java -jar <Agent Directory>/pdk/lib/hq-product.jar -Dplugins.include=yourPluginName -m lifecycle -Dlog=debug Make sure the plugin can indeed collect the metrics: (runs the plugin and outputs the metric values) java -jar <Agent Directory>/pdk/lib/hq-product.jar -Dplugins.include=yourPluginName -m metric Make sure the plugin can perform auto-discovery: (enables auto-discovery in addition to metric collection) java -jar <Agent Directory>/pdk/lib/hq-product.jar -Dplugins.include=yourPluginName -m discover -a metric Enable debug for troubleshooting: java -jar <Agent Directory>/pdk/lib/hq-product.jar -Dplugins.include=yourPluginName -m discover -a metric -Dlog=debug
Learn more about invoking plugins outside of the Server and Agent, including more testing commands. Deploying Your PluginYou must deploy your custom plugin on the HQ Server and on all the Agents you want to run the plugin. Deploying the Plugin in .xml or .jar FormatYou can name your plugin as you please, but the name must end with either -plugin.xml or -plugin.jar, depending on the plugin format.
Where to Place Custom-Plugin FilesUsually you will place your custom-plugin files in a subdirectory of the Server's and Agent's parent directories. By doing this, your plugin files will persist through upgrades. The subdirectory is called hq-plugins. For example: Non-Windows Installation
Windows Installation
Alternate File Placement
You should do this when, for example, you are installing a patch to a plugin, or if you want to keep all your Agent-deployment files together. Hot Deployment of PluginsThe Server supports hot-deployment: plugins can be updated or added without restarting the Server. The Agent does not support hot-deployment: it must be restarted after a plugin is updated or added. Invoking Plugins Outside the Server or AgentWhen developing plugins, it's helpful to be able to invoke plugin methods directly for quick testing. The Invoking Plugins Standalone document describes this process. Plugin Examples
Return to Development Resources. |
Plugin Development Center
(None)