setup

Configures EM CLI to work with a specific management server.

You can set up the EM CLI client either in secure mode by specifying the -noautologin option, or unsecure mode by specifying the -autologin otpion. -noautologin is the default, so if you do not specify either option, the EM CLI client is automatically set up in secure mode.

The configuration directory will contain log files generated by EM CLI to record informational and error messages generated during operations.

Format

emcli setup
        -url="http[s]://host:port/em"
        -username=<EM_console_username]
        [-password=<password_of_user>]
        -dir=<local_emcli_config_directory>
        [-localdirans=yes|no]
        [-licans=yes|no]
        [-trustall]
        [-certans=yes|no]
        [-nocertvalidate]
        [-novalidate]
        [-autologin]
        [-noautologin]
        [-noregister]
        [-custom_attrib_file=<custom_attr_file_path>]

[ ]  indicates that the parameter is optional

Options

  • url

    URL of the Oracle Management Server (OMS). host specifies the host of the OMS. port specifies the listening port of the OMS. Both http and https protocols are supported. (https is recommended for security reasons).

  • username

    Enterprise Manager user name to be used by all subsequent EM CLI commands when contacting the OMS.

    If the SSO user is also an Enterprise Manager user (that is, authenticated in LDAP/OID), you can only register EM CLI with the ssousername. After you enable SSO for the OMS, you cannot subsequently register EM CLI with only username.

  • password

    Enterprise Manager user password. If you do not specify this option, you are prompted for the password interactively.

    Note:

    Providing a password on the command line is insecure and should be avoided.

  • dir

    Directory where an EM CLI configuration directory will be created. This directory must be on a locally mounted file system. A warning and confirmation is issued for an HTTPS URL if the directory is not heuristically identified as such (unless you specify trustall). The directory can be relative to the working directory where setup is called, or it can be absolute. This option defaults to the user's home directory.

  • localdirans

    Indicates whether the setup directory given with the -dir option is a local directory. Specify yes to indicate that the setup directory is local, and specify no to indicate that the setup directory is non-local.

  • licans

    Indicates whether the license is accepted or not accepted by the user. Specify yes to accept the license, or specify no to not accept the license.

  • trustall

    Automatically accepts any server certificate from the OMS, which results in lower security.

  • certans

    Indicates whether the certificate needs to be trusted without having to prompt the user. Specify yes to trust the certificate, and specify no to not trust the certificate.

  • nocertvalidate

    Does not validate the host name in the SSL certificate provided by the OMS.

  • novalidate

    Does not authenticate the Enterprise Manager user name or SSO user name against the OMS. Assume the given user name is valid. This enables the configuration to be stored (Enterprise Manager URL and user) without validating or connecting to Enterprise Manager. This might be useful in scenarios where Enterprise Manager is not up when you do run the setup command.

  • autologin

    In this mode, credentials are stored on the EM CLI client system. Autologin mode is preserved until emcli logout is executed. If the session has expired when a verb is executed, login is automatically performed and the verb is executed.

    Verbs executed after emcli logout may fail with the message "Error: Session expired. Run emcli login to establish a session." You need to run the login verb to log in to EM CLI after an emcli logout. After the Enterprise manager user's password has changed, you need to log in with the ID and the new password. The new password will subsequently be stored.

    Note that noautologin is the default mode.

  • noautologin

    In this default mode, credentials are not stored on the EM CLI client system. If the session has expired when a verb is executed, you have to explicitly run the login verb and then run the required verb.

  • noregister

    Does not register this EM CLI instance.

  • custom_attrib_file

    Path name of a file containing Audit Custom Attribute values. This option is required when the OMS is configured for Audit Custom Attributes. If you do not provide custom_attrib_file, you are prompted to enter the values of the custom attributes.

    The file can contain up to three lines, each containing the description of one custom attribute. Each line should be of the form:

    <attr-name>#<attr-displayname>#<isMandatory>#<attr-value>
    
    • # — Field separator.

    • attr-name — Name of the attribute.

    • attr-displayname — Display name of the attribute.

    • isMandatory — 1 if the attribute is mandatory, otherwise 0.

    • attr-value — Value of the custom attribute.

Examples

emcli setup -url=http://omsmachine.example.com:7770/em -username=sysman

To configure the EM CLI Client to function with multiple OMSes by implementing multiple setups, do the following:

  1. Set up the EM CLI client for OMS1 at location dir1:

    emcli setup -dir=<dir1> -url=<Url of OMS1> -user=<EM Username for OMS1>
    
  2. Set up the EM CLI client for OMS2 at location dir2:

    emcli setup -dir=<dir2> -url=<Url of OMS1> -user=<EM Username for OMS2>
    
  3. Set the environment variable EMCLI_STATE_DIR to point to the setup directory for OMS1:

    setenv EMCLI_STATE_DIR <dir1>
    

    This sets the EM CLI Client to function with OMS1.

  4. Set the environment variable EMCLI_STATE_DIR to point to the setup directory for OMS2:

    setenv EMCLI_STATE_DIR <dir2>
    

    This sets the EM CLI Client to function with OMS2.