Tuesday, July 12, 2011

Securing the agent

Sometimes the agent fails to upload agent information in the Grid Control and the status in the Grid Control for the agent shows the status Agent Unreachable.





So I connected to the client $AGENTHOME/bin and tried to upload the agent data:



[oracle@host1 bin]$ ./emctl upload agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD upload error: uploadXMLFiles skipped :: OMS version not checked yet..

I checked the status of the agent and it was running.

 


After googling it a bit I found out that I should secure the agent in order for the upload process to work.

So I stopped the agent ./emctl stop agent and executed the ./emctl secure agent command. To my surprise it came up with another error:


[oracle@host1 ~]$ cd /u01/app/oracle/OracleHomes/agent10g/bin/
[oracle@host1 bin]$ ./emctl secure agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
Enter Agent Registration password :
Agent is already stopped...   Done.
Securing agent...   Started.
Requesting an HTTPS Upload URL from the OMS...   Failed.
The OMS is not set up for Enterprise Manager Security.

 Hence I went to the OMS_HOME and secured the oms:
[oracle@host1 bin]$ cd $OMS_HOME/bin
[oracle@host1 bin]$ ./emctl secure oms
which succeeded without any issue.

Then I came back to the AGENT_HOME and stopped it and then cleared its state:
[oracle@host1 bin]$ cd $AGENT_HOME/bin
[oracle@host1 bin]$ ./emctl clearstate agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
EMD clearstate completed successfully


Now I tried to secure the agent again

[oracle@host1 bin]$ ./emctl secure agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
Enter Agent Registration password :
Agent is already stopped...   Done.
Securing agent...   Started.
Requesting an HTTPS Upload URL from the OMS...   Done.
Requesting an Oracle Wallet and Agent Key from the OMS...   Done.
Check if HTTPS Upload URL is accessible from the agent...   Done.
Configuring Agent for HTTPS in CENTRAL_AGENT mode...   Done.
EMD_URL set in /u01/app/oracle/OracleHomes/agent10g/sysman/config/emd.propertiesSecuring agent...   Successful

And vol la  it was successful.


Now I was sure that the upload will work so I started up the agent and executed command to upload the agent data and guess what it threw another error:

[oracle@host1 bin]$ ./emctl upload agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD upload error: Upload timedout before completion


So I went back and cleared the state of the agent AGAIN:

[oracle@host1 bin]$ ./emctl clearstate agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
EMD clearstate completed successfully



And tried to upload the agent data:

[oracle@host1 bin]$ ./emctl upload agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD upload completed successfully
 

 And yes it was successful.


In order to confirm I went back and checked the status of the agent in the grid control and after five or six minutes it updated the status of the agent and all the services being informed to the Grid Control through the agent:




P.S. In several sites its specified to alter the value of EMD_URL in the $AGENT_HOME/sysman/config/emd.properties file and instead of https://xyz.com... change it to http://xyz.com... As far as my test goes I didn't make any changes there.

No comments:

Post a Comment