Get percentage free disk space for multiple nodes using Grafana

I use Grafana (v2.1.3) to render metrics. The indicators are taken from graphite collected by the collector. The target graph is to display the percentage of free disk space for multiple nodes, for example. allows you to specify the / data folder, so the metric representing free space in bytes is:

collectd.$node.df-data.df_complex-free 

Metrics representing the total space make up the sum of:

 collectd.$node.df-data.* 

So, I have the following configuration:

 Series A: collectd.$node.df-data.df_complex-free (Invisible) Series B: collectd.$node.df-data.* (Invisible) Series C: alias(asPercent(#A, sumSeries(#B)), 'Free space') 

Here $ node is a variable that is selected from the drop-down list (All, node1, node2, node3, etc.). It works as expected when one particular node is selected, but the wrong All option is selected (for example, if the percentage on the node is ~ 95%, then 24% is selected when All is selected).

Another option (perhaps more preferable:

 Series A: collectd.$node.df-data.df_complex-free Series B: groupByNode(collectd.$node.df-data.*, 1, 'sum') Series C: scale(divideSeries(#A, #B), 100) 

Again, for a single node, this is normal, but after selecting the "All nodes" option, the following error is displayed:

The second argument to divideSeries should refer to exactly 1 series.

Any ideas? I believe that there should be a simple solution.

+5
source share
1 answer

Since you use the collector and the df plugin, you can simply enable the ValuesPercentage parameter in /etc/collectd.conf.d/df.conf , then you can request collectd.$node.df-data.percent_bytes-free

https://collectd.org/wiki/index.php/Plugin:DF

+5
source

Source: https://habr.com/ru/post/1263218/


All Articles