In preparation of distributing a large package (mcaOS Catalina installer), I created a smart group with at least x GB available on boot drive. This is explained in a webinar and this article, at the bottom.
I was surprised to not see my own Mac in the smart group. Upon checking, I found that in the Inventory, my Mac was listed with "0" Boot Drive Available. This is however not the case.
In the attached image, I also list 2 Extension Attributes, listing free space in GB. They are defined as follows:
Free Disk GB
#!/bin/bash
FreeSpace=$(diskutil info /Volumes/Macintosh HD | awk -F'[()]' '/Free Space|Available Space/ {print $2}' | sed -e 's/ Bytes//')
GigaByte=$((1024 * 1024 * 1024))
FreeGB=$(( FreeSpace / GigaByte ))
echo "<result>"$FreeGB"</result>"
BootFree
#!/bin/bash
BootFree=`diskutil info /|grep "Free Space"|awk '{print $4}'`
echo "<result>"${BootFree%.*}"</result>"
Question is why the built-in Boot Drive Available metric shows 0, causing the smart group population to fail... and how to solve it so it displays correctly.