magnetik
magnetik

Reputation: 4431

Compute multiple disk usage percentage with graphite

I have metrics like theses:

collectd.host.df-root.df_complex-used
collectd.host.df-root.df_complex-free
collectd.host.df-root.df_complex-reserved
collectd.host.df-var.df_complex-used
collectd.host.df-var.df_complex-free
collectd.host.df-var.df_complex-reserved

I want to have the free / (free + used + reserved) on every disk (df-var and df-root : collectd.host.df-*): that is to say the % of free space on every disk.

I came up with this solution (that is not working):

groupByNode(group(aliasByNode(collectd.host.df-*.df_complex-free,2),groupByNode(collectd.host.df-*.df_complex-*,2,"sumSeries")),0,"asPercent")

Upvotes: 0

Views: 3772

Answers (2)

Chris Portman
Chris Portman

Reputation: 43

The solution you have tried is not giving the correct result because the asAverage function, for the total, is taking into account the used value twice (i.e. the total is used + used + free + reserved).

Try this:

groupByNode(group(aliasByNode(collectd.host.df-*.df_complex-used,2),groupByNode(collectd.host.df-*.df_complex-{reserved,free},2,"sumSeries")),0,"asPercent")

It excludes the used metric from the second group.

Upvotes: 1

Sola Yang
Sola Yang

Reputation: 985

You can enable "ValuesPercentage True" in collectd.conf for df plugin, start collectd service, then you can see ollectd.host.df-var.percent_bytes-used.value.

Upvotes: 1

Related Questions