Manipulate data in Telegraf for Windows

I am interested in recording Disk Capacity (in MB) and Disk Usage (in MB) for Windows OS instances. Disk capacity is desired because most of the hosts I am interested in, are VMs, and the vDisk size may be expanded or shrunk during its lifetime, and I am interested in being able to see historic disk capacity and used capacity.

There are two winperf counters for each logical volume that telegraf can send to influxdb “Percent_Free_Space” and “Free_Megabytes”, unfortunately these are not quite what I am after, however what I am after can be calculated. Capacity can be calculated with (Free_Megabytes / (Percent_Free_Space/100)), and Used Capacity can be calculated with (Capacity_MB - Free_Megabytes).

Is there any way of creating these “pseudo winperf counters” in telegraf to then send to influxdb ?


I do somehting similar for my alerts. There is no “free GB” metric that i can find but i need to show this in my alert messages.

In the end I opted to use Kapacitor. You can stream your data as it comes in, run any calculations you need to perform and then write the value back to the database.

Kapacitor isn’t just for alerts though, it is a data processing enging. I also use it as an alternative to continous queries to down sample my data - their is more functionality for data manipulation and less overhead in terms of memory usage.

Kapacitor as a CQ Engine

Take a look at the above link about using Kapacitor and let me know if there’s any questions. I’m pretty sure you will be able to achieve what you want with the Kapacitor method.