[collectd] Collectd complex perl plugin question ...

Fabien Wernli collectd at faxm0dem.org
Wed Apr 4 15:16:18 CEST 2012


Hi,

On Wed, Apr 04, 2012 at 12:53:18PM +0000, Sebastien Cramatte wrote:
> Thanks a lot for snippet.
> I've still have an issue :(
> 
> "Found a configuration for the "Mine" plugin, but the plugin isn't loaded
> or didn't register a configuration callback."
> 
> In my plugin source I've got this line ...
> 
> plugin_register (TYPE_CONFIG, "mine", "mine_config");
> 
> 
> 
> Any Idea  of what occurs ?

Yes I scratched my head quite a bit on that one :-)
The BaseName/LoadPlugin directive will select the right perl Module.
The <Plugin ...> directive refers to the plugin_register() callback's plugin name.

If your __PACKAGE__ is Collectd::Plugins::Mine, and is calling plugin_register ([...], "mine")
you need something like:

--
<LoadPlugin "perl">
  Globals true
</LoadPlugin>

<Plugin "perl">
  BaseName "Collectd::Plugins"
  LoadPlugin "Mine"
[... this will look for PERL5LIB(s).../Collectd/Plugins/Mine.pm ...]
  <Plugin "mine">
[... this will register with the plugin called "mine" ...]
    Interval    300
[...]
  </Plugin>
</Plugin>




More information about the collectd mailing list