A Machine Agent is considered to be abandoned when it is not attached to any APM agents.
There are two ways to delete the abandoned machine agent:
How do I delete an abandoned Machine Agent from the Controller UI?
- Make sure the Machine Agent is no longer running or reporting.
- Create a dummy application from AppDynamics' Controller UI.
- Associate the Machine Agents you want to delete to that dummy application.
- Delete the dummy app you created in step 1.
How do I manually delete an abandoned Machine Agent from the database?
When you manually delete an abandoned Machine Agent from the database, the following process ensures it doesn't appear in the UI, while leaving the entries in the database.
- From the command line, change to the Controller's bin directory:
- Use the correct script from the following to log into the Controller's database.
- For Windows:
- For Linux:
- Get the host-name from controller UI for which you want to delete the machine agents.
- Run this query to check the row exists in DB:
SELECT * FROM machine_instance WHERE NAME = '<host-name>';
<host-name>` is the value you got from controller UI in step 3.
- Run this query for marking the agent as historical:
UPDATE machine_instance SET historical = 1 WHERE NAME = '<host-name>';
<host-name> is the value you got from controller UI in step 3.
The Controller process will take some time to remove it after marking it as historical.