demonbhao
05/19/2021, 7:06 AMNoah Talerman
05/19/2021, 1:45 PMI just want to check the online hostHi @demonbhao . What do you mean by the word “check” here? What are you trying to accomplish in Fleet?
demonbhao
05/20/2021, 6:34 AMNoah Talerman
05/20/2021, 2:57 PMI was wondering if the query was stuck because it included all the machines that were not onlineI’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 machinesGot 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:
POST api/v1/fleet/queries/run
{
"query": "SELECT * FROM os_version",
"selected": {
"hosts": [1, 12, 47]
}
}
demonbhao
05/24/2021, 8:14 AMNoah Talerman
05/24/2021, 2:05 PMonline
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=demonbhao
05/25/2021, 2:59 AM