Dawei Zhang

05/02/2022, 10:50 PM
Is there a way to automatically delete an offline host after X days of inactive? I do not see there is such a configuration in fleet configurationhttps://fleetdm.com/docs/deploying/configuration The use case is this. In our infra, all newly created hosts in OCI automatically install osquery agent and connect to our fleet server. However, when some hosts are terminated, these host still ghost in the fleet UI. The solution right now is we manually delete them, but it's not ideal.
Kathy Satterlee

Kathy Satterlee

05/02/2022, 11:23 PM
Hi, @Dawei Zhang. Thanks for reaching out, it looks like you found a hole in the documentation and I'll make sure I get that sorted! You can set up host expiration in the UI under Settings > Organizational settings > Advanced options. Select the checkmark for "Host expiry" and then set the window to the number of days that should be allowed before the host is removed. The example below would clear out hosts that haven't checked in after 1 year. You can also see the an example YAML with host expiry enabled here.