|
Hyperic HQ Plugin API v. 2.5.dev | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.hyperic.hq.product.GenericPlugin
net.hyperic.hq.product.ServerDetector
Encapsulate the know-how to determine all kinds of server-specific information about a single type of server.
Field Summary |
Fields inherited from class net.hyperic.hq.product.GenericPlugin |
config, FILE_DELIM, FILE_DELIM_ESC, PROP_NAME |
Constructor Summary | |
ServerDetector()
|
Method Summary | |
protected ServerResource |
createServerResource(java.lang.String installpath)
Initialize an ServerResource with default values. |
protected ServiceResource |
createServiceResource(java.lang.String type)
|
net.hyperic.hq.product.RuntimeResourceReport |
discoverResources(int serverId,
net.hyperic.hq.appdef.shared.AIPlatformValue platform,
ConfigResponse config)
Deprecated. - Plugins should not use this method. |
protected java.util.List |
discoverServers(ConfigResponse config)
Override to discover servers for the server type of the plugin instance. |
protected java.util.List |
discoverServices(ConfigResponse config)
Override to discover services for the server type of the plugin instance. |
protected static java.lang.String |
getCanonicalPath(java.lang.String installpath)
Fixup the installpath. |
protected AutoinventoryPluginManager |
getManager()
|
protected static java.lang.String |
getParentDir(java.lang.String path)
Chop the last element off a path. |
static java.lang.String |
getParentDir(java.lang.String path,
int levels)
Chop the last elements off of a path. |
protected static long[] |
getPids(java.lang.String query)
Wrapper for Sigar's ProcessFinder.find method. |
protected static java.lang.String[] |
getProcArgs(long pid)
Wrapper for Sigar.getProcArgs which catches SigarException and returns a String[] with length 0 if the SigarException is caught. |
protected static java.lang.String |
getProcCwd(long pid)
Attempt to get the current working directory of a process. |
protected static java.lang.String |
getProcExe(long pid)
|
protected static java.lang.String |
getProcExe(long pid,
java.lang.String name)
Attempt to find the absolute name of the process executable. |
protected static java.util.List |
getProcModules(long pid)
Wrapper for Sigar.getProcModules which catches SigarException and returns a String[] with length 0 if the SigarException is caught. |
java.util.List |
getRegistryScanKeys()
Helper for RegistryServerDetector implementors. |
net.hyperic.hq.product.RuntimeDiscoverer |
getRuntimeDiscoverer()
Deprecated. - Plugins should not use this method. |
net.hyperic.hq.autoinventory.ServerSignature |
getServerSignature()
The server signature is defined by plugins in etc/hq-plugin.xml if the plugin implements FileServerDetector or RegistryServerDetector. |
java.util.List |
getServiceConfigs(java.lang.String type)
|
java.util.Map |
getServiceInventoryPlugins()
|
protected static net.hyperic.sigar.SigarProxy |
getSigar()
|
void |
init(PluginManager manager)
Called when the plugin is loaded on the server and on the agent side. |
boolean |
isRuntimeDiscoverySupported()
If plugins do not override discoverServers or discoverServices, returning false here will prevent those methods from being called. |
boolean |
isWin32ServiceRunning(java.lang.String name)
|
protected void |
setControlConfig(ServerResource server,
ConfigResponse config)
Merge default values from server's control ConfigSchema and saves to ServerResource.setControlConfig. |
protected void |
setControlConfig(ServiceResource service,
ConfigResponse config)
Merge default values from services's control ConfigSchema and saves to ServiceResource.setControlConfig. |
protected void |
setCustomProperties(ConfigResponse cprops)
|
protected void |
setDescription(java.lang.String description)
|
protected void |
setMeasurementConfig(ServerResource server,
ConfigResponse config)
Merge default values from server's measurement ConfigSchema and saves to ServerResource.setMeasurementConfig. |
protected void |
setMeasurementConfig(ServiceResource service,
ConfigResponse config)
Merge default values from service's measurement ConfigSchema and saves to ServiceResource.setMeasurementConfig. |
protected void |
setProductConfig(ServerResource server,
ConfigResponse config)
Merge default values from server's product ConfigSchema and saves to ServerResource.setProductConfig. |
protected void |
setProductConfig(ServiceResource service,
ConfigResponse config)
Merge default values from service's product ConfigSchema and saves to ServiceResource.setProductConfig. |
Methods inherited from class net.hyperic.hq.product.GenericPlugin |
configure, getAbsoluteFiles, getConfig, getConfig, getConfigSchema, getCustomPropertiesSchema, getCustomPropertiesSchema, getCustomPropertiesSchema, getDefaultInstallPath, getLog, getLogName, getName, getPlatformName, getPluginClassName, getProductPlugin, getProperties, getProperty, getTypeInfo, getTypeNameProperty, getTypeNameProperty, getTypeProperty, getTypeProperty, getTypeProperty, isWin32, openResource, setName, setTypeInfo, shutdown, toFileList |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ServerDetector()
Method Detail |
public net.hyperic.hq.product.RuntimeDiscoverer getRuntimeDiscoverer()
discoverServers(net.hyperic.util.config.ConfigResponse)
,
discoverServices(net.hyperic.util.config.ConfigResponse)
public boolean isRuntimeDiscoverySupported()
public net.hyperic.hq.product.RuntimeResourceReport discoverResources(int serverId, net.hyperic.hq.appdef.shared.AIPlatformValue platform, ConfigResponse config) throws PluginException
discoverResources
in interface net.hyperic.hq.product.RuntimeDiscoverer
PluginException
discoverServers(net.hyperic.util.config.ConfigResponse)
,
discoverServices(net.hyperic.util.config.ConfigResponse)
protected void setDescription(java.lang.String description)
protected void setCustomProperties(ConfigResponse cprops)
protected java.util.List discoverServers(ConfigResponse config) throws PluginException
config
- Configuration of the parent server resource.
PluginException
- If an error occured during discovery.discoverServices(net.hyperic.util.config.ConfigResponse)
,
ServerResource
protected java.util.List discoverServices(ConfigResponse config) throws PluginException
config
- Configuration of the parent server resource.
PluginException
- If an error occured during discovery.public void init(PluginManager manager) throws PluginException
GenericPlugin
init
in class GenericPlugin
manager
- The plugin manager for this plugin type.
PluginException
protected AutoinventoryPluginManager getManager()
public java.util.List getRegistryScanKeys()
public net.hyperic.hq.autoinventory.ServerSignature getServerSignature()
protected ServerResource createServerResource(java.lang.String installpath)
installpath
- Used to set InstallPath and Identifierprotected ServiceResource createServiceResource(java.lang.String type)
protected static java.lang.String getParentDir(java.lang.String path)
public static java.lang.String getParentDir(java.lang.String path, int levels)
protected static java.lang.String getCanonicalPath(java.lang.String installpath)
protected static net.hyperic.sigar.SigarProxy getSigar()
protected static java.lang.String[] getProcArgs(long pid)
pid
- Process identifier
protected static java.util.List getProcModules(long pid)
pid
- Process identifierprotected static java.lang.String getProcExe(long pid)
protected static java.lang.String getProcExe(long pid, java.lang.String name)
null
is returned.
pid
- Process identifiername
- Binary base name to match against
protected static java.lang.String getProcCwd(long pid)
null
is returned.
pid
- Process identifier
protected static long[] getPids(java.lang.String query)
query
- SIGAR Process Table Query
public boolean isWin32ServiceRunning(java.lang.String name)
name
- The Service name shown in the Windows service panel
Properties General tab, not the Display name. For example,
"Terminal Services" is the Display name, "TermService" is the
Service name that should be used here.
protected void setProductConfig(ServerResource server, ConfigResponse config)
protected void setMeasurementConfig(ServerResource server, ConfigResponse config)
protected void setControlConfig(ServerResource server, ConfigResponse config)
protected void setProductConfig(ServiceResource service, ConfigResponse config)
protected void setMeasurementConfig(ServiceResource service, ConfigResponse config)
protected void setControlConfig(ServiceResource service, ConfigResponse config)
public java.util.Map getServiceInventoryPlugins()
public java.util.List getServiceConfigs(java.lang.String type)
|
Hyperic HQ Plugin API v. 2.5.dev | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |