A omcli Command Options

omcli commands let you work with Oracle Management Cloud agents and entities or targets.

Accessing omcli

omcli comes bundled with a deployment of Oracle Management Cloud. You can access omcli from the <AGENT_BASE_DIR>/agent_inst/bin folder.

omcli Commands

Command Usage

register

omcli register agent [REGISTRATION_FILE]

Registers the Oracle Management Cloud agents with Oracle Management Cloud services.

REGISTRATION_FILE : (Optional); fully qualified path to a file that contains name/value pairs.

start

omcli start agent

Starts the Oracle Management Cloud agents on the host.

stop

omcli stop agent

Stops the Oracle Management Cloud agents running on the host.

status

omcli status agent

Retrieves the status of the Oracle Management Cloud agents running on the host.

getmetric

omcli getmetric agent TARGETNAME,TARGETTYPE,METRICNAME [-force]

Performs a real-time evaluation of the metric that is passed as a parameter, and displays the results for the specified metric.

-force : (Optional). If specified, the metric is evaluated even if the target is in blackout.

setproperty

omcli setproperty agent [-allow_new] -name PROPERTY_NAME -value PROPERTY_VALUE

Sets the specified property name and value in agent configuration file.

 -allow_new is an optional flag that inserts a new property in the agent configuration file if the property does not exist. -allow_new must be the first option to be provided to the command.

getproperty

omcli getproperty agent -name NAME_1 [... NAME_N] | -category NAME_1

Gets the specified properties or a category of properties from the agent configuration files.

-name accepts a list of property names separated by spaces. However, you can’t have spaces in the property names.

dumpstate

omcli dumpstate agent [-dump_full_state] [COMPONENTNAME ...]

Dumps the internal state of the specified list of components.

clear_property

omcli clear_property agent -name PROPERTY_NAME

Clears the value for the specified property in the agent configuration file.

status

omcli status agent [TIMEOUT]

Returns the status of the agent.

TIMEOUT is the timeout value in seconds.

reload

omcli reload agent [dynamicproperties [-upload_timeout TIMEOUT] TARGETNAME:TARGETTYPE ...]

Reloads the configuration properties of the agent.

dynamicproperties sends a request to the agent to recompute the dynamic properties for the specified targets.

-upload_timeout TIMEOUT: (Optional). If specified and if the value is greater than 0, the agent will attempt to upload the dynamic properties before the command returns control.

getversion

omcli getversion

Prints the version of the agent.

status agent scheduler

omcli status agent scheduler [-summary]

Displays the status of the agents scheduler.

config agent getTZ

omcli config agent getTZ

Gets the system time zone from the environment.

config agent listtargets

omcli config agent listtargets

 Lists the targets that have been registered with the agent.

add_entity

omcli add_entity agent FILENAME [-credential_file CREDENTIAL_FILE [-encryption_method_gpg]]

Adds the defined entity to Oracle Management Cloud.

  • FILENAME is the name of the file that contains the entity definition to be added.

  • CREDENTIAL_FILE is an optional parameter and is required only when you need to add the entity to Infrastructure Monitoring.

    A credentials file follows this format:

    {"credentials": 
    [
     {"id":"id1", "name":"credName1", "credType":"type1", 
       "properties":[{"name":"prop1", "value":"CLEAR[value1]"}, 
                   {"name":"prop2", "value":"FILE[/tmp/filename]"}]
     }]}
    
    This sample format includes:
    • A credential with an id (id1). This credential must match the credential reference in the entity definition and must be unique.

    • A name (CredName1), which can be any name that you specify to distinguish your credentials.

    • A credential type, from a predefined set of known types (for example, DBCreds for databases).

    • A property name (prop1) whose value (value1) is specified in clear text.

    • A property (prop2) whose value is the content of the file /tmp/filename.

  •  -encryption_method_gpg is an optional parameter. If provided, this option indicates that the file is encrypted using gpg symmetric encryption.

update_entity

omcli update_entity agent FILENAME

Updates an existing entity.

  • FILENAME is the name of the file that contains the entity definition to be added.

  • CREDENTIAL_FILE is an optional parameter and is required only when you need to add the entity to Infrastructure Monitoring.

    A credentials file follows this format:

    {"credentials": 
    [
     {"id":"id1", "name":"credName1", "credType":"type1", 
       "properties":[{"name":"prop1", "value":"CLEAR[value1]"}, 
                   {"name":"prop2", "value":"FILE[/tmp/filename]"}]
     }]}
    
    This sample format includes:
    • A credential with an id (id1). This credential must match the credential reference in the entity definition and must be unique.

    • A name (CredName1), which can be any name that you specify to distinguish your credentials.

    • A credential type, from a predefined set of known types (for example, DBCreds for databases).

    • A property name (prop1) whose value (value1) is specified in clear text.

    • A property (prop2) whose value is the content of the file /tmp/filename.

  •  -encryption_method_gpg is an optional parameter. If provided, this option indicates that the file is encrypted using gpg symmetric encryption.

delete_entity

omcli delete_entity agent FILENAME

Deletes an existing entity.

FILENAME is the name of the file that contains the entity definition to be deleted.

add_credential_store

omcli add_credential_store agent [ wallet-file ] [ -no_password ]

Configures the agent to use a wallet-based credential store. The wallet can be pre-existing. The wallet will be found in the location identified by wallet-file; if no wallet-file is specified, then the wallet is created in $EMSTATE/sysman/config/creds/. If -no_password is specified, then an SSO wallet (protected only by file permissions) will be created and used. If the -no_password token is omitted, then the user is prompted for a password to use in the wallet.

add_credentials

omcli add_credentials agent -credentials_file CREDENTIALS_FILE [ -encryption_method_gpg ] [ -allow_entityless ]

Add a file full of credentials to the agent. Credentials listed in CREDENTIALS_FILE are of the following form:

{ "entity":"lama.abc.example.com:1899",     
	"name":"lama.abc.example.com:1899-HostSSHPwdCreds",     
	"type":"HostSSHPwdCreds",     
	"globalName":"AgentUserCredential",     
	"description":"SSH Credential for the agent user",     
	"properties":[ { "name":"USERNAME", "value":"CLEAR[aime]" },                    
							{ "name":"PASSWORD", "value":"CLEAR[2cool]" } ] }

If -encryption_method_gpg is specified, then the credentials file is encrypted using symmetric gpg, and a passphrase may be needed. If -allow_entityless is specified, then the agent will not complain about credentials that are missing the entity field. However, a global name should be supplied if an entity is not.