Merge branch 'ff/rrdqueue'
[collectd.git] / src / collectd-exec.pod
1 =head1 NAME
2
3 collectd-exec - Documentation of collectd's C<exec plugin>
4
5 =head1 SYNOPSIS
6
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>
14
15 =head1 DESCRIPTION
16
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 fashion 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>.
22
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)>.
25
26 =head1 DATA FORMAT
27
28 The forked executable is expected to print values to C<STDOUT>. The expected
29 format is as follows:
30
31 =over 4
32
33 =item
34
35 Each line beginning with a C<#> (hash mark) is ignored.
36
37 =item
38
39 Other lines must consist of an I<Identifier> and a I<Value-List>, separated by
40 a space. A description of these two parts follows:
41
42 An I<Identifier> is of the form
43 C<I<host>B</>I<plugin>B<->I<instance>B</>I<type>B<->I<instance>> with both
44 I<instance>-parts being optional. If they're omitted the hyphen must be
45 omitted, too.
46
47 A I<Value-List> is a colon-separated list of values, prepended by the time
48 stamp in epoch, i.E<nbsp>e. the same format RRDTool uses, see L<rrdupdate(1)>.
49 As with the argument passed to RRDTool you can use B<N> as the current time and
50 B<U> for undefined values. However, undefined values can only passed for
51 B<GAUGE> values. When setting B<U> for a B<COUNTER> data source the behavior is
52 undefined.
53
54 Since examples usually let one understand a lot better, here are some:
55
56   leeloo/cpu-0/cpu-idle N:2299366
57   alice/interface/if_octets-eth0 1180647081:421465:479194
58
59 =back
60
61 When collectd exits it sends a B<SIGTERM> to all still running
62 child-processes upon which they have to quit.
63
64 =head1 CAVEATS
65
66 =over 4
67
68 =item
69
70 If the executable only writes one value and then exits I will be executed every
71 I<Interval> seconds. If I<Interval> is short (the default is 10 seconds) this
72 may result in serious system load.
73
74 =item
75
76 The user, the binary is executed as, may not have root privileges, i.E<nbsp>e.
77 must have an UID that is non-zero.
78
79 =back
80
81 =head1 SEE ALSO
82
83 L<collectd(1)>,
84 L<collectd.conf(5)>,
85 L<collectd-perl(5)>,
86 L<collectd-unixsock(5)>,
87 L<fork(2)>, L<exec(3)>
88
89 =head1 AUTHOR
90
91 Florian Forster E<lt>octo@verplant.orgE<gt>
92
93 =cut