I'm currently fiddling with a project using the ONTAPI (perf stats monitoring sort of thing).
What I'm wanting to do is reproduce the information from 'df' and 'df -s'.
Doing well so far, because the api 'volume-list-info' seems to have most of the information I want. There's just one thing missing - how much of the 'snap reserve' I'm actually using.
I can't seem to find it in either that, or the 'snapshot' counters. I would ideally be able to do this without having to do a per-volume calculation, because one of the things I'm hoping to do is support a lightweight proxy client that 'just' fetches source XML for processing on a server.
Or is there a way I can calculate this from the size/used/available in the volume-list-info?
Having been chipping away at this problem, and with thanks to the excellent "toasters" mailing list (Archive) - my eventual solution was to make use of the
system-cli
API call.This works to capture the results of a
df -k
via an API call. But there's just one drawback - you only get a plain text 'command output' blob, which you then have to parse yourself anyway, so you don't really gain much overssh hostname df -k
- just a different authentication and fetch method, but that's really what I was after.Also of note - this does't use the NetApp SDK. You might consider that an advantage or not. Personally I find
XML::Twig
andLWP
quite good to work with - YMMV.Anyway - other suggestions include:
ssh hostname df -k
as you found, system-cli may be the only way to get 'df' output.
because 'space used for snapshots' can exceed the snap reserve, i prefer a different measure. the snapshot-volume-info API returns size-available (how much more space you can use in the volume, before you lose the ability to make more snapshots).
to collect other space stats for a flexvol i'd use volume-space-get-iter (volume-space-list-info-iter in 7m) or volume-footprint-get-iter (vol-footprint-info in 7m) APIs.
the NetApp Manageability SDK download includes documentation; the calls i mentioned are under, for example :
doc/ontapi/ontapi_1.20/Vserver/snapshot/index.html#snapshot-volume-info doc/ontapi/ontapi_1.20/Vserver/volume/index.html#volume-space-get-iter doc/ontapi/ontapi_1.20/Vserver/volume/index.html#volume-footprint-get-iter
(an older doc download is available at http://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Broken-link-for-SDK-API-Doc/m-p/97275 )