Solaris 10 & 11 ZFS Space Monitoring

Hi Folks!
Its been a while since I worked with ZFS but basically, I need to monitor free space for Solaris 10 & 11 systems (with & without zones)
I am hoping that any space commands only need to be run from the global zone (to simplify matters)
However, I'm not not sure if there are exceptions to this (meaning a space check would need to be performed on zones)
Any feedback would be great.

For Solaris 11, I could. parse the output from the following two commands...

  • 1) zpool list (get health & free space)
  • 2) zfs list -p|grep -v NAME|awk '{printf "%-75s %12d %12d %12d\n", $1,$2,$3,($2/$3)*100}'

The 2nd command lists the space usage and percentage used and is easily parsed,

However this only works on Solaris 11. I've been looking but can't find a similar command for Solaris 10.
The closest command I have found is " zfs get -o value name,used,available " but this splits the output over new lines so is no good for parsing.

Does anyone know how to get the percentage of space used for every dataset in Solaris 10 that can be easily parsed?

Thanks for your time.

I've found the solution,
The following command works on Solaris 10 & 11 and report (in MB) Size, Used, Available and %Used

1 Like

Where is the promised command?

I think df -kF zfs might do it.