Collectd write_graphite plugin – multiple/different prefixes

collectdgraphitesnmp

I'm using collectd with the snmp and write_graphite plugins. I want certain metrics to go to Graphite with prefix A, and others to go with prefix B, to keep the data in Graphite/Whisper organized.

For example, I would like to divide things up like this:

network.switches.xxxx
power.pdu.xxxxxx

My write_graphite config looks like this:

<Plugin write_graphite>
  <Node "mygraphitehost">
    Host "mygraphitehost"
    Port "2003"
    Protocol "tcp"
    LogSendErrors true
    Prefix "network."
    Postfix "-collectd"
  </Node>
</Plugin>

This causes everything I gather with the snmp plugin show up under the "network" folder in the Graphite web interface. Is running multiple collectds with different configs/init scripts the only way to solve this?

Best Answer

It looks like the collectD Hashed Match might be what you are looking for:

https://collectd.org/wiki/index.php/Match:Hashed/Config

You obviously don't have multiple graphite servers, but it looks like you can use pattern matching to send metrics to the different servers, which in your case would have the same "host" value but the prefix value could be different.

Related Topic