Hello, I just want to check the online host, what ...
# fleet
d
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?
n
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
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
n
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 `ids`s in your call to the
api/v1/fleet/queries/run
endpoint. For example:
Copy code
POST api/v1/fleet/queries/run

{
  "query": "SELECT * FROM os_version",
  "selected": {
    "hosts": [1, 12, 47]
  }
}
d
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)
n
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
OK, I will submit it as soon as possible
👍 1