I use two Smart Groups in Jamf to define how many devices are in compliance in regards to macOS version. The Smart Groups are pretty simple:
- Devices who have checked in within the past two weeks running the latest compliant version of macOS or newer
- Devices who have checked in within the past two weeks running a version of macOS older than the minimum compliant version
The problem is that only gives us a snapshot of a moment in time, rather than historical data. My solution was to log that data in a Google Sheet.
I created a new Okta Workflow. The Workflow kicks off once a day at 1 am PST.
![](https://www.neverhadtofight.com/wp-content/uploads/2024/04/Screenshot-2024-04-09-at-11.46.46 AM-940x470.png)
I want to store the date and time, so I need to convert it into the appropriate format. This will give me 2024-04-09 and 10:49:00 PST (based on time I’m writing this). It stores that values as dateReturn
and timeReturn
.
![](https://www.neverhadtofight.com/wp-content/uploads/2024/04/Screenshot-2024-04-09-at-11.47.08 AM-940x638.png)
Then we need the Jamf Bearer Token. We can pass that data into the Custom API action. I’m using the /v1/smart-computer-groups/{id}/recalculate
endpoint. I changed the ID to the appropriate ID from Jamf. Nothing needs to go into Headers, Query, or Body. Then I use JSON Parse and Object Get to get the count.
![](https://www.neverhadtofight.com/wp-content/uploads/2024/04/Screenshot-2024-04-09-at-11.47.17 AM-940x646.png)
We’re doing the exact same thing again, but this time with the non-compliant devices.
Finally, I create a row on a Google sheet. putting in the date, time, compliantCount and nonCompliantCount. The sheet has some calculations to get total number, and to get percentage. On that sheet is also a chart which will track the historical percentage. You can see on April 14, the compliant version changed. As such we have a large dip and need to climb back up into compliance.
![](https://www.neverhadtofight.com/wp-content/uploads/2024/04/Percent-of-Mac-Compliant-Over-Time.png)
Here’s a link to the Google Sheet with fake data in it.