Title
#fleet
d

demonbhao

05/19/2021, 7:06 AM
Hello, I just want to check the online host, what should I do?Is it to set a new TAB for the online host?If I want to set a new tag, how do I set it?
Noah Talerman

Noah Talerman

05/19/2021, 1:45 PM
I just want to check the online host
Hi @demonbhao . What do you mean by the word “check” here? What are you trying to accomplish in Fleet?
d

demonbhao

05/20/2021, 6:34 AM
Hi @Noah Talerman .Maybe I'm not describing it quite right.I want to query all the online servers instead of all the machines when I use the API query.Some queries get stuck when querying all machines, such as querying RPM_Packages.I was wondering if the query was stuck because it included all the machines that were not online
Noah Talerman

Noah Talerman

05/20/2021, 2:57 PM
I was wondering if the query was stuck because it included all the machines that were not online
I’m not sure if offline hosts are the cause of the query getting stuck. I’m looking into this.
I want to query all the online servers instead of all the machines
Got it. You can’t target
Online
hosts like a label. you’ll have to first make a call to the
api/v1/fleet/hosts?status=online
endpoint to grab the
id
for all online hosts. Next, you’ll have to use these host idss in your call to the
api/v1/fleet/queries/run
endpoint. For example:
POST api/v1/fleet/queries/run

{
  "query": "SELECT * FROM os_version",
  "selected": {
    "hosts": [1, 12, 47]
  }
}
d

demonbhao

05/24/2021, 8:14 AM
I found out about the lag when I query RPM_Packages and Kernel_Info One of the things I've noticed is that queries on Fleet UI are also getting stuck.I used Fleet UI to do the SELECT * FROM KERNEL_INFO query and query ALL HOSTS On the network websocket was pending a long time.In the other environment, there was no WebSocket hang when querying all the servers (there were only three)(The result is the fourth picture)
Noah Talerman

Noah Talerman

05/24/2021, 2:05 PM
Thank you for the screenshots and explanation. It seems like 1 host that Fleet thinks is
online
is not responding. Do you mind filing a GitHub issue that includes your request to only query
online
hosts and your screenshots here? https://github.com/fleetdm/fleet/issues/new?assignees=noahtalerman&labels=enhancement&template=feature-request.md&title=
d

demonbhao

05/25/2021, 2:59 AM
OK, I will submit it as soon as possible