Note: Hostnames in images have been blurred out on purpose.
There is always one thing you can count on when working with Oracle products; you will always learn something new. Today, while I was working with OEM12c, I manually added a host with no issues. I provided the host name, port number, directory for the agent install and passwords required. When the agent install was complete, I checked out the target just to make sure everything was fine. What I found out was that the host name target did not include the domain name.
This got me to thinking, why did it do this? In previous versions, it was difficult to change the name of a host target. In OEM 12c, it appears not that easy as well. So, how did I solve this problem?
After digging around for a bit, I figured out that the host name when adding manually; the domain name (acme.com) needs to be provided with the hostname. Before this can be fixed, the existing target needs to be removed. I make my life easy, I’m opting for removing the target via removing the agent.
The easiest way to remove the target is to do the following:
- Stop the agent on the host that we want to change.
cd $AGENT_HOME/core/220.127.116.11.0/bin/emctl stop agent
2. Go to the OMS home and login to the OMS with emcli
$ cd $OMS_HOME/bin/emcli login –username=sysman –password=<password>
$ emcli sync
4. Remove the agent from the repository with monitored targets.
$ emcli delete_target –name=”<agent/host>:3872” –type=”oracle_emd” –delete_monitored_targets
Removing the agent this way, will force all the monitored targets to be removed as well. Once the agent and associated targets are removed emcli will indicate successful.
Target “<agent/host>:3872:oracle_emd” deleted successfully
Back on the target server, remove the directory for the agent and clean up the inventory.xml file if you want to use the same directory structure for the new agent.
$ rm –rf ./12.1
Now, let’s re-add the agent and associated host target.
Just go through the normal manual process for adding a target host. When providing the hostname, you’ll need to add the domain name as part of the host.
Once the agent has been redeployed to the host target; it will come up in OEM listed with the domain name.
I know that sometimes it is not idea to add an agent, remove the agent and then add it again. If you are like me, I like to have clean environment to look at and understand. Let me know what your thoughts are on this issue.