Database Reference
In-Depth Information
there is also an emCtl interface that controls and communicates directly with the oms and it has a com-
pletely different set of commands.
Note
The emctl command located in <AGENT_BASE>/agent_inst/bin is a shell or batch script that sets environment
variables and executes the <AGENT_HOME>/bin/emctl command with the parameters fed to the first command.
The <AGENT_HOME>/bin/emctl is also a shell or batch script that sets environment variables as well as sources a number
of other files. It then executes a perl script with the parameters fed to the first command. This perl script sources a number
of other perl scripts and either reads existing state files or interacts directly with the java agent process for a result.
Because EMCTL interacts directly with the java agent process, it is not considered a client. This also means that
the agent cannot be remotely controlled using EMCTL.
EMCTL versus EM CLI
When to use EMCTL versus EM CLI is largely based on preference and environment limitations. For example, both
commands can control blackouts in Enterprise Manager. In one environment, there may be a limitation on installing
the EM CLI remotely or locally because of the Java version it requires or the port access it needs, making EMCTL the
better option. In another environment, there may be a restriction on shell access on an agent server, making EM CLI
the better option. Understanding the architecture differences between EMCTL and EM CLI will help with the decision
of using one versus the other in different circumstances.
The syntax of EM CLI is relatively straightforward; emcli followed by a verb, followed by mandatory and optional
parameters. The syntax of EMCTL is not as easy to understand and does not follow a strict format.
For most commands the format is as follows: emctl followed by a verb, followed by agent . For some configuration
commands the format is: emctl followed by config agent , followed by a verb such as listtargets or secure .
Generally, the easiest way to figure out the syntax of the EMCTL command you want to execute is to look up the
documentation online or to print out the help text by executing the emctl command without any arguments. The help
text will print to the screen.
This help text can be made searchable by redirecting it to a file that can be opened and searched or by piping the
output to a searchable line reader such as less :
emctl > help.txt; vim help.txt
emctl | less
Now that we've reviewed a number of important concepts and definitions, let's look at some real-world examples
that can be used to accomplish many of the most common tasks for which one might use EM CLI.
The first task, Login, is one that must be done for each session of EM CLI, regardless of which mode is used. The
other tasks are examples of using EM CLI when the GUI is not a suitable option, such as within scheduled scripts or
when working with large numbers of targets.
Task: Establish a Login
There is little useful functionality of EM CLI without having a connection to an OMS. Creating that connection is
usually the first step of using the interface. How to establish a connection depends on the mode being used.
When using command-line mode, a login will not need to be established if the -autologin parameter was
specified during setup, since this parameter indicates that the credentials used during the install of EM CLI are stored
in the installation files and are used for every command automatically. A login is established using the login verb. The
login verb must be followed by the -username parameter and can optionally be followed by the -password parameter.
 
 
Search WWH ::




Custom Search