Posted on 11-11-2019 02:09 PM
Jamf Pro has a wonderful built in extension for determining the percent usage of the boot drive, however with Catalina that extension is now reporting differently. macOS Catalina now separates user user data into a different volume and as as a result the old extension only shows that a small percentage is taken up because it is seeing the first volume.
Does anyone have a script or way to return the percentage used (or amount) of the data volume in an extension attribute? I haven't been able to find a good script for this.
Thanks
Posted on 01-30-2020 03:03 PM
Finally figured out an extension attribute for this.
This will spit out how much of the volume is used in a percentage as a string.
#!/bin/sh
used=$( /bin/df -H | awk '//dev/disk1s1/ {print $5}' )
echo "<result>"$used"</result>"
This will spit it out so you can use it as an integer.
#!/bin/sh
used=$( /bin/df -H | awk '//dev/disk1s1/ {print $5}' )
echo "<result>"${used%?}"</result>"
Posted on 04-26-2022 02:00 AM