6.1

Table Of Contents
This method returns a list of registry keys to scan. The ServerDetector class
contains default implementation for this function, which requests keys from
the plug-in descriptor file. The example XML content that is used in this
document results in the single list member SOFTWARE\Microsoft\Internet
Explorer.
A user can implement/overwrite this method to return a list of keys directly.
Returns: A list of registry keys.
Example: Usage
package hq.example;
import java.util.ArrayList;
import java.util.List;
import org.hyperic.hq.product.PluginException;
import org.hyperic.hq.product.RegistryServerDetector;
import org.hyperic.hq.product.ServerDetector;
import org.hyperic.hq.product.ServerResource;
import org.hyperic.sigar.win32.RegistryKey;
import org.hyperic.util.config.ConfigResponse;
public class CustomRegistryScanDetector
extends ServerDetector
implements RegistryServerDetector {
/** Base PTQL query to find matching processes by full path */
private static final String PTQL_QUERY = "State.Name.eq=iexplore";
public List getServerResources(ConfigResponse platformConfig, String path, RegistryKey
current)
throws PluginException {
List servers = new ArrayList();
ConfigResponse productConfig = new ConfigResponse();
productConfig.setValue("process.query", PTQL_QUERY);
ServerResource server = createServerResource(path);
setProductConfig(server, productConfig);
server.setMeasurementConfig();
servers.add(server);
return servers;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<plugin
name="registryscan-example"
package="hq.training">
<metrics
Chapter 4 Plug-In Support Classes
VMware, Inc. 59