ChromeBook battery status

1,208 views
Skip to first unread message

Rick Davis GLSD

unread,
Sep 1, 2023, 3:59:53 PM9/1/23
to GAM for Google Workspace
I am attempting to use crostelemetry to get the batterystatusreport and batteryinfo on all devices in an OU.

I tried this command:

"gam print crostelemetry fields "batterystatusreport,batteryinfo" ou "<my ou>" todrive" 

My result is a csv file with two columns. Column one is named "deviceId" and lists the deviceId of all the devices. Column two is named "name" and lists customers/<my customer ID>/telemetry/devices/<the deviceId>

This command:

"gam print crostelemetry ou "<my ou>" todrive"

Gives me more columns than I can reasonably count. None of the column headings include battery. However, the columns named bootPerformanceReport.0.shutdownReason list "LOW BATTERY" for some of the devices.

I feel like there may be an API I need to update or enable, but gam create oauth does not show me anything relating to telemetry.

Thoughts?

Rick

Rick Davis GLSD

unread,
Sep 2, 2023, 8:39:03 AM9/2/23
to GAM for Google Workspace
Good Morning Ross,

Happy to report that the changes we made were successful. Device info is now trickling in, slowly. Not sure yet what the trigger is, but I will take it for now. A lot of information to assimilate and parse. The most important data so far as been the three different batteryHealth levels reported, BATTERY_HEALTH_NORMAL, BATTERY_REPLACE_NOW and BATTERY_REPLACE_SOON.

I will probably want to learn more about queries and data collection, piping or parsing data, to create a report I can use to have a small tech team of middle or high school students perform battery replacements if the device AUE warrants the effort. I am betting I can get the AUE info from GAM or get my spreadsheet guru to parse the data from different sheets into a usable format.

Thanks for the guidance and I will post my progress as time permits.

For reference, we first had to enable the Power status under Configuration>Customize setting, located at Devices>Chrome>Settings>Device>Report device telemetry. There are 22 selections available. Nine of these were already enabled, I plan to test or evaluate the other ten choices and may enable others.

We then ran the command: gam print crostelemetry fields "batterystatusreport,batteryinfo,serialnumber" ou "My OU" todrive

Rick

James SEYMOUR

unread,
Sep 3, 2023, 11:42:06 PM9/3/23
to GAM for Google Workspace
Is there a way to run this against an OU and sub-OUs?

The option ou_and_children or cros_ou_and_children are not working.

Cheers

James

Ross Scroggs

unread,
Sep 4, 2023, 12:04:30 AM9/4/23
to google-ap...@googlegroups.com
James,

The Telemetry API only supports ChromOS devices in a single OU, so get the list of OUs first and then get the telemetry data; replace /StudentChromebooks as required.
gam print orgs fromparent /StudentChromebooks showparent | gam redirect stdout - multiprocess redirect stderr stdout redirect csv ./CrOSTelemetry.csv multiprocess csv - gam print crostelemetry ou "~orgUnitId" fields "batterystatusreport,batteryinfo,serialnumber"

Ross
----
Ross Scroggs



--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/2e3c94a5-c223-4ef4-b2fe-d045ec113db5n%40googlegroups.com.

Ross Scroggs

unread,
Sep 4, 2023, 2:35:48 PM9/4/23
to google-ap...@googlegroups.com
James,

With GAMADV-XTD3 6.63.11 you can now do:

gam print crostelemetry ou_and_children "/Path/to/OU" fields "batterystatusreport,batteryinfo,serialnumber"

Ross
----
Ross Scroggs


James SEYMOUR

unread,
Sep 5, 2023, 3:44:12 AM9/5/23
to GAM for Google Workspace
Hi Ross,

That's fantastic, many thanks.

Cheers

James

Bobby Clowers

unread,
Sep 8, 2023, 8:48:10 AM9/8/23
to GAM for Google Workspace
Is there a way to not show all of the column headings that are associated with the report and info columns?  
A few example headings.
batteryStatusReport.0.sample.3.remainingCapacity

batteryStatusReport.0.sample.3.reportTime

batteryStatusReport.0.sample.3.status

Or is this something that you just have to remove from the CSV after it runs?

Ross Scroggs

unread,
Sep 8, 2023, 10:03:50 AM9/8/23
to google-ap...@googlegroups.com

James SEYMOUR

unread,
Sep 10, 2023, 10:55:04 PM9/10/23
to GAM for Google Workspace
Hi Ross,

