3 Replies Latest reply: Jul 27, 2012 3:46 AM by user764012 RSS

    How to add targets manually, in OEM 12C, through command line...

    CSM.DBA
      Hi,

      I've installed OEM recently and installed agents in all the needed machines. (RHEL6, OEM 12C)

      I don't see my Databases and Listeners in OEM console.

      I'm able to add them manually through console but my requirement is to automate that process.

      Could you please tell me any commands/instructions through which I can do that.

      btw emctl config agent addinternaltargets is not making any difference.

      Thanks in advance.

      CSM
        • 1. Re: How to add targets manually, in OEM 12C, through command line...
          Akanksha Sheoran Kaler
          By default, the Add Host Targets Wizard configures only the following types of plug-ins:
          ◦All discovery plug-ins that were configured with the OMS from where the Management Agent software is being deployed.
          ◦Oracle Home discovery plug-in
          ◦Oracle Home monitoring plug-in

          By default, the host and the Management Agent get automatically added to the Enterprise Manager Cloud Control console for monitoring. None of the targets running on that host get automatically discovered and monitored. To monitor the other targets, you need to add them to Enterprise Manager Cloud Control either using the Auto Discovery Results page, the Add Targets Manually page, or the discovery wizards offered for the targets you want to monitor.

          For information about discovering targets in Enterprise Manager Cloud Control, refer to the chapter on adding targets in the Oracle Enterprise Manager Cloud Control Administrator's Guide.
          http://docs.oracle.com/cd/E24628_01/doc.121/e24473/toc.htm
          • 2. Re: How to add targets manually, in OEM 12C, through command line...
            SudipDatta
            "emcli add target" can be used to save target from command line
            • 3. Re: How to add targets manually, in OEM 12C, through command line...
              user764012
              You can also add a target instance using the EM CLI utility. Open a command prompt and run the following command:

              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;..."
              ]
              For example:

              emcli add_target
              -name="cluster_database"
              -type="rac_database"
              -host="myhost.us.example.com"
              -monitor_mode="1"
              -properties="ServiceName:service.us.example.com;ClusterName:newdb_cluster"
              -instances="database_inst1:oracle_database;database_inst2:oracle_database"
              Use the emcli help add_target help command to see more options when adding the target instance.