We noticed that some of our databases monitored in Oracle Enterprise Manager Grid Control were showing a status of Agent Unreachable. When checking the status of the Agent on the server the following error was returned.
[oracle@odprimary bin]$ emctl status agent EM Configuration issue. /u01/app/oracle/product/11.2.0/odprimary_PRIDB not found. [oracle@odprimary bin]$
A common cause for this error is changing the hostname of the server in either /etc/hosts or DNS. In this case the there were no changes to the hostname as we were able to connect to the hostname listed in the last known state on the database home page.
Before spending a lot of time attempting to reconfigure the agent look closely at the error message, and the title of this post. The agent is looking for the configuration directory in the
ORACLE_HOME and not the
AGENT_HOME. Unlike Database Control, the Grid Control Agent stores the configuration directory in
AGENT_HOME and not the
ORACLE_HOME. Set the
ORACLE_HOME appropriately prior to starting the agent to resolve the issue.