Plugin XML DescriptorThis page presents a limited syntax for the plugin XML descriptor. Most of what you'll need when writing an XML descriptor is described here. For a complete syntax, see the Plugin XML Descriptor Syntax. Plugin FormatsPlugins are supported in the following formats:
Plugin ClasspathEach plugin.jar has its own ClassLoader which includes the following in its classpath:
Plugin TagsAvailable Tags
Top-level <plugin> Tag<plugin> Attributes:
This is only needed if one wishes to override methods in the ProductPlugin. Server and Service <plugin> TagThe <plugin> tag at the server or service level defines which classes implement each plugin type, if any. If class attribute is omitted at the service level, its value is inherited from the enclosing server type. <plugin> Attributes:
<plugin> Example <server name="MsSQL" version="2000" platforms="Win32"> <plugin type="measurement" class="MsSQLMeasurementPlugin"/> <plugin type="autoinventory" class="MsSQLDetector"/> <plugin type="control" class="net.hyperic.hq.product.Win32ControlPlugin"/> Configuration SchemaIn order to implement measurement, control and the like, most resource types require configuration properties. For example, connecting to a JBoss server requires a JNP url. Getting metrics for a JBoss service, such as an EJB, requires the name of the J2EE Application and EJB name. The properties are displayed in the "Resource Configuration" screen for each resource. The configuration schema determines what properties are displayed in the UI and what default values they have, and it validates property values. Many configuration property values are populated automatically by HQ through auto-discovery. Configuration properties such as password, for example, must be provided by a user. <config> Tag Attributes:
Certain config schemas have different options depending on the platform. For example, Unix platforms generally use scripts for control actions, where the same product on Win32 may use the Windows service manager.
<option> Tag Attributes:
<option> Example <option name="jdbcDriver" type="enum" description="JDBC Driver Class Name" default="org.postgresql.Driver"> <include name="org.postgresql.Driver"/> <include name="oracle.jdbc.driver.OracleDriver"/> <include name="com.microsoft.jdbc.sqlserver.SQLServerDriver"/> </option> <filter> TagThe <filter> tag is used to define variables which are replaced with the xml file. Example: <filter name="imap4" value="MSExchangeIMAP4"/> <metric name="Login Total" template="win32:Object=${imap4},Instance=Global:${name}" ... Is filtered to result in: <metric name="LOGIN Total" template="win32:Object=MSExchangeIMAP4,Instance=Global:LOGIN Total" ... Note that metric attributes are also treated as filters, in this case the name attribute is expanded to LOGIN Total. <property> TagThe <property> tag acts like a <filter>, but is also saved for use within the plugin code itself. For example, the property named template-config is used by the MeasurementPlugin to append connection properties to the template attribute of every <metric>: <property name="template-config" value="java.naming.provider.url=%java.naming.provider.url%"/> The <property> tag can be attached to a specific resource type by using it within a <server> or <service> tag. For example: <service name="Entity Container"> <property name="OBJECT_NAME" value="jboss.j2ee:jndiName=%jndiName%,service=EJB"/> <plugin type="control" class="net.hyperic.hq.product.jboss.JBossServiceControlPlugin"/> <metric name="Cache Size" template="${OBJECT_NAME}:CacheSize" indicator="true"/> The value is retrieved within JBossServiceControlPlugin: protected String getObjectName() { String objectName = getTypeProperty("OBJECT_NAME"); ... <metrics> and <metric> TagsThe <metrics> tag is used for grouping metric tags, allowing you to define metrics in one place and include them elsewhere in the file. This grouping carries over to the UI. In this example, notice how a group of metrics called "mssql-database" is defined initially and then later that same group is include ed. <metrics> Example <metrics name="mssql-database"> <metric name="Active Transactions" template="${db.domain}:Platform=Win32:Active Transactions" category="THROUGHPUT" indicator="true"/> ... </metrics> <server name="MsSQL" version="2000" platforms="Win32"> ... <metrics> <include name="mssql-database"/> ... </metrics> <service name="Database"> <metrics> <include name="mssql-database"/> ... </metrics> </server> <help> TagThe <help> tag is intended for products ("resource types," in HQ parlance) that require changes for enabling monitoring. The help text is displayed on the "Resource Configuration" screen to notify users of actions they must take before monitoring a particular resource type. For example, the help text could tell users that Apache requires installation of the SNMP module, iPlanet/SunONE requires configuration changes to enable SNMP monitoring, Tomcat requires a webapp to be installed and configured, or certain databases require a user login to have permissions to query monitoring data. <help> Example <help name="Sendmail"> <![CDATA[ <h3>Configure HQ for monitoring Sendmail</h3> <br> This plugin needs sudo access as root in order to access the appropriate Sendmail dirs. ]]> </help> <server> TagThe <server> tag defines a server resource type. Both this and the <service> tag help align the plugin with the HQ Inventory Model.
<server> Example <server name="MsSQL" version="2000" description="Microsoft SQL Server" platforms="Win32"> ... </server> The name and version attributes are used to compose the server resource type name, seen in the UI and used by autodiscovery. In the example above, the resource type name will be "MsSQL 2000". The platforms attribute can be used to limit which platforms support the given server type. <scan> TagThe <scan> tag is a container for specifying file name patterns and registry keys used for server autodiscovery. Example file scan config from the JBoss plugin: <scan> Example from JBoss plugin <scan>
<include name="/**/server/*/conf/jboss-service.xml"/>
</scan>
Example registry scan config from the MySQL plugin: <scan> Example from MySQL plugin <scan registry="SOFTWARE\MySQL AB\MySQL Server 4.1"> <include name="Location"/> </scan> <service> TagThe <service> tag defines a server resource type. Both this and the <server> tag help align the plugin with the HQ Inventory Model.
<service> Example <server name="MsSQL" version="2000" description="Microsoft SQL Server" platforms="Win32"> ... <service name="Database"> </server> The name attribute is used to compose the service resource type name, seen in the UI and used by autodiscovery. This value is appended to the enclosing server type name. In the example above, the resource type name will be MsSQL 2000 Database. |
Plugin XML Descriptor
(None)
Comments (3)
Jan 13, 2009
Anonymous says:
Is there a way to add precision to a metric? It defaults to 1 decimal place.Is there a way to add precision to a metric? It defaults to 1 decimal place.
Jan 13, 2009
Tim Harper says:
@anonymous Look over here for all attributes that metric supports:@anonymous
Look over here for all attributes that metric supports:
http://support.hyperic.com/display/DOC/Metric+Parameters
May 03, 2009
BJ Chippindale says:
Is there a recommended pattern for a single instance of the server plugin provid...Is there a recommended pattern for a single instance of the server plugin providing services to multiple measurement plugins?
What starts the class that connects to the server and where?
How does a measurement plugin get attached to the server plugin instance that has started?
There is a lot more to say here.
The case where resources relating to multiple services are far more efficiently retrieved in a single operation than by repeatedly invoking the server and filtering the results seems to require tiers but I don't understand the usage here.
BJ