X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcollectd.pod;h=6d29804981e4b72ec04b0a40bfbc35b31a113f91;hb=4059b7f729ee092d59d41a92804c83c1dd0d5332;hp=96c3fcdb43632cb9460c64a138be11ce1ee63375;hpb=1e7a1563af4e3a82e2f2e017dcabe9616624175d;p=collectd.git diff --git a/src/collectd.pod b/src/collectd.pod index 96c3fcdb..6d298049 100644 --- a/src/collectd.pod +++ b/src/collectd.pod @@ -76,6 +76,10 @@ NFS utilization (I, Linux only) =item +Embedded Perl interpreter (I) + +=item + Network latency (I) =item @@ -219,6 +223,39 @@ Successful spam checks (e.g. "BAYES_99", "SUBJECT_DRUG_GAP_C", ...): Each line is limited to 256 characters (including the newline character). Longer lines will be ignored. +=head2 exec + +The C plugin forks of an executable and reads back values that it writes +to C. The executable is forked kind of as L does: It is forked +once and not again until it exits. If it exited, it will be forked again after +at most I seconds. It is perfectly legal for the executable to run +for a long time and continuously write values to C. + +The forked executable is expected to print values to C. The expected +format is as follows: + +=over 4 + +=item + +Each line beginning with a C<#> (hash mark) is ignored. + +=item + +Any other line must be of the form C,I,I>, where +I is either B or B, I may not contain +C<,> (comma), C (slash) and C<\0> (null byte) and I is either an +integer (if I is B) or a floating-point number (if I is +B). + +=back + +The values are always considered to be "fresh", i.Ee. the time is set to +"now". + +When collectd exits it sends a B to all still running +child-processes upon which they have to quit. + =head2 mysql Requires B to be installed. It connects to the database when @@ -233,6 +270,133 @@ C are put in F and values of C are put in F. Please refer to the B, I<5.2.4. Server Status Variables> for an explanation of these values. +=head2 perl + +The C includes a Perl-interpreter in collectd and provides +Perl-equivalents of the plugin-functions. This makes it possible to write +plugins in Perl. + +There are two more complex types you need to know about: + +=over 4 + +=item Data-Set + +A data-set is a list of one or more data-sources. Each data-source defines a +name, type, min- and max-value and the data-set wraps them up into one +structure. The general layout looks like this: + + [{ + name => 'data_source_name', + type => DS_TYPE_COUNTER || DS_TYPE_GAUGE + min => value || undef, + max => value || undef + }, ...] + +=item Value-List + +A value-list is one structure which features an array of values and fields to +identify the values, i. e. time and host, plugin name and plugin-instance as +well as a type and type-instance. Since the "type" is not included in the +value-list but is passed as an extra argument, the general layout looks like +this: + + { + values => [123, 0.5], + time => time (), + host => 'localhost', + plugin => 'myplugin', + plugin_instance => '', + type_instance => '' + } + +=back + +The following functions provide the C-interface to Perl-modules: + +=over 4 + +=item B (I, I, I) + +Registers a callback-function or data-set. + +I can be one of: + +=over 4 + +=item TYPE_INIT + +=item TYPE_READ + +=item TYPE_WRITE + +=item TYPE_LOG + +=item TYPE_SHUTDOWN + +=item TYPE_DATASET + +=back + +I is the name of the callback-function or the type of the data-set, +depending on the value of I. (Please note that the type of the data-set +is the value passed as I here and has nothing to do with the I +argument which simply tells B what is being registered.) + +The last argument, I, is either a function- or an array-reference. If +I is B, then the I argument must be an +array-reference which points to an array of hashes. Each hash describes one +data-source. For the exact layout see B above. + +If the I argument is any of the other types (B, B, +...) then I is expected to be a function reference. These functions are +called in the various stages of the daemon and are passed the following +arguments: + +=over 4 + +=item TYPE_INIT + +=item TYPE_READ + +=item TYPE_SHUTDOWN + +No arguments are passed + +=item TYPE_WRITE + +The arguments passed are I, I, and I. I is a +string. For the layout of I and I see above. + +=item TYPE_LOG + +The arguments are I and I. The log level is small for +important messages and high for less important messages. The least important +level is B, the most important level is B. In between there +are (from least to most important): B, B, and +B. I is simply a string B a newline at the end. + +=back + +=item B (I, I) + +Removes a callback or data-set from collectd's internal list of +functionsE/ datasets. + +=item B (I, I) + +Submits a I of type I to the daemon. If the data-set I +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. + +=item B (I, I) + +Submits a I of level I to collectd's logging mechanism. +The message is passed to all log-callbacks that are registered with collectd. + +=back + =head2 sensors The B module uses lm_sensors to retrieve sensor-values. This means