<div dir="ltr">Good Morning . <div><br></div><div>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.</div><div><br></div><div>The main goal of this test is to be able to reorganize the metric tree in graphite by servername and after "product" <div>
<br></div><div>We wish this kind of tree:</div><div><br></div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font face="courier new, monospace"><server_name>/<product>/<product-instance>/<type>-<typeinstance></font></div>
</blockquote><div><br></div><div>where product can be: "system" (for os), "apache", "weblogic", "websphere", "oracle", etc.</div><div><br></div><div>By exemple</div><div><br>
</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font face="courier new, monospace">serverpro01/system/df/XXXXXX</font></div><div><font face="courier new, monospace">serverpro01/system/cpu/XXXXXX</font></div>
<div><font face="courier new, monospace">serverpro01/system/memory/XXXXXX</font></div><div><div><font face="courier new, monospace">serverpro01/apache/<apache-www-mysite-com-80>/XXXXXX</font></div></div><div><font face="courier new, monospace">serverpro01/apache/<apache-www-othersite-com-81>/XXXXXX</font></div>
</blockquote><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>We have achieved it by replacing "plugin" names by "<poroduct>/<plugin>" in the PreCacheChain Rules:</div>
<div><br></div><div><br></div><div>by example:</div><div><br></div><div><br></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div><font face="courier new, monospace">PreCacheChain "ReName"</font></div>
</div></div><div><div><div><font face="courier new, monospace"><Chain "ReName"></font></div></div></div><div><div><div><font face="courier new, monospace"> <Rule "rename_processes"></font></div>
</div></div><div><div><div><font face="courier new, monospace"> <Target "replace"></font></div></div></div><div><div><div><font face="courier new, monospace"> Plugin "\\<processes\\>" "system/processes"</font></div>
</div></div><div><div><div><font face="courier new, monospace"> </Target></font></div></div></div><div><div><div><font face="courier new, monospace"> </Rule></font></div></div></div><div><div><div><font face="courier new, monospace"><br>
</font></div></div></div><div><div><div><font face="courier new, monospace"> <Rule "rename_disk"></font></div></div></div><div><div><div><font face="courier new, monospace"> <Target "replace"></font></div>
</div></div><div><div><div><font face="courier new, monospace"> Plugin "\\<disk\\>" "system/disk"</font></div></div></div><div><div><div><font face="courier new, monospace"> </Target></font></div>
</div></div><div><div><div><font face="courier new, monospace"> </Rule></font></div></div></div><div><font face="courier new, monospace"><br></font></div><div><div><div><font face="courier new, monospace"> <Rule "rename_cpu"></font></div>
</div></div><div><div><div><font face="courier new, monospace"> <Target "replace"></font></div></div></div><div><div><div><font face="courier new, monospace"> Plugin "\\<cpu\\>" "system/cpu"</font></div>
</div></div><div><div><div><font face="courier new, monospace"> </Target></font></div></div></div><div><div><div><font face="courier new, monospace"> </Rule></font></div></div></div><div><div><font face="courier new, monospace">..</font></div>
</div><div><div><font face="courier new, monospace">..</font></div></div><div><div><font face="courier new, monospace"></Chain></font></div></div></blockquote><div><div><font face="courier new, monospace"><br></font></div>
<div><font face="courier new, monospace"><br></font></div><div><br></div><div><div>You can see the results in the attached picture ( with SeparateInstances=true in the write_graphite configuration)</div><div><br></div>
<div><br></div><div><br></div><div>The problem comes when I would like to use one plugin ( by example tail) to add metrics over any "product" ,</div><div><br></div><div>by example:</div><div><br></div><div><br></div>
<div><font face="arial, helvetica, sans-serif">1.- Parsing /var/log/messages we would like to add metrigs over "system"</font></div><div><br></div><div><br></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div><div><div><span style="font-family:'courier new',monospace">serverpro01/system/errors/<metric-name></span></div></div></div></blockquote><div><div><div><span style="font-family:'courier new',monospace"><br>
</span></div><div><font face="arial, helvetica, sans-serif">2.- Parsing /var/log/httpd/{access/error}-www-mysite-80.log we would like add metrics below an apache instance</font></div><div><font face="arial, helvetica, sans-serif"><br>
</font></div><div><span style="font-family:'courier new',monospace"><br></span></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div><span style="font-family:'courier new',monospace">serverpro01/apache/<apache-www-othersite-com-81>/<metric-name></span></div>
</div></div></blockquote><div><div><div><span style="font-family:'courier new',monospace"><br></span></div><div><font face="arial, helvetica, sans-serif">3.- Parsing /var/log/httpd/{access/error}-access-www-mysite-81.log we would like add metrics below an other apache instance:</font></div>
<div><span style="font-family:'courier new',monospace"><br></span></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><div><span style="font-family:'courier new',monospace">serverpro01/apache/<apache-www-othersite-com-81>/<metric-name></span></div>
</div></div></blockquote><div><div><br></div><div>4.- <font color="#000000">Parsing <span style="font-style:inherit;line-height:19px">/oracle/app/oracle/diag/rdbms/PROD/PROD/trace/alert_PROD.log we would </span><span style="line-height:19px">like</span><span style="font-style:inherit;line-height:19px"> to add metrics below an oracle instance</span></font></div>
<div><span style="font-family:'courier new',monospace"> </span></div><div><span style="font-family:'courier new',monospace"> serverpro01/oracle/<oracle-db_1>/<metric-name></span><br></div><div>
<span style="font-family:'courier new',monospace"><br></span></div><div><span style="font-style:inherit;color:rgb(87,87,87);font-size:13px;line-height:19px"><br></span></div><div>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</div>
<div><br></div><div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><div><font face="courier new, monospace"> <Rule "rename_tail"></font></div></div></div><div><div>
<div><font face="courier new, monospace"> <Target "replace"></font></div></div></div><div><div><div><font face="courier new, monospace"> Plugin "\\<tail\\>" "" <--doesn't work</font></div>
</div></div><div><div><div><font face="courier new, monospace"> PluginInstance "\\<apache_<b style="background-color:rgb(255,255,0)">(.*)</b>>\\" "apache/<span style="background-color:rgb(255,255,0)">\1</span>" <--doesn't work</font></div>
</div></div><div><div><div><font face="courier new, monospace"> </Target></font></div></div></div><div><div><div><font face="courier new, monospace"> </Rule></font></div></div></div><div><div><br></div></div>
</blockquote><div><div><br></div><div><br></div><div><br></div><div>How can do that?</div><div><br></div><div>Any help would be appreciated !!</div><div><br></div><div>Thanks a lot!!</div><div><br></div><div><br></div><div>
<br></div>-- <br><p align="right"><font face="Verdana, Geneva, Arial, Sans-serif">Att</font></p>
<p align="right"><font face="Verdana, Geneva, Arial, Sans-serif">Toni Moreno</font></p>
<p align="right"><font face="Verdana, Geneva, Arial, Sans-serif">699706656</font></p><img src="http://graphics.hotmail.com/greypixel.gif" height="2" vspace="9" width="100%"><br>
<p align="right"><em>Si no quieres perderte en el olvido tan pronto como estés muerto y corrompido, </em></p>
<p align="right"><em>escribe cosas dignas de leerse, o haz cosas dignas de escribirse.</em></p>
<p align="right"> </p>
<p align="right"><strong><em>Benjamin Franklin</em></strong> <br></p>
</div></div>