relocate_targets

Moves all of the collections and blackouts for targets from the source Agent to the destination Agent, and makes the destination Agent the monitoring Agent for these targets in Enterprise Manager.

Format

emcli relocate_targets 
       -src_agent=<source_agent_target_name>
       -dest_agent=<dest_agent_target_name>
       -target_name=<name_of_target_to_be_relocated>
       -target_type=<type_of_target_to_be_relocated>
       -copy_from_src
       -changed_param=<propName>:<propValue>
       -input_file:dupTargets=<targets_contents>
       -input_file:moveTargets="complete path to file containing targets with 
         overridden property values" 
       -copy_from_src [-changed_param=<propName>:<propValue>]*
       [-ignoreRelatedTargets]
       [-noHostColumnUpdate]
       [-ignoreTimeSkew=yes]
       [-changed_param=MachineName:mmmm ]
       [-force=yes]

[ ]  indicates that the parameter is optional

Note:

To relocate a composite target, you must specify the input_file:dupTargets , and you cannot combine -target_type or -target_name.

Note:

For non-Sysman users, Full Any Target and Add Any Target privileges should be granted.

Modes

There are two modes for this verb:

  • Create Mode

    This mode creates a list of targets on the destination Management Agent that already exists and is monitored by the source Management Agent in Enterprise Manager. It moves all the collections and blackouts for these targets from the source Management Agent to the destination Management Agent, and makes the destination Agent the monitoring Agent for these targets in Enterprise Manager.

    emcli relocate_targets -src_agent=<source_agent>
          -dest_agent=<destination_agent>
          -input_file=dupTarget:<complete_path_to_file>;
          [-ignoreTimeSkew=yes]
    
  • Exist Mode

    In this mode, the target also exists at the destination.

    emcli relocate_targets
          -src_agent=<source_agent_target_name>
          -dest_agent=<destination_agent_target_name>
          -target_name=<target_name>
          -target_type=<target_type>
          [-ignoreTimeSkew=yes]
          [-force=yes]

In all cases, relocation moves all collections and blackouts for these targets from the source Agent to destination Agent, and makes the destination Agent the monitoring Agent for these targets in Enterprise Manager.

Options

  • src_agent

    Management Agent currently monitoring the targets. If srcAgent is not known, enter currentOwner as the argument.

  • dest_agent

    Management Agent that should monitor the targets.

  • target_name

    Name of the target that needs to be moved.

  • target_type

    Type of target that needs to be moved.

  • changed_param

    The value of the propName property in the target should be changed to propValue.

  • input_file=dupTargets

    Takes a file name that contains all the targets and its properties as seen in targets.xml. The contents of the file must have the same format as targets.xml.

    To relocate a composite target, you must specify the input_file:dupTargets, and you cannot combine -target_type or -target_name.

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

  • input_file=moveTargets

    Takes a file name that contains a list of targets, one per line, in the following format:

    <targetType>:<targetName>[;<propName>=<propValue>]*
    ;lkj;lkj;lkj
    

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

  • copy_from_src

    Copies target properties from the source Agent.

  • ignoreTimeSkew

    If specified, the target is relocated, ignoring the time skew between the source and destination Agent.

  • ignoreRelatedTargets

    Moves related targets when not specified. Specified to move onlhy the targets on the command line.

  • noHostColumnUpdate

    Preserves the host of the relocated tartet when specified. Otherwise, the host is updated to be the new Agent's host.

  • changed_param

    Specify the new MachineName as part of relocate operation, as it is different for each host.

  • force

    If the command is executed with the -force=yes switch, the composite target is automatically relocated with its related targets. If the command is executed without this switch, an error message appears if it is a composite target.

Output

Output message of the command execution.

Examples

Example 1

The following Create Mode example creates a target on the destination Agent by copying the target property content from the source Agent, while allowing some property values to be changed.

emcli relocate_targets 
      -src_agent=<source_agent>
      -dest_agent=<destination_agent>
      -target_name=<target_name>
      -target_type=<target_type>
      -copy_from_src
      [-ignoreTimeSkew=yes]
      [-changed_param=<Propname>:<Value>]*

Example 2

The following Create Mode example creates a list of targets on the destination Agent specified in the moveTargets file. You can specify property value overrides.

emcli relocate_targets 
      -src_agent=<source_agent>
      -dest_agent=<destination_agent>
      -input_file=moveTargets:<complete_file_path>
      [-ignoreTimeSkew=yes]