OEMCC Register Targets
Pre-Requisites
The target agent must be installed.
You must be able to resolve the hostname for the target agent from your OMS server
You must be able to connect on port 3872 (or the port you allocated to AGENT_PORT during Agent Install)
OEM GUI
Add Targets Manually
Setup - Add Target - Add Targets Manually
EMCLI
TODO: I have not yet tested this method successfully
Create Command File
Listener
echo "add_target -name=\"$(hostname -s)_myListener\" -type=\"oracle_listener\" -host=\"$(hostname)\" -properties=\"LsnrName:myLISTENER;ListenerOraDir:${ORACLE_HOME}/network/admin;Port:1521;OracleHome:${ORACLE_HOME};Machine:$(hostname);\"" > "/tmp/emclicommands.txt"
Database
echo "add_target -name=\"$(hostname -s)_${ORACLE_SID}\" -type=\"oracle_database\" -host=\"$(hostname)\" -credentials=\"UserName:dbsnmp;password:myDBSNMOpwd;Role:Normal\" -properties=\"SID:${ORACLE_SID};Port:1521;OracleHome:${ORACLE_HOME};MachineName:$(hostname);\"" >> "/tmp/emclicommands.txt"
Add Targets
emcli sync
emcli argfile /tmp/emclicommands.txt
rm -rf /tmp/emclicommands.txt