add_target

Adds a target to be monitored by Enterprise Manager. The target type specified is checked on the Management Agent for existence and for required properties, such as user name and password for host target types, or log-in credentials for database target types. You must specify any required properties of a target type when adding a new target of this type.

For oracle_database target types, you must specify Role with the monitoring credentials. If the Role is not Normal, then Role must be SYSDBA, and UserName can be any user with SYSDBA privileges.

Note:

You cannot use this verb for composite targets. The verb does not support adding an association between a parent target such as IAS and a child target such as OC4J. t db instance targets,You must use the instances option to specify DB instances before adding the cluster database.

Standard Mode

emcli add_target
      -name="name"
      -type="type"
      [-host="hostname"]
      [-properties="pname1:pval1;pname2:pval2;..."]
      [-separator=properties="sep_string"]
      [-subseparator=properties="subsep_string"]
      [-credentials="userpropname:username;pwdpropname:password;..."]
      [-input_file="parameter_tag:file_path"]
      [-display_name="display_name"]
      [-groups="groupname1:grouptype1;groupname2:grouptype2;..."]
      [-timezone_region="gmt_offset"]
      [-monitor_mode="monitor_mode"]
      [-instances="rac_database_instance_target_name1:target_type1;..."]
      [-monitoring_cred="HostCredsPriv;host;HostCreds;HostUserName;foo;..."]      [-access_point_name="ap_name"]      [-access_point_type="ap_type"]

[ ]  indicates that the parameter is optional

Options

  • name

    Target name. Names cannot contain colons ( : ), semi-colons ( ; ), or any leading or trailing blanks.

  • type

    Target type. Standard target types include: host, oracle_database, oracle_apache, oracle_listener, and oracle_emd. To see all available target types available for your environment, check the $AGENT_HOME/sysman/admin/metadata directory. A metadata file (XML) exists for each target type.

  • host

    Network name of the system running the Management Agent that is collecting data for this target instance.

  • properties

    Name-value pair (that is, prop_name:prop_value) list of properties for the target instance. The "name"(s) are identified in the target-type metadata definition. They must appear exactly as they are defined in this file. Metadata files are located in $AGENT_HOME/sysman/admin/metadata.

    Note:

    This verb does not support setting global target properties. It is recommended that you use set_target_property_values to set target properties.

  • separator=properties

    Specify a string delimiter to use between name-value pairs for the value of the -properties. The default separator delimiter is ";".

    For more information about the separator option, see -input_file Syntax Guidelines.

  • subseparator=properties

    Specifies a string delimiter to use between the name and value in each name-value pair for the value of the -properties option. The default subseparator delimiter is ":".

    For more information about the subsepator option, see -input_file Syntax Guidelines.

  • credentials

    Monitoring credentials (name-value pairs) for the target instance. The "name"(s) are identified in the target-type metadata definition as credential properties. The credentials must be specified exactly as they are defined in the target's metadata file. Metadata files are located in $AGENT_HOME/sysman/admin/metadata.

  • input_file

    Used in conjunction with the -credentials option, this enables you to store specific target monitoring credential values, such as passwords, in a separate file. The -input_file specifies a mapping between a tag and a local file path. The tag is specified in lieu of specific monitoring credentials of the -credentials option. The tag must not contain colons ( : ) or semi-colons ( ; ).

    For more information about the input_file option, see -input_file Syntax Guidelines.

  • display_name

    Target name displayed in the Enterprise Manager Cloud Control console.

  • groups

    Name-value pair list of the groups to which this target instance belongs. Follows the format of groupname:grouptype;groupname2:grouptype2.

  • timezone_region

    GMT offset for this target instance. (-7 or -04:00 are acceptable formats.)

  • monitor_mode

    Either 0, 1, or 2. The default is 0. 1 specifies OMS mediated monitoring, and 2 specifies Agent mediated monitoring.

  • instances

    Name-value pair list of RAC database instances that the RAC database target has. Database instance targets must be added before trying to add the cluster database.

  • force

    Forces the target to be added even if the target with the same name exists. Updates the properties of the target with your latest input.

  • timeout

    Time in seconds for the command to wait to add the target to the Agent. The default is 10 minutes.

  • monitoring_cred

    Sets a monitoring credential set for this target.

  • Separator=monitoring_cred

    Specify a string delimiter to use between name-value pairs for the value of the -monitoring_cred option. The default separator delimiter is ";".

  • Server Discovery

    Use the following syntax for server discovery:
    emcli add_target
         -name=${TARGET_NAME} 
         -type=oracle_si_server_map  
         -host=${AGENT_HOST} 
         -access_point_name=${TARGET_NAME_AP} 
         -access_point_type='oracle_si_server_ilom'  
         -properties='dispatch.url=ilom-ssh://${TARGET_IP}:22'
         -subseparator=properties='=' 
         -monitoring_cred='ilom_creds_set;oracle_si_server_ilom;ilom_
             creds;username:${USERNAME};password:${PASSWORD}' 
         -monitoring_cred='ssh_creds_set;oracle_si_server_ilom;ssh_
             creds;username:${USERNAME};userpass:${PASSWORD}'
    
  • subseparator=monitoring_cred

    Specify a string delimiter to use between name and value in each name-value pair for the value of the -monitoring_cred option. The default subseparator delimiter is ":".

  • access_point_name

    Name of the access point target to be added which is tagged to given server target.

  • access_point_type

    Type of the access point target to be added which is tagged to given server target.

