当前位置: 首页 > 工具软件 > OMS > 使用案例 >

OMS中的AGENT变化如何处理

董飞
2023-12-01
如果GC OMS发生了变化,OMS无法自动发现原有的Agent,需要对Agent做相应的调整才能重新加入到GC OMS的管理列表中。整理了一个简单的步骤,供参考。

1.确保Agent处于停滞状态
[oracle@ocmdb1 ~]$ $AGENT_HOME/bin/emctl status agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent is Not Running

若果仍然是运行状态,使用“$AGENT_HOME/bin/emctl stop agent”命令停掉Agent。

2.调整emd.properties参数文件
如果更换了GC OMS需要调整这个参数文件中的REPOSITORY_URL参数。
[oracle@ocmdb1 ~]$ vi $AGENT_HOME/sysman/config/emd.properties
……
REPOSITORY_URL=https://ocmdb2.localdomain:1159/em/upload
……

REPOSITORY_URL参数可以在GC OMS所在主机中获得
[oracle@ocmdb2 ~]$ $AGENT_HOME/bin/emctl status agent | grep Repository
Repository URL    : https://ocmdb2.localdomain:1159/em/upload

[oracle@ocmdb2 ~]$ $AGENT_HOME/bin/emctl status agent | grep Repository
Repository URL    : https://ocmdb2.localdomain:1159/em/upload

此处因我是在原OMS服务器上重新安装,故该文件不需要修改。

3.清除Agent原有信息
[oracle@ocmdb1 ~]$ rm -rf $AGENT_HOME/sysman/emd/state/*
[oracle@ocmdb1 ~]$ rm -rf $AGENT_HOME/sysman/emd/collection/*
[oracle@ocmdb1 ~]$ rm -rf $AGENT_HOME/sysman/emd/upload/*
[oracle@ocmdb1 ~]$ rm -rf $AGENT_HOME/sysman/log/*
[oracle@ocmdb1 ~]$ rm -f $AGENT_HOME/sysman/emd/lastupld.xml
[oracle@ocmdb1 ~]$ rm -f $AGENT_HOME/sysman/emd/agntstmp.txt
[oracle@ocmdb1 ~]$ rm -f $AGENT_HOME/sysman/emd/blackouts.xml
[oracle@ocmdb1 ~]$ rm -f $AGENT_HOME/sysman/emd/protocol.ini
[oracle@ocmdb1 ~]$ $AGENT_HOME/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

4.使用emctl的secure选项重新配置Agent
[oracle@ocmdb1 ~]$ $AGENT_HOME/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 :  --此处需要输入密码,我这里是oracle1
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/agent/agent10g/sysman/config/emd.properties
Securing agent...   Successful.

5.启动Agent
[oracle@ocmdb1 ~]$ $AGENT_HOME/bin/emctl start agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
Starting agent ......... started.

6.使用emctl的upload选项将Agent上传到OMS
[oracle@ocmdb1 ~]$ $AGENT_HOME/bin/emctl upload
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD upload completed successfully

7.最后确认Agent运行情况
[oracle@ocmdb1 ~]$ $AGENT_HOME/bin/emctl status agent
Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version     : 10.2.0.1.0
OMS Version       : 10.2.0.1.0
Protocol Version  : 10.2.0.0.0
Agent Home        : /u01/app/oracle/agent/agent10g
Agent binaries    : /u01/app/oracle/agent/agent10g
Agent Process ID  : 27716
Parent Process ID : 27701
Agent URL         : https://ocmdb1.localdomain:3872/emd/main/
Repository URL    : https://ocmdb2.localdomain:1159/em/upload
Started at        : 2010-07-12 22:19:14
Started by user   : oracle
Last Reload       : 2010-07-12 22:19:14
Last successful upload                       : 2010-07-12 22:19:51
Total Megabytes of XML files uploaded so far :     7.48
Number of XML files pending upload           :        2
Size of XML files pending upload(MB)         :     0.01
Available disk space on upload filesystem    :    87.52%
Last successful heartbeat to OMS             : 2010-07-12 22:19:21
---------------------------------------------------------------
Agent is Running and Ready

此时,回到Grid Control页面便可以看到对应的Agent已经添加完成。Agent添加任务完成。

8.小结
通过本文加之如下几篇文章简单展示了Oracle Grid Control部署安装方面的知识。建议大家在部署安装的过程中一定要注意细节,稍有不慎便有可能遇到问题。如果OMS无法自动识别到数据库的实例信息,可以考虑在GC页面中手工添加。
《【GC】安装GC之前需要调整的几个参数》(http://space.itpub.net/519536/viewspace-667627)
《【GC】OEL4.8部署安装 Grid Control OMS》(http://space.itpub.net/519536/viewspace-667751)
《【GC】使用 agentDownload.linux完成Grid Control Agent的快速部署安装》(http://space.itpub.net/519536/viewspace-667753)
《【GC】OEL4.8卸载重新部署安装Grid Control OMS》(http://space.itpub.net/519536/viewspace-667808)
 类似资料: