Code

Merge branch 'pull/master'
[collectd.git] / src / collectd-exec.pod
1 =head1 NAME
3 collectd-exec - Documentation of collectd's C<exec plugin>
5 =head1 SYNOPSIS
7   # See collectd.conf(5)
8   LoadPlugin exec
9   # ...
10   <Plugin exec>
11     Exec myuser myprog
12     Exec otheruser /path/to/another/binary
13   </Plugin>
15 =head1 DESCRIPTION
17 The C<exec plugin> forks of an executable and reads back values that it writes
18 to C<STDOUT>. The executable is forked in a fassion similar to L<init>: It is
19 forked once and not again until it exits. If it exited, it will be forked again
20 after at most I<Interval> seconds. It is perfectly legal for the executable to
21 run for a long time and continuously write values to C<STDOUT>.
23 If you want/need better performance or more functionality you should take a
24 long look at the C<perl plugin>, L<collectd-perl(5)>.
26 =head1 DATA FORMAT
28 The forked executable is expected to print values to C<STDOUT>. The expected
29 format is as follows:
31 =over 4
33 =item
35 Each line beginning with a C<#> (hash mark) is ignored.
37 =item
39 Any other line must be of the form C<I<type>,I<type-instance>,I<value>>, where
40 I<type> is either B<counter> or B<gauge>, I<type-instance> may not contain
41 C<,> (comma), C</> (slash) and C<\0> (null byte) and I<value> is either an
42 integer (if I<type> is B<counter>) or a floating-point number (if I<type> is
43 B<gauge>).
45 =back
47 The values are always considered to be "fresh", i.E<nbsp>e. the time is set to
48 "now".
50 When collectd exits it sends a B<SIGTERM> to all still running
51 child-processes upon which they have to quit.
53 =head1 CAVEATS
55 =over 4
57 =item
59 If the executable only writes one value and then exits I will be executed every
60 I<Interval> seconds. If I<Interval> is short (the default is 10 seconds) this
61 may result in serious system load.
63 =item
65 The user, the binary is executed as, may not have root privileges, i.E<nbsp>e.
66 must have an UID that is non-zero.
68 =back
70 =head1 SEE ALSO
72 L<collectd(1)>,
73 L<collectd.conf(5)>,
74 L<collectd-perl(5)>,
75 L<fork(2)>, L<exec(3)>
77 =head1 AUTHOR
79 Florian Forster E<lt>octo@verplant.orgE<gt>
81 =cut