I'm getting an error trying to use this option.

gam print crostelemetry ou_and_children "/" csv_output_header_filter "deviceId,serialNumber,name,batteryInfo,batteryStatusReport.0" todrive tdnoemail false
Command: /home/user_name/bin/gamadv-xtd3/gam print crostelemetry ou_and_children / >>>csv_output_header_filter<<< "deviceId,serialNumber,name,batteryInfo,batteryStatusReport.0" todrive tdnoemail false

ERROR: Invalid argument

Cheers

James

Ross Scroggs

unread,
Sep 10, 2023, 10:57:10 PM9/10/23
to google-ap...@googlegroups.com
James,

gam config csv_output_header_filter "deviceId,serialNumber,name,batteryInfo,batteryStatusReport.0" print crostelemetry ou_and_children "/"  todrive tdnoemail false

Ross
----
Ross Scroggs



James SEYMOUR

unread,
Sep 10, 2023, 11:12:03 PM9/10/23
to GAM for Google Workspace
Ahh, I see. Thanks, working now.

Bobby Clowers

unread,
Sep 14, 2023, 10:47:52 AM9/14/23
to GAM for Google Workspace
I tried this command
gam config csv_output_header_filter "deviceId,serialNumber,name,batteryInfo,batteryStatusReport.0" print crostelemetry ou "/students/high/ths" todrive tdnoemail false
I still get all 98 columns and not just the 5 specified.


I also tried the ou_and_children and I get this message
gam config csv_output_header_filter "deviceId,serialNumber,name,batteryInfo,batteryStatusReport.0" print crostelemetry ou_and_children "/"  todrive tdnoemail false
Command: gam config csv_output_header_filter "deviceId,serialNumber,name,batteryInfo,batteryStatusReport.0" print crostelemetry >>>ou_and_children<<< / todrive tdnoemail false

ERROR: Invalid argument
Help: Syntax in file D:\GAMADV-XTD3\GamCommands.txt
Help: Documentation is at https://github.com/taers232c/GAMADV-XTD3/wiki

Ross Scroggs

unread,
Sep 14, 2023, 11:02:54 AM9/14/23
to google-ap...@googlegroups.com
Here's what config csv_output_header_filter "deviceId,serialNumber,name,batteryInfo,batteryStatusReport.0 gets you; you may get many more rows of batteryStatusReport if there are moee samples.
deviceId
serialNumber
name
batteryInfo
batteryInfo.0.designCapacity
batteryInfo.0.designMinVoltage
batteryInfo.0.manufacturer
batteryInfo.0.serialNumber
batteryInfo.0.technology
batteryStatusReport.0.batteryHealth
batteryStatusReport.0.cycleCount
batteryStatusReport.0.fullChargeCapacity
batteryStatusReport.0.reportTime
batteryStatusReport.0.sample
batteryStatusReport.0.sample.0.chargeRate
batteryStatusReport.0.sample.0.current
batteryStatusReport.0.sample.0.dischargeRate
batteryStatusReport.0.sample.0.remainingCapacity
batteryStatusReport.0.sample.0.reportTime
batteryStatusReport.0.sample.0.status
batteryStatusReport.0.sample.0.voltage
batteryStatusReport.0.sample.1.chargeRate
batteryStatusReport.0.sample.1.current
batteryStatusReport.0.sample.1.dischargeRate
batteryStatusReport.0.sample.1.remainingCapacity
batteryStatusReport.0.sample.1.reportTime
batteryStatusReport.0.sample.1.status
batteryStatusReport.0.sample.1.voltage
batteryStatusReport.0.serialNumber

You may want to filter for just these batteryStatusReport values
batteryStatusReport.0.batteryHealth
batteryStatusReport.0.cycleCount
batteryStatusReport.0.fullChargeCapacity
batteryStatusReport.0.reportTime

ou__and_children was added in 6.63.11, what version are you on?

Ross
----
Ross Scroggs


Bobby Clowers

unread,
Sep 14, 2023, 11:05:57 AM9/14/23
to google-ap...@googlegroups.com
I was on 6.63.09  I have now updated to 6.63.14

I will give those commands a shot.   Thanks

You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/B92Tagfdyhg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/585E551B-CBD6-4CBF-827E-4B50A97AB7FA%40gmail.com.


--
Thanks,
 
Bobby Clowers
Wireless Specialist
Pittsylvania County Schools
11690 Highway 29 North
Chatham, VA 24531

