VMware Cloud Community
argonRyan
Contributor
Contributor

Auto-discovery

I am trying to implement a plugin that has auto-discovery feature but I am having trouble implementing it. Is this functionality implemented by specifying the plugin tag with the attribute type set to 'autoinventory'? If so, I am not able to get it working correctly.

The documentation does not have any information regarding this feature:
http://support.hyperic.com/confluence/display/DOCSHQ30/Auto+Inventory+Plugin

Essentially, what I am trying to do is have Hyperic determine from all the resources defined in xml plugin, the currently deployed platform-server-service heiarchy. Could someone explain to me how I can do this?

Also, is it possible to define the platform-server-services or group-services configuration from the plugin?
0 Kudos
3 Replies
scottmf
Enthusiast
Enthusiast

Here is an simple example of a plugin with auto discovery:
(need to post these separately because it looks like the posts are being truncated when they are too long)

${HQ_HOME}/plugins/generic/etc/hq-plugin.xml:

<plugin package="org.hyperic.hq.plugin.generic">
<server name="Generic Server"
version="1.x">
<filter name="domain"
value="generic"/>
<plugin type="measurement"
class="GenericMeasurementPlugin"/>
<plugin type="autoinventory"
class="GenericServerDetector"/>
<config>
<option name="username"
description="Generic username For Example"/>
<option name="password"
type="secret"
description="Generic password For Example"/>
</config>
<service name="Generic Service">
<config>
<option name="option1"
description="Generic Option1 For Example"/>
<option name="option2"
description="Generic Option2 For Example"/>
</config>
<filter name="template"
value="${domain}:Type=GenericService,option1=%option1%,option2=%option2%:${alias}"/>
<metrics>
<metric name="Availability"
category="AVAILABILITY"
units="percentage"
collectionType="dynamic"/>
<metric name="Space Utilization"
category="UTILIZATION"
indicator="true"
units="B"
collectionType="dynamic"/>
</metrics>
</service>
</server>
<server name="Generic Server"
version="2.x"
include="1.x">
</server>
</plugin>
0 Kudos
argonRyan
Contributor
Contributor

I figured it out.

The solution I found utilizes Mx classes for JMX server/service functionality. After sifting through the source code for Hyperic I found out that I needed to define the 'PROC_HOME_PROPERTY' property to point to a uniquely identifiable location on the filesystem that the server resides at. The Java code for the plugin utilizes this to locate unique instances(processes) of the server during autodiscovery. In addition, I needed to specify in the plugin file that each service defined under the server level is an autoinventory plugin type.
0 Kudos
scottmf
Enthusiast
Enthusiast

Here is a full example, just in case.
0 Kudos