X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fcollectd-perl.pod;h=38d790e9b19307bf7db402a65adf1f6696b2aae5;hp=5637053360da8f0d7060f24f5264f6702c808592;hb=633c3966f770e4d46651a2fe219a18d8a9907a9f;hpb=593ea76dca367478b92e17f91e663fe7c67b4df9 diff --git a/src/collectd-perl.pod b/src/collectd-perl.pod index 56370533..38d790e9 100644 --- a/src/collectd-perl.pod +++ b/src/collectd-perl.pod @@ -1,10 +1,14 @@ +=encoding UTF-8 + =head1 NAME collectd-perl - Documentation of collectd's C =head1 SYNOPSIS - LoadPlugin perl + + Globals true + # ... IncludeDir "/path/to/perl/plugins" @@ -25,6 +29,12 @@ for collectd in Perl. This is a lot more efficient than executing a Perl-script every time you want to read a value with the C (see L) and provides a lot more functionality, too. +When loading the C, the B option should be enabled. +Else, the perl plugin will fail to load any Perl modules implemented in C, +which includes, amongst many others, the B module used by the plugin +itself. See the documentation of the B option in L +for details. + =head1 CONFIGURATION =over 4 @@ -200,7 +210,7 @@ layout looks like this: { values => [123, 0.5], time => time (), - interval => $interval_g, + interval => plugin_get_interval (), host => $hostname_g, plugin => 'myplugin', type => 'myplugin', @@ -368,11 +378,6 @@ is found (and the number of values matches the number of data-sources) then the type, data-set and value-list is passed to all write-callbacks that are registered with the daemon. -B: Prior to version 4.4 of collectd, the data-set type used to be passed -as the first argument to B. This syntax is still supported -for backwards compatibility but has been deprecated and will be removed in -some future version of collectd. - =item B ([B => I<...>][, B => I<...>], B => I<...>) @@ -397,23 +402,6 @@ argument has been specified, only named plugins will be flushed. The value of the B and B arguments may either be a string or a reference to an array of strings. -=item B (I, I) - -This is identical to using "plugin_flush (timeout =E I, plugins -=E I". - -B: Starting with version 4.5 of collectd, B has been -deprecated and will be removed in some future version of collectd. Use -B instead. - -=item B (I) - -This is identical to using "plugin_flush (timeout =E I)". - -B: Starting with version 4.5 of collectd, B has been -deprecated and will be removed in some future version of collectd. Use -B instead. - =item B (I) Submits a I to the daemon which will then pass it to all @@ -429,6 +417,13 @@ The message is passed to all log-callbacks that are registered with collectd. Wrappers around B, using B, B, B, B and B respectively as I. +=item B () + +Returns the interval of the current plugin as a floating point number in +seconds. This value depends on the interval configured within the +C block or the global interval (see L for +details). + =back The following function provides the filter chain C-interface to Perl-modules. @@ -508,6 +503,11 @@ B configuration options (see L for details). This variable keeps the interval in seconds in which the read functions are queried (see the B configuration option). +B This variable should no longer be used in favor of +C (see above). This function takes any plugin-specific +interval settings into account (see the C option of C in +L for details). + =back Any changes to these variables will be globally visible in collectd. @@ -670,9 +670,9 @@ A very simple read function might look like: sub foobar_read { - my $vl = { plugin => 'foobar' }; + my $vl = { plugin => 'foobar', type => 'gauge' }; $vl->{'values'} = [ rand(42) ]; - plugin_dispatch_values ('gauge', $vl); + plugin_dispatch_values ($vl); return 1; } @@ -716,7 +716,7 @@ types used by the read, write and match functions. =item Please feel free to send in new plugins to collectd's mailing list at -EcollectdEatEverplant.orgE for review and, possibly, +EcollectdEatEcollectd.orgE for review and, possibly, inclusion in the main distribution. In the latter case, we will take care of keeping the plugin up to date and adapting it to new versions of collectd. @@ -796,7 +796,7 @@ The C has been written by Sebastian Harl EshEatEtokkee.orgE. This manpage has been written by Florian Forster -EoctoEatEverplant.orgE and Sebastian Harl +EoctoEatEcollectd.orgE and Sebastian Harl EshEatEtokkee.orgE. =cut