此内容没有您所选择的语言版本。

Chapter 5. The JBoss ON CLI Command Syntax


The JBoss ON CLI is a shell and interpreter so that commands and statements can be executed interactively against the JBoss ON server. Scripts stored in files can also be executed, so it is possible to automate operations for the JBoss ON server.

5.1. The CLI Script

The CLI script is run directly from its cli-install-dir/bin directory. There are two files associated with launching the JBoss ON CLI:
  • A script (rhq-cli.sh|bat)
  • A file of environment variables (rhq-cli-env.sh|bat)
    The environment variables in the rhq-cli-env.sh|bat file use defaults that are reasonable for most deployments, so this file usually does not need to be edited. It is possible to reset variables to point a server that doesn't follow the default installation, such as a virtual machine or a non-default JVM. The comments at the top of the rhq-cli-env.|bat file contain a detailed list of available environment variables.
    IMPORTANT
    Do not edit the rhq-cli.sh|bat file. Only set environment variables through the terminal or in the rhq-cli-env.sh|bat file, not the script itself.
NOTE
Be sure to set the correct path to the Java 6 installation in the RHQ_CLI_JAVA_HOME or the RHQ_CLI_JAVA_EXE_FILE_PATH variable.
The rhq-cli.sh|bat script has the following general syntax:
rhq-cli.sh|bat options
It is possible to launch the CLI script without any arguments, including specifying a username. This opens the CLI client without connecting to the server.
[jsmith@server bin]$ cliRoot/rhq-remoting-cli-4.9.0.JON320GA/bin/rhq-cli.sh
RHQ - RHQ Enterprise Remote CLI 
unconnected$
While scripts can be executed without logging in, most of the functionality of the CLI is unavailable. To truly use the JBoss ON CLI, log into the server as a JBoss ON user, either by passing a username and password or by using the login command after starting the CLI.
[jsmith@server bin]$ rhq-cli -u rhqadmin -p rhqadmin
The CLI provides two modes of operation: interactive and non-interactive.
Interactive mode executes an individual statement. Interactive mode provides a simple environment for prototyping, testing, learning, and discovering features of the CLI.
Non-interactive mode loads a specified script file and executes multiple commands in sequence. Non-interactive mode provides the capability to automate tasks such as collecting metrics on managed resources or executing a scheduled operation.
IMPORTANT
These native commands, like quit, are available only in interactive mode. They cannot be used in a script when the CLI is used in non-interactive mode, such as when running a script from file. In these instances, use the Java method.
After logging in, any commands (covered in Section 5.3, “Interactive CLI Commands”) can be passed to the server.
IMPORTANT
Whatever user you run the CLI as — meaning, whatever system user runs the rhq-cli.sh script — must have write access to the logs/ directory for the CLI.
If the CLI is installed as root, for example, then a regular user cannot run the CLI; it fails with write errors.
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部