Every day, new agents or machines are created and deleted in our Elastic Fleet environment. As shown in the attached image, some agents are active (healthy), while others are inactive (offline). The issue we're encountering is that inactive agents and newly created active agents often have the same names. Additionally, although we might have only 20-30 agents, the list contains many inactive agents with duplicate names.
It appears that each new agent or machine has a different ID in the backend, but the names can be duplicated. I'm trying to understand how these IDs are generated. Is there a way to set a certain standard for generating these IDs to help differentiate and manage the agents more effectively, thus avoiding the display of duplicate inactive machines?
A proper breakdown of our scenario is that each day, through a script, agents are reinstalled when a machine is created and agents/machines are deleted/uninstalled when machines are terminated. As a result, newly installed agents on newly created machines with the same functionality and name but different IP addresses are created again, leading to the generation of new agent IDs. This causes duplicates of agents. The newly created machines also have the same names but different agent IDs. Is there a way to customize the ID creation process to avoid having duplicate machines with the same names?
We have an AWS environment where we simply terminate the machine, and the agent terminates along with it. We don't perform any additional actions; the termination removes all the machine's configurations. After a scheduled time, when the machine restarts, it installs all the same configurations with the Elastic agent. We do this to save money on AWS.
Are you suggesting that unenrolling the agent before terminating the machine will solve this offline issue?
Yeah, if you just terminate the machine, then the agent will stop and will appear as offline on Fleet.
You would need to uninstall the agent on the server before terminating the machine or using the Fleet API/Fleet UI to unenroll the agent before terminating the machine.
Another option is to configure a small Inactivity timeout in the fleet policy, this way the agent will be marked as inactive and not offline.
Thanks for your response, it clears the confusion. Can you please tell me or provide the source for the Fleet API for unenrolling the agent. I was unable to find anything regarding it.
@Danyal_Danish as mentioned by @leandrojmp the agent-id is uniquely generate identifier and can't be modified by the user. Please configure the "inactivity timeout" in the policy that will make the offline agents Inactive and remove them from view. You can then filter and select all inactive agents and unenroll them. We will be adding an option that would do this automatically if desired.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.