[collectd] How to reorganize metric tree in a "collectd -> graphite" platform

Toni Moreno toni.moreno at gmail.com
Tue Nov 5 15:49:24 CET 2013


Good Morning .

We have plans to test different tools to get performance data for a lot of
servers, and we would like to use collectd and graphite to do it.

The main goal of this test is to be able to reorganize the metric tree in
graphite by servername and after "product"

We wish this kind of tree:


<server_name>/<product>/<product-instance>/<type>-<typeinstance>


where product can be: "system" (for os), "apache", "weblogic", "websphere",
"oracle", etc.

By exemple

serverpro01/system/df/XXXXXX
serverpro01/system/cpu/XXXXXX
serverpro01/system/memory/XXXXXX
serverpro01/apache/<apache-www-mysite-com-80>/XXXXXX
serverpro01/apache/<apache-www-othersite-com-81>/XXXXXX






We have achieved it  by replacing "plugin" names by "<poroduct>/<plugin>"
 in the  PreCacheChain Rules:


by example:


PreCacheChain "ReName"
<Chain "ReName">
   <Rule "rename_processes">
     <Target "replace">
        Plugin  "\\<processes\\>" "system/processes"
     </Target>
   </Rule>

   <Rule "rename_disk">
     <Target "replace">
        Plugin  "\\<disk\\>" "system/disk"
     </Target>
   </Rule>

   <Rule "rename_cpu">
     <Target "replace">
        Plugin  "\\<cpu\\>" "system/cpu"
     </Target>
   </Rule>
..
..
</Chain>




You can see the results in the attached picture ( with
 SeparateInstances=true in the write_graphite configuration)



The problem comes when I would like to use one plugin ( by example tail) to
add metrics over any "product" ,

by example:


1.- Parsing /var/log/messages we would like to add metrigs over "system"


serverpro01/system/errors/<metric-name>


2.- Parsing /var/log/httpd/{access/error}-www-mysite-80.log  we would like
add metrics below an apache instance


serverpro01/apache/<apache-www-othersite-com-81>/<metric-name>


3.- Parsing /var/log/httpd/{access/error}-access-www-mysite-81.log we would
like add metrics below an other apache instance:

serverpro01/apache/<apache-www-othersite-com-81>/<metric-name>


4.-  Parsing /oracle/app/oracle/diag/rdbms/PROD/PROD/trace/alert_PROD.log
we would like to add metrics below an oracle instance

     serverpro01/oracle/<oracle-db_1>/<metric-name>


I've tried with PreCache and PostCache Chains but I have not found any way
to do Replace  with memory like other regex tools  does


 <Rule "rename_tail">
    <Target "replace">
      Plugin  "\\<tail\\>" ""                         <--doesn't work
      PluginInstance "\\<apache_*(.*)*>\\" "apache/\1"  <--doesn't work
    </Target>
   </Rule>




How can do that?

Any help would be appreciated !!

Thanks a lot!!



-- 

Att

Toni Moreno

699706656



*Si no quieres perderte en el olvido tan pronto como estés muerto y
corrompido, *

*escribe cosas dignas de leerse, o haz cosas dignas de escribirse.*



*Benjamin Franklin*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20131105/3df09e73/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: collectd_graphite_tree.jpg
Type: image/jpeg
Size: 21585 bytes
Desc: not available
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20131105/3df09e73/attachment-0001.jpg>


More information about the collectd mailing list