Open ddribeiro opened 3 months ago
@ddribeiro I queried a Win device on our dogfood and got results. Any specific way to reproduce? 'battery' table was added in 5.12.1. Can you give the osquery version, please?
@sharon-fdm I think there are two issues here:
Part of the response from this page:
"packs": [],
"batteries": null,
"status": "online",
"display_text": "brock-win",
You can see battery information on a Mac host details page here
Here is a response when running select * from battery
on the same Windows host. I'm not sure how we are extrapolating battery health, but I assume we have enough data to determine that from the current response.
We need to check the table and see if somthing is broken. (That what the estimation is for)
Also, from @rachaelshaw: let's take this to feature_fest.
@sharon-fdm Can you try this on your Windows machine, running osquery 5.12.1 or later: SELECT serial_number, cycle_count FROM battery
BROCK-WIN is a VM, so not expected to work.
health
column is only available on macOS, so not expected to work on Windows. Docs: https://fleetdm.com/tables/battery
@getvictor I removed my win machine from dogfood. Will re install agent so we can try it.
@getvictor
@sharon-fdm Looks like your computer returns some data. I think we can close this bug.
SELECT serial_number, cycle_count, health FROM battery;
Hey @getvictor do we expect @ddribeiro's query (above) to return no results on Windows? Do you think Dale ran the query on a version of osquery prior to 5.12.1 (when we added Windows support for battery
table)
battery health does not appear on the host details page for Windows computers that have batteries like it does for Macs. The GET /api/v1/fleet/hosts/:id endpoint also includes a battery key with a null value.
It looks like this is the expected behavior. We added battery condition to the UI/API for macOS hosts (not Windows) in this story: #4904
@ddribeiro if we confirm that querying the table works as expected can you please transform this bug into a feature request and add it to feature fest: Surface Windows battery condition on the Host details page
It's possible my test was on a computer with an oquery version prior to 5.12.1, unfortunately I did not think to check when I did my initial testing.
I can confirm that I just ran the SELECT serial_number, cycle_count, health FROM battery;
on Windows device in Dogfood with osquery version 5.12.2 and got results back.
@noahtalerman I'll switch this over to a feature request since the query itself seems to be working.
Moved the original issue description here for safekeeping:
Fleet version: v4.50.0, Dogfood: SNAPSHOT-a8a8ab1
Web browser and operating system: Likely all supported versions of Windows, but at reproduced on Windows 11 Pro 23H2 10.0.22631.3447 and Windows 10 Pro 22H2 10.0.19041.3930.
When querying the battery
table on Windows computers, the host always responds with no results, even though the battery table is supported on Windows.
SELECT serial_number, cycle_count, health FROM battery;
Because this query returns no results, battery health does not appear on the host details page for Windows computers that have batteries like it does for Macs. The GET /api/v1/fleet/hosts/:id
endpoint also includes a battery key with a null value.
References to Battery Health in Windows:
References to Battery Health in macOS, iOS, and iPadOS:
From @noahtalerman: Let’s return exactly what we get from osquery in the Fleet API. We can do translation in the UI. This gives us more flexibility in the future to change these translations
Hey @randy-fleet, can you please take a crack at filling out the TODOs in the "Product" section in this issue?
We want to make sure there are no TODOs prior to estimation so that the requirements are clear. I realize we already estimated this one which is ok!
Please feel free to schedule some time w/ me (or bring this to our 1:1) if you have questions.
cc @sharon-fdm
per @noahtalerman's comment above, estimations we added at today's session factored in whatever ambiguity the team perceived in the specs
@jacobshandling and @sharon-fdm, to move quickly I think we can lean on the engineer working on this issue to open a draft PR w/ proposed API design (instead of product).
What do you think?
I moved the "API changes" TODO to the "Engineering" section in this issue description.
cc @lukeheath
@noahtalerman, yeh, we can propose it as part of the work when we pick it up.
Goal
Context
At some point we shipped this improvement for macOS. Here's the story w/ UI/API wireframes: #4904
When we shipped this for macOS, the
battery condition
table (docs here) didn't work for Windows. Now it works for Windows. (Figma)Product Changes
Windows offers ability to generate battery report Generating a battery report, (Example of battery report). I (@randy-fleet) am unable to verify what fully gets reported, but ideally we can map to and align on Apple's pre-defined conditions:
We currently map for macOS:
This information will only show for Mac and Windows Hosts initially, and should be consistent between the two. iOS and iPadOS also support these conditions, but can be added at a later time.
Engineering
QA
Risk assessment
Manual testing steps
Testing notes
Confirmation