Title
#fleet
d

demonbhao

03/03/2021, 8:38 AM
Hello, I want to delete the machines in MIA in batches. Is there any good method?
a

arod

03/03/2021, 1:09 PM
I recommend leveraging the API for this 1. Get all the hosts and filter by MIA. Put them in a list. https://github.com/fleetdm/fleet/blob/master/docs/1-Using-Fleet/3-REST-API.md#list-hosts 2. Delete them by their ID leveraging the API again? https://github.com/fleetdm/fleet/blob/master/docs/1-Using-Fleet/3-REST-API.md#delete-host
zwass

zwass

03/03/2021, 4:24 PM
Or you can set up "host expiry" in the advanced options of the app settings page, which will automatically remove old hosts.
d

demonbhao

03/04/2021, 7:16 AM
hi,@zwass why is set up "host expiry" appear this error
zwass

zwass

03/04/2021, 4:11 PM
Ah, I guess you need to enable the events system in MySQL. How you do that probably depends on how you run MySQL so I'd check your documentation for that.
d

demonbhao

03/05/2021, 2:22 AM
When you say "enable the events system in MySQL", do you mean to enable the event scheduler of MySQL?(temporal triggers?) Because MySQL on my side is in the charge of operation and maintenance personnel, I am not very clear about the Settings in MySQL
zwass

zwass

03/05/2021, 2:22 AM
Correct
d

demonbhao

03/05/2021, 2:25 AM
OK, thank you for your help. I will communicate with the personnel in charge of MySQL.
2:57 AM
OK, after I open the MySQL EVENT_SCHEDULER, normal setting can be carried out. Thank you for your help!