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:
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.
SELECT * FROM machine_instance WHERE NAME = '<host-name>';
UPDATE machine_instance SET historical = 1 WHERE NAME = '<host-name>';
The Controller process will take some time to remove it after marking it as historical.