This should be easy, but I'm having problems writing a custom plugin to create a new service that displays metrics about my application running in tomcat server. I have tested my MBean against jconole and it's fine.
Plugin looks something like this:
<plugin name="Obsidian">
<!--<property name="PLUGIN_VERSION" value="1.0"/>-->
<service name="Obsidian-Midtier">
<!-- the Obsidian MBean objectname -->
<property name="OBJECT_NAME" value="com.sas.obsidian:service=Signature,name=QueryStatistics"/>
<!-- autodiscover -->
<plugin type="autoinventory"/>
<!-- list measurements to include -->
<plugin type="measurement" class="org.hyperic.hq.product.jmx.MxMeasurementPlugin"/>
<filter name="template" value="${OBJECT_NAME}:${alias}"/>
<metric name="Event Rate" alias="EventRate" indicator="true"/>
<metric name="Event Rate Sampling Size" alias="EventRateSampleSize" indicator="true"/>
<metric name="Event Query Count" alias="EventQueryCount" indicator="true"/>
<!-- list operations -->
<plugin type="control" class="org.hyperic.hq.product.jmx.MxControlPlugin"/>
<actions include="setEventRateSampleSize,getEventQueryCount,getVisitorQueryCount,getVisitorQueryCountByEvent"/>
</service>
</plugin>
How can I get my service to be auto-discovered? Do I need to associate it with a server? Or will it just search all servers?
Any help is greatly appreciated.
I would love to see some errors or something stating that I have something wrong. How can I test my plugin for errors? When I run hq-pdk.jar -p obsidian -m discover, I just get "0 servers detected". No errors.
Thanks.