6.1

Table Of Contents
Example: Usage
package hq.example;
import java.util.ArrayList;
import java.util.List;
import org.hyperic.hq.product.FileServerDetector;
import org.hyperic.hq.product.PluginException;
import org.hyperic.hq.product.ServerDetector;
import org.hyperic.hq.product.ServerResource;
import org.hyperic.util.config.ConfigResponse;
public class CustomFileScanDetector
extends ServerDetector
implements FileServerDetector {
/** Base PTQL query to find matching processes by full path */
private static final String PTQL_QUERY = "Exe.Name.ct=";
public List getServerResources(ConfigResponse platformConfig, String path)
throws PluginException {
List servers = new ArrayList();
ConfigResponse productConfig = new ConfigResponse();
// alter query to find discovered process
// this can be later altered through hq gui.
productConfig.setValue("process.query", PTQL_QUERY + path);
ServerResource server = createServerResource(path);
setProductConfig(server, productConfig);
server.setMeasurementConfig();
servers.add(server);
return servers;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<plugin
name="filescan-example"
package="hq.example">
<metrics
name="basic-process-metrics">
<metric
indicator="true"
units="percentage"
name="Availability"
collectionType="dynamic"
template="sigar:Type=ProcState,Arg=%process.query%:State"
category="AVAILABILITY">
</metric>
<metric
indicator="true"
Endpoint Operations Management Agent Plug-in Development Kit
54 VMware, Inc.