Red Hat Training

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

Commands and Options with the CLI

The JBoss Operations Network CLI is only one way to run scripts on the server, but it is a flexible and powerful way to create and execute scripts.
The JBoss ON CLI is essentially a script interpreter which processes JavaScript — either interactively or from a file — and executes it within the Java virtual machine. (The background concepts for the CLI are covered in more detail in Chapter 1, Understanding How Scripts Work with the JBoss ON Server and CLI.)
The JBoss ON CLI builds on the defined remote and domain API with its own internal commands, options, and methods which make writing scripts and managing resources easier. One of the biggest assets is the ability to create resource proxies, which are simplified (and therefore easier to use) resource objects.
This section focuses on the CLI options and basic usage tips. For scripting basics, see Short Examples.

1. Checking Compatible CLI and Server Versions

Like the agent and other JBoss ON components, the CLI utility has a version. The CLI utility must be the same version as the JBoss ON server to which it is trying to connect.
If the local JBoss ON CLI is not the same version as the JBoss ON server to which it is trying to connect, then the connection is refused.

Note

The CLI utility is not compatible with other versions of the JBoss ON server, neither newer nor older versions.
This behavior is configurable. There may be some instances where there is an external client or wrapper used with the JBoss ON CLI which does not (appear to) match the server version. To prevent the client connection from being rejected, add a Java option to disable the version checking property in the CLI configuration file.
[root@server ~]# vim cliRoot/rhq-remoting-cli-4.9.0.JON320GA/bin/rhq-cli-env.sh

RHQ_CLI_ADDITIONAL_JAVA_OPTS=-Drhq.client.version-check=false