Monday, July 27, 2015

Grid Control Target Maintenance: How To Recreate the Targets.xml File in Grid Control 10.2.x Using 'agentca' Commands

Grid Control Target Maintenance: How To Recreate the Targets.xml File in Grid Control 10.2.x Using 'agentca' Commands

The targets.xml file is used by the agent to store important details about each monitored target on the node.  Sometimes under certain conditions, the file may need to be regenerated either because of corruption or accidental deletion.  To recreate a 10.2.x targets.xml file, the agentca (Agent Configuration Assistant) can be called from commandline.
NOTE: The targets.xml file should be included in a system backup each time a configuration change is made to a target through the Grid Control Console (UI) or from the commandline using 'emctl' commands.

To recreate the targets.xml file  follow these steps:

    • Create a blank targets.xml file:
      • On Windows, create the new file in the Agent's %ORACLE_HOME%\sysman\emd\ directory.
        From Windows Explorer, click on File->New->Text File.  Save as 'targets.xml'
      • On Unix, issue the commands

        $ cd $ORACLE_HOME/sysman/emd   (where $ORACLE_HOME is the Agent's home)
        $ touch targets.xml.

    • Once you have created the targets.xml file, view the Agent's $ORACLE_HOME/sysman/config/emd.properties file.  Copy the values for:

...
agentSeed=12345678
...
EMD_URL=http://agentmachine.domain:9876/emd/main
...

    • Manually update the new targets.xml and add the following entries to the file following the syntax exactly:
<Targets AGENT_SEED="agentseed from emd.properties">
               <Target TYPE="oracle_emd" NAME="hostname and port from emd.properties EMD_URL"/>
               <Target TYPE="host" NAME="hostname as it appears in the emd_url"/>
</Targets>

      For example:

<Targets AGENT_SEED="12345678">
            <Target TYPE="oracle_emd" NAME="agentmachine.domain:9876"/>
            <Target TYPE="host" NAME="agentmachine.domain"/>
</Targets>

NOTE: The first time you start this agent after adding the above parameters, the AGENT_SEED parameter will convert itself to AGENT_TOKEN and the seed will become encrypted.


    • Force the target re-discovery using one of the below methods:

      • Run agentca -d to force a new discovery of the targets on the host

        cd <AGENT_HOME>/bin
        agentca -d
        For options that can be used with agentca (including those to be used on a RAC setup), refer to Note 868817.1: Grid Agent Configuration: How To Manually Execute the Agent Configuration Assistant utility (agentca)

      • Manually discover the target via the Grid Console. Refer to the steps in
        Note 417690.1: Grid Control Target Maintenance: How To Manually Discover a Target in the Grid Console?

No comments:

Post a Comment

  How to Change Instance Type & Security Group of EC2 in AWS By David Taylor Updated April 29, 2023 EC2 stands for Elastic Compute Cloud...