Example

Example 1

The following example adds an oracle_database target with the name "database." Note how the credentials are specified. The names in the name-value pairs come from the oracle_database metadata file. They must appear exactly as they are named in that file. This also applies for the property names. The example uses the base minimum of required credentials and properties for the database target.

emcli add_target
      -name="database"
      -type="oracle_database"
      -host="myhost.us.example.com"
      -credentials="UserName:dbsnmp;password:password;Role:Normal"
      -properties="SID:semcli;Port:15091;OracleHome:/oracle;
       MachineName:smpamp-example.com"
      -groups="Group1:group;Group2:group"

Example 2

The following example adds a standalone Oracle HTTP Server.

emcli add_target 
      -host=test.mycompany.com 
      -name=test13c 
      -type=oracle_apache    
      -properties=
"OracleHome->/scratch/smariswa/test13c|ConfigPath->/scratch/user1/test13c/user_projects/domains/test1213_domain/config/fmwconfig/components/OHS/ohs1|EMTargetType->oracle_apache|OracleInstance->na|compVersion->na|LifeCycleMBeanName->na|OPMNMBeanName->na| monMode->na|ProxyMBeanObjectName->na|ServerNames->na|CanonicalPath-> /instance1/ohs1/|HTTPMachine->blr2201947.mycompany..com|HTTPPort->7778|version->13.1|NMUser->weblogic|NMPwd->password" -separator=properties="|" -subseparator=properties="->"

Example 3

The following example adds an oracle_database target with the name "database". Note how the credentials are specified. The names in the name-value pairs come from the oracle_database metadata file. They must appear exactly as they are named in that file. This also applies for the property names. The example uses the base minimum of required credentials and properties for the database target.

emcli add_target
      -name="database"
      -type="oracle_database"
      -host="myhost.us.example.com"
      -credentials="UserName:dbsnmp;password:password;Role:Normal"
      -properties="SID:semcli;Port:15091;OracleHome:/oracle;
       MachineName:smpamp-example.com"
      -groups="Group1:group;Group2:group"

Example 4

The following example discovers the server ILOM_SPARC at the target IP 10.133.245.231 using the user root and the password admin123.

emcli add_target
      -name=ILOM_SPARC 
      -type=oracle_si_server_map  
      -host=`hostname`.mycompany.com 
      -access_point_name='ILOM_SPARC_AP' 
      -access_point_type='oracle_si_server_ilom'  
      -properties='dispatch.url=ilom-ssh://10.133.245.231:22' 
      -subseparator=properties='=' 
      -monitoring_cred='ilom_creds_set;oracle_si_server_ilom;ilom_
          creds;username:root;password:password'
     -monitoring_cred='ssh_creds_set;oracle_si_server_ilom;ssh_
          creds;username:root;userpass:user_password'

Example 5

The following example adds an Apache Tomcat version 8 target with the name "TARGET_NAME."

emcli add_target 
		-name="TARGET_NAME" 
		-type="tomcat" 
		-host="XYZ.oracle.com"
		-properties="Host:XYZ.oracle.com;JMXPort:65432;JMXProtocol:rmi;JMXService:jmxrmi;
			VersionCategory:8;SSLTrustStore:AGENT_HOME/agent_inst/sysman/config/montrus t/AgentTrust.jks"
		-credentials="JMXUserName:adminUser1;JMXPassword:password1;SSLTrustStorePassword:welcome" 

Example 6

The following example adds an oracle_pdb target with the name "MyPDB". Note the syntax used for the AgentPreferredConnectString property. For more information, see Agent Preferred Connect String.

emcli add_target
      -name="MyPDB"
      -type="oracle_pdb"
      -host="myhost.us.example.com"
      -credentials="UserName:dbsnmp;password:password;Role:Normal"
      -properties="SID:semcli;Port:15091;OracleHome:/oracle;
       MachineName:smpamp-example.com;AgentPreferredConnectString: (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = tcp)(HOST
      = myScanListenerHost)(PORT = 1509)))(CONNECT_DATA = (SERVICE_NAME = <custom service for the
      PDB>)))"
      -groups="Group1:group;Group2:group"