Object Storage

Monitoring tenant or bucket free space

gorantornqvist
2,426 Views

Hi,

We would like to monitor storagegrid tenant freespace (and per bucket usage if possible) from nagios, is there any API scripts out there that I can reuse?

 

Thanks ...

1 REPLY 1

NetApp_AU
2,383 Views

Hello,

 

I am not an expert on API scripting, but I did play with the REST API page (NMS > Help > API Documentation) in a StorageGRID lab to find some more information.

 

Using GET /grid/accounts, I was able to retrieve a list of tenant account IDs and their quotas in bytes.

 

Next, I ran GET /grid/accounts/{id}/usage replacing the {id} portion with the desired tenant ID. This API call returned the total number of objects and data usage in bytes for the tenant, as well as the tenant's buckets, per-bucket object count, and per-bucket data usage in bytes.

 

You can use the first API call to get the tenant IDs and quotas, and then subtract the buckets' data usage from the second API call to get the free capacity remaining. I do not have a script file that puts that all together for us, but the information above is a start.

Team NetApp
Public