Josh Behrends | 22 Jun 2012 22:52
Picon

Filter chains and GenericJMX plugin. Help Needed

Hello,


I'm looking for some help!  I'm using Collectd 5.1.0 to collect JMX metrics using the GenericJMX plugin and then sending the metrics over to Graphite.   The issue I'm having is I need to rename the metric "Type" that's being sent to graphite.  The format Collectd is currently sending:  <MachineName>.GenericJMX.<InstanceName>.<Type>.<TypeInstance>  The "Type" can change between JMX attribute being collected so metric storage in Graphite can get messy.  So I'd like to take the "Type" and just rename it to something friendly vs gauge,counter,ect..

I've attempted to use collectd filter chains without any luck.  Each time I've attempted to use the replace target to replace the Type name I get the following error:

-Filter subsystem: Failed to create a replace target.
-Target `replace': The `Type' configuration option is not understood and will be ignored.
-Target `replace': You need to set at lease one of `Host', `Plugin', `PluginInstance', `Type', or `TypeInstance'.

I'm guessing this is just a matter of me not quiet understanding how filter chains work.  Any help or examples would be very much appreciated!  Below is an example of what I'm trying to do:

LoadPlugin "match_regex"
LoadPlugin "target_replace"
 <Chain "PostCache">
   <Rule "replace_type">
     <Match "regex">
       Plugin "^GenericJMX$"
       Type "^gauge$"
     </Match>
        <Target "replace">
          Type "gauge" "test"
        </Target>
     Target "stop"
   </Rule>
   Target "write"
 </Chain>


Thanks!
--
Josh
_______________________________________________
collectd mailing list
collectd@...
http://mailman.verplant.org/listinfo/collectd
Marc Fournier | 24 Jun 2012 20:43
Favicon

Re: Filter chains and GenericJMX plugin. Help Needed

Hello,

Excerpts from Josh Behrends's message of Fri Jun 22 22:52:33 +0200 2012:
> Hello,
> 
> I'm looking for some help!  I'm using Collectd 5.1.0 to collect JMX metrics
> using the GenericJMX plugin and then sending the metrics over to Graphite.
>   The issue I'm having is I need to rename the metric "Type" that's being
> sent to graphite.  The format Collectd is currently sending:
>  <MachineName>.GenericJMX.<InstanceName>.<Type>.<TypeInstance>  The "Type"
> [...]

I have no experience with collectd's Filter mechanism, but I've done
something similar to what you describe using carbon's rewrite feature.

Have a look at conf/rewrite-rules.conf.example in your carbon installation.
NB: you'll need to have the carbon aggregator service running to use this.

Hope this helps !

Cheers,
Marc
Fabien | 25 Jun 2012 14:20

Re: Filter chains and GenericJMX plugin. Help Needed

Hi,

On Fri, Jun 22, 2012 at 01:52:33PM -0700, Josh Behrends wrote:
> 
> -Filter subsystem: Failed to create a replace target.
> -Target `replace': The `Type' configuration option is not understood and
> will be ignored.
> -Target `replace': You need to set at lease one of `Host', `Plugin',
> `PluginInstance', `Type', or `TypeInstance'.

Reading from the documentation, it's not possible to set or replace the
Type. This is presumably because types are generally incompatible.
Further investigation shows the corresponding code has been commented out
back in 2008. However, the error message has not been modified accordingly
and is, indeed misleading. You're welcome to submit an issue on github about
that, or I can do it for you.

Long story short answer: if you really need the functionality and know what
you're doing, uncomment the corresponding code and rebuild.

Cheers

Gmane