VMware Cloud Community

Writing a plugin that picks up server names dynamically

I want to write a plugin that monitors a perfmon object's instances without hardcoding the instances in the plugin.

For example, in perfmon I see a Processor object that has 3 instances 0, 1, and _Total

So I could monitor those instances with a plugin like this

  <server name="Processor Services" platforms="Win32">
    <plugin type="measurement" class="org.hyperic.hq.product.MeasurementPlugin"/>
    <plugin type="autoinventory" class="org.hyperic.hq.product.DaemonDetector"/>
    <property name="PROC_QUERY" value="Pid.Service.eq=Processor"/>

    <filter name="template" value="win32:Object=Processor,Instance${alias}% Processor Time" />

    <metric name="Processor: 0" alias="=0:" />
    <metric name="Processor: 1" alias="=1:"/>
    <metric name="Processor: _Total" alias="=_Total:"/>

note - My aliases have some redundant characters ( = and : ) I had to do in this to meet the 3 character minimum for aliases.

I want to monitor some objects that have different instances between client machines and would like to specify the object and have the instances picked up dynamically.

I overrode the getServerResources to return the list of servers as 0, 1, _Total but do not know how to make use of this information without hard-coding the instance names in the xml.

Any tips? Do any of the example plugins do something similar? I have looked through them and did not notice any.

0 Kudos
0 Replies