Bobby Clowers

unread,
Sep 14, 2023, 11:16:00 AM9/14/23
to GAM for Google Workspace
Worked perfectly.....Thanks

Rick Davis GLSD

unread,
Sep 15, 2023, 5:52:57 AM9/15/23
to GAM for Google Workspace
Hi Ross,

Filtering the column headers has helped a lot. My next step after running the crostelemetry command is to identify the make/model of the ChromeBooks in order to purchase replacement batteries for the replace_now and replace_soon devices. Currently I use cros to produce this information in a separate csv file. Then compare or match the serialnumbers in Excel or sheets (Mark, my local sheets guru actually does that  part). Is there a way to gather that info as well and pipe it or add it to the final result?

My current workflow is to run the battery report command four times, once for each building OU. Then run a cros command  to get the current list of all ChromeBooks; share all five sheets with Mark and he does his magic to produce a list of models needing batteries; I then add the URL for the corresponding battery by model of mattery needed and submit a PO.

Always looking for a way to improve, any suggestions greatly appreciated.

Rick

Aliza Klein

unread,
Oct 3, 2023, 11:47:12 AM10/3/23
to GAM for Google Workspace
Hi, Ross.
Just tried running the command as I need the same info (after I upgraded from 6.26x to the most current version of Advanced GAM).
I am getting an permissions error:
ERROR: Customer ID: C019uXXX, Domain: mydomain.org, API: chromemanagement, Request had insufficient authentication scopes.

Prior to running the command, I did add "Power Status" to my configuration for my Chromebooks OU in Google Admin.

My exact command was:

gam print crostelemetry ou_and_children "/Chromebooks" fields "batterystatusreport,batteryinfo,serialnumber"

Where "Chromebooks" is the a sub OU directly under the main domain (which is specified in my GAM config settings).
Help?
Thanks!
Aliza

Ross Scroggs

unread,
Oct 3, 2023, 11:53:14 AM10/3/23
to google-ap...@googlegroups.com
Aliza,

Since you're coming from a very old version, do the following
gam update project
gam oauth create

Ross
----
Ross Scroggs


Aliza Klein

unread,
Oct 3, 2023, 12:31:50 PM10/3/23
to google-ap...@googlegroups.com

Worked like a charm!

Thanks!

Rick Davis GLSD

unread,
May 8, 2025, 9:40:29 AMMay 8
to GAM for Google Workspace
Not sure if this should be a new discussion. Ross, links or telling  me to Google search it is an acceptable answer.

Is there a list of fields that crostelemetry can check?

Specifically, is there anyway to check or determine if the "CMOS" battery needs replacing in a ChromeBox?

I currently use the workflow mentioned in this thread to monitor ChromeBook batteries.

Rick

Ross Scroggs

unread,
May 8, 2025, 11:21:53 AMMay 8
to google-ap...@googlegroups.com
Rick,

Send me a private Meet/Zoom invitation.

Ross
----
Ross Scroggs


Ross Scroggs

unread,
May 8, 2025, 11:39:06 AMMay 8
to google-ap...@googlegroups.com

Try this:


gam config csv_output_row_filter "batteryStatusReport.0.batteryHealth:regex:BATTERY_REPLACE_SOON|BATTERY_REPLACE_NOW" redirect csv ./BatteryReport.csv print crostelemetry fields "batterystatusreport,batteryinfo,serialnumber"


Ross

----
Ross Scroggs


Rick Davis

unread,
May 8, 2025, 11:51:38 AMMay 8
to google-ap...@googlegroups.com
Hi Ross and others,

I think I may have confused the issue. I am using the above mentioned, possibly a slightly altered version, command to successfully monitor my fleet of ChromeBooks. The only thing I change each month is I add: todrive tdtitle "GHS_battery050825" at the end of the command to reflect the date the command is run.

My inquiry today was about the possibility of using the crostelemetry command on ChromeBoxes that have a small rechargeable "CMOS" battery. They don't run off of this battery, but I was looking for a way to monitor that battery and replace as needed. Currently it is "wait for startup issues" then replace as a troubleshooting step. I am fairly certain there is NOT any way that this info is reported, but worth the ask.

Rick

You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/B92Tagfdyhg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-manager/5ED94FD4-4F78-4045-85E1-455C5D91318B%40gmail.com.


--

Ross Scroggs

unread,
May 8, 2025, 12:00:37 PMMay 8
to google-ap...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages