Management Agent was successfully removed from a target host, but it's still displayed in Enterprise Manager Cloud Control Console.
SYMPTOMS

A Management Agent was removed(stopped and removed) from a monitored host but it’s still displayed as UP on the Targets page of the Enterprise Manager Cloud Control 12c console.

Removing_Management_Agent_From_Management_Repository_001.png

The agent with this issue can't be removed with the Agent Decommission option. It fails with the error

Agent must be in down status for Decommission. Please bring down the agent and wait for the status to become down and retry.

Removing_Management_Agent_From_Management_Repository_002.png

SOLUTION

Manually remove a problematic Management Agent from a Management Repository Database by the following statement.

SQL> exec sysman.mgmt_admin.cleanup_agent('dbpilot.net:3872');

PL/SQL procedure successfully completed.

The problematic Management Agent should now be unregistered (removed) from the Management Repository

Written At
23 FEB 201911:00
Red Hat Release
6.x x64
Enterprise Manager
12.1.0.4.0