Red Hat Training

A Red Hat training course is available for Red Hat JBoss Operations Network

7.3. Working with the Agent Command Prompt

When the agent is started in a terminal, then (along with starting the agent process) the script starts the agent command prompt. The agent prompt can be used to managed the agent by checking configuration, executing some tasks, or editing the agent setup.

7.3.1. Opening the Agent Command Prompt

The agent command prompt opens when the agent start script is run.

7.3.2. Agent Start Options

Some agent management can be performed by passing options with the start script; these mainly relate to passing persistent configuration options to the server by loading external preferences through input files or passed parameters. These options are listed in Table 7.1, “Options for the Script”.

Table 7.1. Options for the Script

Short Argument Long Argument Description
-a --advanced Runs the agent script in setup mode, rather than basic start mode.
-c --config=filename Specifies an agent configuration preferences file on filesystem or classpath.
-d --daemon Runs the agent in daemon mode, which means it will not read additional commands from stdin.
-Dname[=value]   Overrides an agent configuration preference and sets a system property.
-e --console=type Specifies the implementation to use when reading console input. The three available values are jline, sigar, and java.
-g --purgeplugins Deletes all plug-ins, forcing the agent to re-download all of them
-h --help Opens the help message.
-i --input=filename Specifies a script file to use for input.
-l --cleanconfig Clears out any existing configuration and data files so the agent starts with blank configuration, with the exception of the agent security token, which is preserved.
-L --fullcleanconfig Clears out any existing configuration and data files so the agent starts with a totally clean slate, including purging the security token.
-n --nostart Runs the agent script without starting the agent process.
-o --output=filename Specifies a file to write all output from the script, excluding log messages (which are always written to the agent logs).
-p --pref=preferences_name Specifies the Java preference node to use for the agent configuration.
-s --setup Forces the agent to ask setup questions.
-t --nonative Forces the agent to disable the native system.
-u --purgedata Purges persistent inventory and other data files.
--   Stops the agent from processing options.

7.3.3. Agent Prompt Commands

The agent processes prompt commands that are passed to it, either interactively through the agent prompt or from an input file that can be passed when the start script is launched. Agent prompt commands (listed in Table 7.2, “Agent Prompt Commands”) can be used to manage resource (by checking availability, running discovery, or checking monitoring information) or to manage the agent itself (such as registering with a server, loading plug-ins, or viewing or reloading configuration settings).

Table 7.2. Agent Prompt Commands

Prompt Command Description
Provides availability of inventoried resources.
Manages the agent configuration.
Provides features to help debug the agent.
Asks a plug-in to run a server scan discovery.
Downloads a file from the JBoss ON server.
Shows the entries found in the command spool file.
Shuts down the agent's communications services and kills the agent.
Shows or updates the high availability server failover list.
Helps free up memory by invoking the garbage collector.
Displays one, several or all agent configuration preferences.
Shows help for a given command.
Asks to identify a remote server.
Provides information about the current inventory of resources.
Configures some settings for the log messages.
Shows the agent metrics.
Accesses native system information.
Starts and stops the plug-in container and all deployed plug-ins.
Pings the JBoss ON server.
Executes a PIQL query to search for running processes.
Updates the agent plug-ins with the latest versions from the server.
Exits the agent prompt (without stopping the agent).
Registers this agent with the JBoss ON server.
Retrieves measurement schedule information for the specified resource.
Controls the command sender to start or stop sending commands.
Sets an agent configuration preference.
Sets up the agent configuration by asking a series of questions.
Shuts down all communications services without killing the agent.
Puts the agent prompt to sleep for a given amount of seconds.
Starts the agent comm services so it can accept remote requests.
Times how long it takes to execute another prompt command.
Provides agent update functionality.
Shows the agent version information.