1 EM CLI Overview and Concepts

This chapter provides the following topic discussions:

  • EM CLI overview

  • Important EM CLI concepts, including verbs, modes, and available kits

  • High-level architecture

  • Brief explanation of the installation process

1.1 Overview

The Enterprise Manager Command Line Interface (EM CLI) enables users to access Enterprise Manager functionality through a command-line interface or scripts. It is accessible through classic programming language constructs, enabling tasks to be created and run either from the command-line or programatically. EM CLI enables you to access Enterprise Manager Cloud Control functionality from text-based consoles (shells and command-line windows) for a variety of operating systems.

EM CLI is fully integrated with Enterprise Manager's security and user administration functions, enabling you to carry out operations using EM CLI with the same security and confidentiality as the Enterprise Manager Cloud Control console. For example, you can only see and operate on targets for which you are authorized.

Examples of EM CLI tasks you can accomplish are as follows:

  • Create a new Enterprise Manager administrator account

  • Monitor and manage targets, jobs, groups, and blackouts

  • Enable batch/complex tasks on multiple Agents or targets

  • Integrate Enterprise Manager with third-party or custom software through scripts. Actions that are part of a customer's business model can be performed through scripts.

1.2 EM CLI Concepts

Verbs

A verb is a task or action in the form of a user command, which expose Enterprise Manager functionality. Some verbs can include one or more parameters, which are arguments to the user command. Some of the parameters are required, and some are optional.

For instance, in This example of the create_group verb syntax, only the -name parameter is required. The other parameters are optional.

emcli create_group
        -name="name"
        [-type=<group>]
        [-add_targets="name1:type1;name2:type2;..."]...
        [-is_propagating="true/false"

Modes

EM CLI offers Standard, Interactive, and Script modes.

  • Standard command-line mode

    This is the traditional and exclusive mode prior to Enterprise Manager Cloud Control version 12.1.0.3. This mode provides a simple command-line interface to Enterprise Manager, and supports the execution of one verb at a time from the command line.

    For example:

         emcli create_group -name=my_group -add_targets="mymachine.myco.com:host"
    
  • Interactive mode

    This mode enables you to create a single interactive session with the server (Oracle Management Services), where you can type in commands, view the output, and potentially respond to or manipulate the output. Interactive mode opens a Jython shell, where you can provide Jython scripts using EM CLI verbs as Jython functions. Jython is a Java implementation of the Python programming language.

    Note that when calling a verb in Interactive mode, the arguments are placed inside parentheses. For example:

         emcli> create_group(name=&rsquor;my_group'..)
    
  • Script mode

    Script mode is especially effective when performing tasks in bulk mode or many tasks at once. Scripts are useful for accomplishing several tasks, including:

    • Listing or setting global target properties

    • Listing or setting Agent properties

    • Updating database passwords

    • Listing group members

    This mode enables you to create Jython scripts, store them as files, and then pass these files to EM CLI as an argument, such as ...

         emcli @createuser.py
    

    ... where createuser.py is the name of a file containing the Python code to be sent to EM CLI.

    You can create reusable, functional modules using existing EM CLI verbs to generate complex tasks. This intuitive, object-oriented programming model supports encapsulation, loops, functions, exception and error handling, and so forth. These abilities enable you to benefit from all of the powerful features that the Jython programming language offers.

For usage information for the Interactive and Script modes, see Chapter 3, "Using EM CLI".

Installable EM CLI Kits

EM CLI provides two installable kits:

  • EM CLI Standard

    This kit supports the Standard mode only.

  • EM CLI with Scripting mode

    This kit supports all three modes, but only Interactive and Scripting modes enable you to provide Jython-based scripts.

1.3 EM CLI Architecture

Figure 1-1 shows the high-level architecture of EM CLI.

Figure 1-1 EM CLI Architecture

Shows EM CLI architecture and operational flow.

EM CLI implements client-server architecture, in which EM CLI is the client, and Oracle Management Services (OMS) is the server.

A typical verb may take zero or more arguments as input. The EM CLI client passes the input to OMS for processing. The EM CLI client connects to OMS and establishes a user session, which is used across verb executions until a logout is initiated.

1.4 EM CLI Installation

EM CLI consists of two components used to access the Enterprise Manager framework functionality:

  • EM CLI client

    The EM CLI client is a command-line program (Java-based) that sends EM CLI verbs to a specific Oracle Management Service (OMS). In some respects, the EM CLI client functions as a command-line equivalent of an Enterprise Manager Cloud Control console. You can download the EM CLI client on any system within your managed network.

  • EM CLI Oracle Management Services (OMS)

    The EM CLI OMS is automatically installed with the OMS and serves as the communication conduit between the EM CLI client and the OMS.

You can download the EM CLI client on any system within your managed network. The EM CLI client is a command-line program (Java-based) that sends EM CLI verbs to a specific Oracle Management Service (OMS). In some respects, the EM CLI client functions as a command-line equivalent of an Enterprise Manager Cloud Control console. The EM CLI OMS is automatically installed with the OMS and serves as the communication conduit between the EM CLI client and the OMS.

For instructions about setting up and running EM CLI, see Chapter 2, "Downloading and Deploying EM CLI".

Note:

EM CLI does not support JRockit JVM.