From collectd Wiki
Revision as of 10:41, 21 May 2015 by Octo (talk | contribs) (Relicensed to MIT license.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Perl plugin
Type: binding
Callbacks: config, flush, init, log, notification, read, shutdown, write
Status: supported
First version: 4.0
Copyright: 2007–2009 Sebastian Harl
License: MIT license
Manpage: collectd-perl(5)
List of Plugins


The Perl plugin embeds a Perl interpreter into collectd and exposes the application programming interface (API) to Perl-scripts. This allows to write own plugins in the popular scripting language, which are then loaded and executed by the daemon without the need to start a new process and interpreter every few seconds. Perl-modules written for the Perl plugin are therefore more powerful and efficient than scripts executed by the Exec plugin.

This plugin is a generic plugin, i.e. it cannot work without configuration, because there is no reasonable default behavior. Please read the Plugin perl section of the collectd.conf(5) manual page for an in-depth description of the plugin's configuration. Most aspects of the Perl plugin are documented in the collectd-perl(5) manual page.


# See "Caveats" below.
<LoadPlugin perl>
  Globals true
<Plugin perl>
  IncludeDir "/path/to/perl/plugins"
  BaseName "Collectd::Plugins"
  EnableDebugger ""
  LoadPlugin "FooBar"

  <Plugin FooBar> 
    Foo "Bar"



If using versions 4.9 or 4.10, be sure to load the Perl plugin with the Globals option set to true. Otherwise some Perl module will not work properly or at all. The appropriate configuration for loading the Perl plugin is:

<LoadPlugin "perl">
  Globals true

Versions before 4.9 don't support this option; you'll have to compile with global visibility of symbols if you want to use certain Perl modules. Version 5.0 and later will automatically set this flag for the Perl plugin, so the above syntax isn't required but still legal.


  • libperl

See also