From collectd Wiki
< Plugin:Aggregation
Revision as of 15:39, 17 November 2017 by Faxm0dem (talk | contribs) (Aggregated CPU statistics per host)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page contains some example configurations for the Aggregation plugin. This page is meant as a cookbook, so if you have a configuration for an aspect not handled here or a daemon not present, please feel free to add anything that's useful for you.

Aggregated CPU statistics per host

The following configuration assumes your cpu plugin is configured this way:

<Plugin cpu>
  ValuesPercentage false
  ReportByCpu true
</Plugin cpu>

The following configuration aggregates the CPU statistics of all CPUs into one set using the sum and average consolidation functions.

<Plugin "aggregation">
    Plugin "cpu"
    Type "cpu"
    GroupBy "Host"
    GroupBy "TypeInstance"
    CalculateSum true
    CalculateAverage true

This will result in a per-CPU-state set of values for each host. The values will be names according to this schema:

If you don't want to keep the per-CPU statistics around, you can use the filter mechanism to get rid of them:

LoadPlugin "match_regex" # we want to use this for our Matching
<Chain "PostCache">
  <Rule> # Send "cpu" values to the aggregation plugin.
    <Match regex>
      Plugin "^cpu$"
      PluginInstance "^[0-9]+$"
    <Target write>
      Plugin "aggregation"
    Target stop
  <Target write> # Write everything else via "rrdtool".
    Plugin "rrdtool"

Aggregated CPU frequency per host

This example plots the average CPU frequency for a given host. It changes the GroupBy to "PluginInstance" to group all fields.

 <Plugin "aggregation">
     Plugin "cpufreq"
     Type "cpufreq"
     GroupBy "Host"
     GroupBy "PluginInstance"
     CalculateAverage true

See also