public interface AgentManagementMBean
| Modifier and Type | Field and Description |
|---|---|
static ObjectName |
BASE_OBJECT_NAME
This is the object name that the agent will register as.
|
static String |
JMX_DOMAIN
The domain name where this MBean will be placed.
|
static String |
KEY_NAME
All agent management MBeans will have this as a key property whose property value will be the agent name.
|
static String |
PLUGIN_INFO_DISPLAY_NAME
Identifies the display name of a plugin.
|
static String |
PLUGIN_INFO_ENABLED
Identifies whether the plugin is currently being used by the agent
|
static String |
PLUGIN_INFO_MD5
Identifies the MD5 of a plugin.
|
static String |
PLUGIN_INFO_NAME
Identifies the name of a plugin.
|
static String |
PLUGIN_INFO_PATH
Identifies the full path to a plugin.
|
static String |
PLUGIN_INFO_SIZE
Identifies the filesize of a plugin.
|
static String |
PLUGIN_INFO_TIMESTAMP
Identifies the last modified date of a plugin.
|
| Modifier and Type | Method and Description |
|---|---|
void |
downloadLatestFailoverList()
Tells the agent to download an updated server failover list.
|
OperationResult |
executeAvailabilityScan(Boolean changesOnly)
Asks the agent's plugin container to execute an availability scan and returns the results.
|
String |
executePromptCommand(String command)
Executes an agent prompt command.
|
Properties |
getAgentConfiguration()
Returns the entire set of agent configuration preferences.
|
String |
getAgentHomeDirectory()
Returns the directory that is considered the "agent home" (i.e.
|
long |
getAgentServerClockDifference()
Returns the number of milliseconds this agent thinks its clock is ahead or behind from
its server's clock.
|
long |
getAverageExecutionTimeReceived() |
long |
getAverageExecutionTimeSent() |
long |
getCurrentTime()
Returns the current time, as it is known to the agent.
|
int |
getJVMActiveThreads()
Returns the number of currently active threads in the agent's JVM.
|
long |
getJVMFreeMemory()
Returns the agent JVM's free memory as reported by
Runtime.getRuntime().freeMemory(). |
long |
getJVMTotalMemory()
Returns the agent JVM's total memory as reported by
Runtime.getRuntime().totalMemory(). |
int |
getNumberAgentRestarts()
Returns the number of times the agent has been restarted for the entire lifetime of
the agent's JVM.
|
long |
getNumberCommandsActiveSent() |
long |
getNumberCommandsInQueue() |
long |
getNumberCommandsSpooled() |
long |
getNumberFailedCommandsReceived() |
long |
getNumberFailedCommandsSent() |
long |
getNumberSuccessfulCommandsReceived() |
long |
getNumberSuccessfulCommandsSent() |
long |
getNumberTotalCommandsReceived() |
long |
getNumberTotalCommandsSent()
Combines the number of successful and failed commands sent.
|
String |
getReasonForLastRestart()
Returns the code that indicates why the agent was last restarted.
|
long |
getUptime()
Returns the number of seconds the agent has been started - this resets everytime the agent is shutdown.
|
String |
getVersion()
Returns the agent's version string.
|
boolean |
isSending() |
void |
mergeIntoAgentConfiguration(Properties config)
The given set of agent configuration preferences (in the form of name/value pairs in a Properties object) is
added to the current set of agent configuration preferences.
|
void |
removeFromAgentConfiguration(List<String> preferenceNames)
Given the names of preferences, this will remove those preference settings from the agent configuration.
|
void |
restart()
This will perform an agent hot-restart.
|
void |
restartPluginContainer()
This will shutdown then immediately restart the agent's internal plugin container.
|
OperationResult |
retrieveAllPluginInfo()
Returns information on all currently deployed plugins.
|
String |
retrieveCurrentDateTime(String timeZone)
Returns a string of the agent's current date/time, formatted with the given time zone.
|
OperationResult |
retrievePluginInfo(String pluginName)
Returns information on the given plugin.
|
void |
setDebugMode(Boolean enabled,
Boolean traceMessaging)
Turns on or off debug mode, which makes the agent log more verbose with debug messages.
|
void |
shutdown()
This will shutdown the agent's communications layer and the plugin container.
|
void |
switchToServer(String server) |
void |
updatePlugins()
This will tell the agent to update its plugins.
|
static final String JMX_DOMAIN
static final String KEY_NAME
static final ObjectName BASE_OBJECT_NAME
KEY_NAME will be added to make it unique in the case when you embedded agents in the same VM.static final String PLUGIN_INFO_NAME
static final String PLUGIN_INFO_DISPLAY_NAME
static final String PLUGIN_INFO_PATH
static final String PLUGIN_INFO_TIMESTAMP
static final String PLUGIN_INFO_SIZE
static final String PLUGIN_INFO_ENABLED
static final String PLUGIN_INFO_MD5
void switchToServer(String server)
void restart()
shutdown() and then immediately started
again. This is usually called after a client has
changed some configuration settings.
The actual restart is performed asynchronously. The caller has just a few seconds after this method returns before it takes effect.
void shutdown()
The actual shutdown is performed asynchronously. The caller has just a few seconds after this method returns before it takes effect.
void downloadLatestFailoverList()
void updatePlugins()
After the plugins are updated, the plugin container will immediately be
restarted.
The actual PC restart is performed asynchronously. The caller has just a few seconds after this method returns before it takes effect.
OperationResult retrieveAllPluginInfo()
PropertyMap for
each plugin. The name of the map will be the plugin name. Each map will have the key/value pairs where the keys
are PLUGIN_INFO_xxx.OperationResult retrievePluginInfo(String pluginName)
simple properties
where the names are defined by PLUGIN_INFO_xxx.pluginName - the plugin whose information is to be returnedvoid restartPluginContainer()
updated the plugins. Restarting the plugin container forces it to load in newly updated
plugins.
The actual restart is performed asynchronously. The caller has just a few seconds after this method returns before it takes effect.
updatePlugins()OperationResult executeAvailabilityScan(Boolean changesOnly)
DiscoveryAgentService.executeAvailabilityScanImmediately(boolean) for the semantics of this call.changesOnly - if true, only report those availabilities that have changedOperationResult objectString getVersion()
long getCurrentTime()
System.currentTimeMillis.String retrieveCurrentDateTime(String timeZone)
timeZonecan be either an abbreviation such as "PST", a full name such as
"America/Los_Angeles", or a custom ID such as "GMT-8:00". Note that the support of abbreviations is
for JDK 1.1.x compatibility only and full names should be used.timeZone - the time zone to display the date/time inTimeZone.getTimeZone(String)void setDebugMode(Boolean enabled, Boolean traceMessaging) throws ExecutionException
enabled flag is false, traceMessaging is ignored (i.e. all debug
will be disabled, including message tracing).enabled - enable debug modetraceMessaging - if true, message tracing will be enabled unless enabled is falseExecutionException - if failed to change the debug modeString executePromptCommand(String command) throws ExecutionException
command is the prompt command
plus any additional command arguments, separated by spaces (just as if you typed the command
in the console window). The results will be a string that contains the text that you would
have seen in the console output had the prompt command been executed from the console.command - the command to execute along with any command line arguments.ExecutionException - if the prompt command threw an exception, this method will throw an exception
whose message is the output text that was written by the prompt command up until the error
occurred. The cause of the thrown exception will be the actual exception thrown by
the prompt command. This way you can see what the prompt command output was as well as
the exception that occurred.String getAgentHomeDirectory()
int getNumberAgentRestarts()
getReasonForLastRestart().String getReasonForLastRestart()
long getAgentServerClockDifference()
long getUptime()
long getNumberSuccessfulCommandsReceived()
long getNumberFailedCommandsReceived()
long getNumberTotalCommandsReceived()
long getAverageExecutionTimeReceived()
ServiceContainerMetricsMBean#getAverageExecutionTime()long getAverageExecutionTimeSent()
long getNumberSuccessfulCommandsSent()
long getNumberFailedCommandsSent()
long getNumberTotalCommandsSent()
long getNumberCommandsActiveSent()
long getNumberCommandsInQueue()
long getNumberCommandsSpooled()
boolean isSending()
long getJVMFreeMemory()
Runtime.getRuntime().freeMemory().long getJVMTotalMemory()
Runtime.getRuntime().totalMemory().int getJVMActiveThreads()
Properties getAgentConfiguration()
void mergeIntoAgentConfiguration(Properties config)
config that
already exist in the current agent configuration will override the old values in the current agent configuration.
Those preferences found in config but do not exist yet in the current agent configuration are
added to the agent configuration. If a preference exists in the current configuration but is not found in
config, then that preference is left as-is.
Changing the agent configuration usually requires the agent to be restarted in order for the new settings to be picked up.
config - new agent configuration preferencesvoid removeFromAgentConfiguration(List<String> preferenceNames)
preferenceNames - the preferences to remove from the agent configurationCopyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.