Database Reference
In-Depth Information
File "<string>", line 41, in get_targets
emcli.exception.VerbExecutionError: Error: EM URL is not set.
Do set_client_property('EMCLI_OMS_URL', '<value>')
Or set it as environment variable.
Errors can be caused by myriad reasons. The EM CLI developers have done an excellent job of making the error
messages descriptive and useful. When you encounter errors, read the description thoroughly in order to understand
what issue caused it. When in doubt, search for the error in the documentation or on the Internet. Chances are,
someone else has already found and fixed the cause of the error.
Syntax
The EM CLI program can be used in three different modes. These are command-line mode, interactive mode, and
scripting mode. Up until version 12.1.0.2, there was only the command-line mode. The interactive and scripting
modes became available in version 12.1.0.3, along with an exposed programming interface that uses Jython.
The standard command-line mode hasn't changed much since Grid Control 10g. With few exceptions, scripts
used with previous versions of EM CLI will continue to work with the latest version or 12c. The command-line
syntax is the emcli command, followed by one verb, followed by zero or more verb options or parameters, as shown
in this example:
emcli create_group -name=my_group -add_targets="mymachine.example.com:hostname"
The interactive and scripting modes both use the Jython programming language. The interactive mode is a
single-user interactive session created by executing the emcli command without any parameters.
Standard Linux shell commands will not work in the interactive shell. The interactive mode of EM CLI can be
closed using the command exit() or by typing ctrl-d in Linux or ctrl-z in Windows.
Interactive mode syntax differs from that of the standard command-line mode. Once an interactive mode shell
has been established, it is no longer necessary to use the emcli command. Executing an EM CLI command is done
by putting a verb into the shell directly and enclosing the verb options within parentheses. The verb options are not
preceded by a dash like they are in command-line mode, but rather are preceded by a comma when followed by other
options. The following shows the create_group function in interactive mode with the name and add_targets options:
emcli> create_group(name=my_group, add_targets="mymachine.example.com:hostname")
Scripting mode uses the same command syntax as the interactive mode but does not require the Jython shell.
All of the EM CLI commands to be executed would be formatted like the interactive shell command above and put
into a script, along with any other Python code to be included. The script is executed non-interactively by following
the emcli command with an @ symbol and the name of the script:
[oracle ~]$ emcli @my_script.py
Setup
EM CLI is included in every OMS installation and is set up to connect to that OMS automatically. The setup
configuration can be confirmed with the setup verb. Running the command in command-line mode shows that
EM CLI is configured to connect to https://oem.example.com:7802/em with the SYSMAN user, as shown in Listing 3-5.
 
Search WWH ::




Custom Search