[collectd] Grouping the output of collectd in graphite

Vaughn Wernersbach Vaughn.Wernersbach at bidstrading.com
Fri Jan 29 21:31:05 CET 2016


Does replace support capture groups?

For instance, I’d like to rename hostname from server.domain.com to domain.server (so things are better organized on the graphite side).



Vaughn Wernersbach
BIDS Trading, L.P.

111 Broadway, Suite 1603 | New York, NY 10006
T: 212.618.2071 |  F: 212.618.2031  |  C: 732.397.8344  | E: vaughn.wernersbach at bidstrading.com<mailto:vaughn.wernersbach at bidstrading.com>

From: collectd [mailto:collectd-bounces at verplant.org] On Behalf Of Giovanni Torres
Sent: Wednesday, January 27, 2016 9:17 AM
To: Jerry Lombardo <jl4472 at columbia.edu>
Cc: collectd at verplant.org
Subject: Re: [collectd] Grouping the output of collectd in graphite


On Tue, Jan 26, 2016 at 10:13 PM Jerry Lombardo <jl4472 at columbia.edu<mailto:jl4472 at columbia.edu>> wrote:
Hey, Thanks for the reply.

I'm trying to get the 500 directories (one for each host under the graphite root ) into one directory.  Replace doesn't look to be doing that.  I posted a screen shot of what I am looking at now,  it's cropped but if i could get all of these sorted under a sub dir it would beat digging through the whole list to find what I want


https://gyazo.com/1182b05ead2a12dc9ee33273af316b33

It depends on how you want your values structured in this single directory.
. Are you using only the SNMP plugin?
. Are you using other collectd plugins?
Collectd will send to carbon->whisper->graphite-web.  You will want to replace the values before sending off to carbon.
Replace does work, but again, it depends on what name structure you have now and what you want it to be.  The screenshot only shows the top level directory, i.e. the hostnames.  It would be helpful to see the subdirectories under a hostname.
The target_replace examples are scarce.  I have a simple setup using the CPU and Interface plugin, with the CSV plugin for output to a local directory.
Before:
└── localhost
         ├── cpu
         └── interface-eth0

I put the following test configuration in place, which replaces my 'localhost' hostname with a different host name, 'all_hosts':

LoadPlugin match_regex
LoadPlugin target_replace

<Chain "PreCache">
  <Rule "change_hostname">
    <Match "regex">
     Host "^localhost.*"
    </Match>
    <Target "replace">
      Host "\\<localhost<file:///\\%3clocalhost>" "all_hosts"
     </Target>
    </Rule>
   Target "write"
 </Chain>
# This should be default, but putting in for backwards compatibility
 <Chain "PostCache">
 Target "write"
 </Chain>

After:
.
 ├── all_hosts
 │       ├── cpu
 │       └── interface-eth0
 └── localhost
          ├── cpu
          └── interface-eth0
The idea here is to replace the values before they make it into the global cache.

Hope that helps.
Giovanni
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20160129/a8b022b6/attachment.html>


More information about the collectd mailing list