[collectd] Chains and writing question

Mark Juric gajillion at gmail.com
Mon Feb 2 20:07:47 CET 2015


All,
I'm using the write_graphite plugin to write to a graphite cluster. The
data I'm concerned with is coming from a central "polling" system that, via
SNMP or the Netapp plugin, queries other appliances incapable of running
the collectd client. I need this data to reside in a different directory
when written based on certain host attributes. On a regular system, I
simply add a "Prefix" to write_graphite and that puts the data in the
correct place. On a polling machine, that forces the data for the polled
system to have the same prefix added, putting it in the wrong directory.

It appears that this should be resolvable via chains, but I'm not having
any success. In the write_graphite documentation, the example configuration
is described as registering "a writer under this string:
write_graphite/example" because of the

<Node "example">
...
</Node>

configuration. To that end, I've created a write_graphite configuration
with multiple nodes and different prefixes:

<Plugin write_graphite>
  <Node "default">
    Host "graphite-vip"
    Port "2003"
    Prefix "core.wl.syseng-test.dev."
    SeparateInstances true
  </Node>
  <Node "netapp">
    Host "graphite-vip"
    Port "2003"
    Prefix "core.sh5.storage-netapp.prd."
    SeparateInstances true
  </Node>
  <Node "netscaler">
    Host "graphite-vip"
    Port "2003"
    Prefix "core.na.netscaler-lb."
    SeparateInstances true
  </Node>
</Plugin>

How can I access these different nodes as separate writers? My chain
configuration is complaining that they're invalid following the syntax in
the wiki:

LoadPlugin "match_regex"
LoadPlugin "target_write"
<Chain "PreCache">
        <Rule "rewrite_netapp">
                <Match "regex">
                        Plugin "netapp"
                </Match>
                <Target "write">
                        Plugin "write_graphite/netapp"
                </Target>
                Target Stop
        </Rule>
        <Rule "rewrite_netscaler">
                <Match "regex">
                        Plugin "snmp"
                </Match>
                <Match "regex">
                        Host "^netscaler.*"
                </Match>
                <Target "write">
                        Plugin "write_graphite/netscaler"
                </Target>
                Target Stop
        </Rule>

        # Default target
        <Target "write">
                Plugin "write_graphite/default"
        </Target>
</Chain>

Question: Is this possible? And if so, what am I doing wrong? Thanks,

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20150202/307a5f11/attachment.html>


More information about the collectd mailing list