Show free Storage in Percent

Hello,
Is it possible to create a Singlestat Gauge where the free space is displayed in percent?

I have the following performance values ​​from the storage in my influxdb:
Value = current free space in MB
MAX = the total size of the memory area.

Regards
Hermann

Yes, the exact syntax depends on the TSDB you are using.

For InfluxDB you can use math in your SELECT:

SELECT (total - used) / total * 100 FROM ...

For Graphite you’d want to check out the asPercent and diffSeries functions:

asPercent(diffSeries(total, used), total)

Hi,

thanks for your reply.

Here my Select:

SELECT "(max - value) / max *100" FROM "check_vmware_esx" WHERE "service" = 'VMware Datastore' AND "metric" = 'Storage1-MS'

But i cannot see a Value only “N/A” :frowning_face:
Hmm. is there a mistake in the SELECT Statement?

Regards
Hermann

Why do you have quotes around the expression? It should be:

SELECT (max - value) / max * 100 FROM check_vmware_esx WHERE service = 'VMware Datastore' AND metric = 'Storage1-MS'