Code

Merge branch 'collectd-5.2' into collectd-5.3
[collectd.git] / src / collectd.conf.pod
1 =encoding UTF-8
3 =head1 NAME
5 collectd.conf - Configuration for the system statistics collection daemon B<collectd>
7 =head1 SYNOPSIS
9   BaseDir "/path/to/data/"
10   PIDFile "/path/to/pidfile/collectd.pid"
11   Server  "123.123.123.123" 12345
12   
13   LoadPlugin cpu
14   LoadPlugin load
15   
16   <LoadPlugin df>
17     Interval 3600
18   </LoadPlugin>
19   
20   LoadPlugin ping
21   <Plugin ping>
22     Host "example.org"
23     Host "provider.net"
24   </Plugin>
26 =head1 DESCRIPTION
28 This config file controls how the system statistics collection daemon
29 B<collectd> behaves. The most significant option is B<LoadPlugin>, which
30 controls which plugins to load. These plugins ultimately define collectd's
31 behavior.
33 The syntax of this config file is similar to the config file of the famous
34 I<Apache> webserver. Each line contains either an option (a key and a list of
35 one or more values) or a section-start or -end. Empty lines and everything
36 after a non-quoted hash-symbol (C<#>) is ignored. I<Keys> are unquoted
37 strings, consisting only of alphanumeric characters and the underscore (C<_>)
38 character. Keys are handled case insensitive by I<collectd> itself and all
39 plugins included with it. I<Values> can either be an I<unquoted string>, a
40 I<quoted string> (enclosed in double-quotes) a I<number> or a I<boolean>
41 expression. I<Unquoted strings> consist of only alphanumeric characters and
42 underscores (C<_>) and do not need to be quoted. I<Quoted strings> are
43 enclosed in double quotes (C<">). You can use the backslash character (C<\>)
44 to include double quotes as part of the string. I<Numbers> can be specified in
45 decimal and floating point format (using a dot C<.> as decimal separator),
46 hexadecimal when using the C<0x> prefix and octal with a leading zero (C<0>).
47 I<Boolean> values are either B<true> or B<false>.
49 Lines may be wrapped by using C<\> as the last character before the newline.
50 This allows long lines to be split into multiple lines. Quoted strings may be
51 wrapped as well. However, those are treated special in that whitespace at the
52 beginning of the following lines will be ignored, which allows for nicely
53 indenting the wrapped lines.
55 The configuration is read and processed in order, i.e. from top to bottom. So
56 the plugins are loaded in the order listed in this config file. It is a good
57 idea to load any logging plugins first in order to catch messages from plugins
58 during configuration. Also, the C<LoadPlugin> option B<must> occur B<before>
59 the appropriate C<E<lt>Plugin ...E<gt>> block.
61 =head1 GLOBAL OPTIONS
63 =over 4
65 =item B<BaseDir> I<Directory>
67 Sets the base directory. This is the directory beneath all RRD-files are
68 created. Possibly more subdirectories are created. This is also the working
69 directory for the daemon.
71 =item B<LoadPlugin> I<Plugin>
73 Loads the plugin I<Plugin>. There must be at least one such line or B<collectd>
74 will be mostly useless.
76 Starting with collectd 4.9, this may also be a block in which further options
77 affecting the behavior of B<LoadPlugin> may be specified. The following
78 options are allowed inside a B<LoadPlugin> block:
80   <LoadPlugin perl>
81     Globals true
82     Interval 10
83   </LoadPlugin>
85 =over 4
87 =item B<Globals> B<true|false>
89 If enabled, collectd will export all global symbols of the plugin (and of all
90 libraries loaded as dependencies of the plugin) and, thus, makes those symbols
91 available for resolving unresolved symbols in subsequently loaded plugins if
92 that is supported by your system.
94 This is useful (or possibly even required), e.g., when loading a plugin that
95 embeds some scripting language into the daemon (e.g. the I<Perl> and
96 I<Python plugins>). Scripting languages usually provide means to load
97 extensions written in C. Those extensions require symbols provided by the
98 interpreter, which is loaded as a dependency of the respective collectd plugin.
99 See the documentation of those plugins (e.g., L<collectd-perl(5)> or
100 L<collectd-python(5)>) for details.
102 By default, this is disabled. As a special exception, if the plugin name is
103 either C<perl> or C<python>, the default is changed to enabled in order to keep
104 the average user from ever having to deal with this low level linking stuff.
106 =item B<Interval> I<Seconds>
108 Sets a plugin-specific interval for collecting metrics. This overrides the
109 global B<Interval> setting. If a plugin provides own support for specifying an
110 interval, that setting will take precedence.
112 =back
114 =item B<Include> I<Path>
116 If I<Path> points to a file, includes that file. If I<Path> points to a
117 directory, recursively includes all files within that directory and its
118 subdirectories. If the C<wordexp> function is available on your system,
119 shell-like wildcards are expanded before files are included. This means you can
120 use statements like the following:
122   Include "/etc/collectd.d/*.conf"
124 Starting with version 5.3, this may also be a block in which further options
125 affecting the behavior of B<Include> may be specified. The following option is
126 currently allowed:
128   <Include "/etc/collectd.d">
129     Filter "*.conf"
130   </Include>
132 =over 4
134 =item B<Filter> I<pattern>
136 If the C<fnmatch> function is available on your system, a shell-like wildcard
137 I<pattern> may be specified to filter which files to include. This may be used
138 in combination with recursively including a directory to easily be able to
139 arbitrarily mix configuration files and other documents (e.g. README files).
140 The given example is similar to the first example above but includes all files
141 matching C<*.conf> in any subdirectory of C</etc/collectd.d>:
143   Include "/etc/collectd.d" "*.conf"
145 =back
147 If more than one files are included by a single B<Include> option, the files
148 will be included in lexicographical order (as defined by the C<strcmp>
149 function). Thus, you can e.E<nbsp>g. use numbered prefixes to specify the
150 order in which the files are loaded.
152 To prevent loops and shooting yourself in the foot in interesting ways the
153 nesting is limited to a depth of 8E<nbsp>levels, which should be sufficient for
154 most uses. Since symlinks are followed it is still possible to crash the daemon
155 by looping symlinks. In our opinion significant stupidity should result in an
156 appropriate amount of pain.
158 It is no problem to have a block like C<E<lt>Plugin fooE<gt>> in more than one
159 file, but you cannot include files from within blocks.
161 =item B<PIDFile> I<File>
163 Sets where to write the PID file to. This file is overwritten when it exists
164 and deleted when the program is stopped. Some init-scripts might override this
165 setting using the B<-P> command-line option.
167 =item B<PluginDir> I<Directory>
169 Path to the plugins (shared objects) of collectd.
171 =item B<TypesDB> I<File> [I<File> ...]
173 Set one or more files that contain the data-set descriptions. See
174 L<types.db(5)> for a description of the format of this file.
176 =item B<Interval> I<Seconds>
178 Configures the interval in which to query the read plugins. Obviously smaller
179 values lead to a higher system load produced by collectd, while higher values
180 lead to more coarse statistics.
182 B<Warning:> You should set this once and then never touch it again. If you do,
183 I<you will have to delete all your RRD files> or know some serious RRDtool
184 magic! (Assuming you're using the I<RRDtool> or I<RRDCacheD> plugin.)
186 =item B<Timeout> I<Iterations>
188 Consider a value list "missing" when no update has been read or received for
189 I<Iterations> iterations. By default, I<collectd> considers a value list
190 missing when no update has been received for twice the update interval. Since
191 this setting uses iterations, the maximum allowed time without update depends
192 on the I<Interval> information contained in each value list. This is used in
193 the I<Threshold> configuration to dispatch notifications about missing values,
194 see L<collectd-threshold(5)> for details.
196 =item B<ReadThreads> I<Num>
198 Number of threads to start for reading plugins. The default value is B<5>, but
199 you may want to increase this if you have more than five plugins that take a
200 long time to read. Mostly those are plugins that do network-IO. Setting this to
201 a value higher than the number of registered read callbacks is not recommended.
203 =item B<WriteThreads> I<Num>
205 Number of threads to start for dispatching value lists to write plugins. The
206 default value is B<5>, but you may want to increase this if you have more than
207 five plugins that may take relatively long to write to.
209 =item B<Hostname> I<Name>
211 Sets the hostname that identifies a host. If you omit this setting, the
212 hostname will be determined using the L<gethostname(2)> system call.
214 =item B<FQDNLookup> B<true|false>
216 If B<Hostname> is determined automatically this setting controls whether or not
217 the daemon should try to figure out the "fully qualified domain name", FQDN.
218 This is done using a lookup of the name returned by C<gethostname>. This option
219 is enabled by default.
221 =item B<PreCacheChain> I<ChainName>
223 =item B<PostCacheChain> I<ChainName>
225 Configure the name of the "pre-cache chain" and the "post-cache chain". Please
226 see L<FILTER CONFIGURATION> below on information on chains and how these
227 setting change the daemon's behavior.
229 =back
231 =head1 PLUGIN OPTIONS
233 Some plugins may register own options. These options must be enclosed in a
234 C<Plugin>-Section. Which options exist depends on the plugin used. Some plugins
235 require external configuration, too. The C<apache plugin>, for example,
236 required C<mod_status> to be configured in the webserver you're going to
237 collect data from. These plugins are listed below as well, even if they don't
238 require any configuration within collectd's configuration file.
240 A list of all plugins and a short summary for each plugin can be found in the
241 F<README> file shipped with the sourcecode and hopefully binary packets as
242 well.
244 =head2 Plugin C<aggregation>
246 The I<Aggregation plugin> makes it possible to aggregate several values into
247 one using aggregation functions such as I<sum>, I<average>, I<min> and I<max>.
248 This can be put to a wide variety of uses, e.g. average and total CPU
249 statistics for your entire fleet.
251 The grouping is powerful but, as with many powerful tools, may be a bit
252 difficult to wrap your head around. The grouping will therefore be
253 demonstrated using an example: The average and sum of the CPU usage across
254 all CPUs of each host is to be calculated.
256 To select all the affected values for our example, set C<Plugin cpu> and
257 C<Type cpu>. The other values are left unspecified, meaning "all values". The
258 I<Host>, I<Plugin>, I<PluginInstance>, I<Type> and I<TypeInstance> options
259 work as if they were specified in the C<WHERE> clause of an C<SELECT> SQL
260 statement.
262   Plugin "cpu"
263   Type "cpu"
265 Although the I<Host>, I<PluginInstance> (CPU number, i.e. 0, 1, 2, ...)  and
266 I<TypeInstance> (idle, user, system, ...) fields are left unspecified in the
267 example, the intention is to have a new value for each host / type instance
268 pair. This is achieved by "grouping" the values using the C<GroupBy> option.
269 It can be specified multiple times to group by more than one field.
271   GroupBy "Host"
272   GroupBy "TypeInstance"
274 We do neither specify nor group by I<plugin instance> (the CPU number), so all
275 metrics that differ in the CPU number only will be aggregated. Each
276 aggregation needs I<at least one> such field, otherwise no aggregation would
277 take place.
279 The full example configuration looks like this:
281  <Plugin "aggregation">
282    <Aggregation>
283      Plugin "cpu"
284      Type "cpu"
285      
286      GroupBy "Host"
287      GroupBy "TypeInstance"
288      
289      CalculateSum true
290      CalculateAverage true
291    </Aggregation>
292  </Plugin>
294 There are a couple of limitations you should be aware of:
296 =over 4
298 =item
300 The I<Type> cannot be left unspecified, because it is not reasonable to add
301 apples to oranges. Also, the internal lookup structure won't work if you try
302 to group by type.
304 =item
306 There must be at least one unspecified, ungrouped field. Otherwise nothing
307 will be aggregated.
309 =back
311 As you can see in the example above, each aggregation has its own
312 B<Aggregation> block. You can have multiple aggregation blocks and aggregation
313 blocks may match the same values, i.e. one value list can update multiple
314 aggregations. The following options are valid inside B<Aggregation> blocks:
316 =over 4
318 =item B<Host> I<Host>
320 =item B<Plugin> I<Plugin>
322 =item B<PluginInstance> I<PluginInstance>
324 =item B<Type> I<Type>
326 =item B<TypeInstance> I<TypeInstance>
328 Selects the value lists to be added to this aggregation. B<Type> must be a
329 valid data set name, see L<types.db(5)> for details.
331 If the string starts with and ends with a slash (C</>), the string is
332 interpreted as a I<regular expression>. The regex flavor used are POSIX
333 extended regular expressions as described in L<regex(7)>. Example usage:
335  Host "/^db[0-9]\\.example\\.com$/"
337 =item B<GroupBy> B<Host>|B<Plugin>|B<PluginInstance>|B<TypeInstance>
339 Group valued by the specified field. The B<GroupBy> option may be repeated to
340 group by multiple fields.
342 =item B<SetHost> I<Host>
344 =item B<SetPlugin> I<Plugin>
346 =item B<SetPluginInstance> I<PluginInstance>
348 =item B<SetTypeInstance> I<TypeInstance>
350 Sets the appropriate part of the identifier to the provided string.
352 The I<PluginInstance> should include the placeholder C<%{aggregation}> which
353 will be replaced with the aggregation function, e.g. "average". Not including
354 the placeholder will result in duplication warnings and/or messed up values if
355 more than one aggregation function are enabled.
357 The following example calculates the average usage of all "even" CPUs:
359  <Plugin "aggregation">
360    <Aggregation>
361      Plugin "cpu"
362      PluginInstance "/[0,2,4,6,8]$/"
363      Type "cpu"
364      
365      SetPlugin "cpu"
366      SetPluginInstance "even-%{aggregation}"
367      
368      GroupBy "Host"
369      GroupBy "TypeInstance"
370      
371      CalculateAverage true
372    </Aggregation>
373  </Plugin>
375 This will create the files:
377 =over 4
379 =item
381 foo.example.com/cpu-even-average/cpu-idle
383 =item
385 foo.example.com/cpu-even-average/cpu-system
387 =item
389 foo.example.com/cpu-even-average/cpu-user
391 =item
393 ...
395 =back
397 =item B<CalculateNum> B<true>|B<false>
399 =item B<CalculateSum> B<true>|B<false>
401 =item B<CalculateAverage> B<true>|B<false>
403 =item B<CalculateMinimum> B<true>|B<false>
405 =item B<CalculateMaximum> B<true>|B<false>
407 =item B<CalculateStddev> B<true>|B<false>
409 Boolean options for enabling calculation of the number of value lists, their
410 sum, average, minimum, maximum andE<nbsp>/ or standard deviation. All options
411 are disabled by default.
413 =back
415 =head2 Plugin C<amqp>
417 The I<AMQMP plugin> can be used to communicate with other instances of
418 I<collectd> or third party applications using an AMQP message broker. Values
419 are sent to or received from the broker, which handles routing, queueing and
420 possibly filtering or messages.
422  <Plugin "amqp">
423    # Send values to an AMQP broker
424    <Publish "some_name">
425      Host "localhost"
426      Port "5672"
427      VHost "/"
428      User "guest"
429      Password "guest"
430      Exchange "amq.fanout"
431  #   ExchangeType "fanout"
432  #   RoutingKey "collectd"
433  #   Persistent false
434  #   Format "command"
435  #   StoreRates false
436  #   GraphitePrefix "collectd."
437  #   GraphiteEscapeChar "_"
438    </Publish>
439    
440    # Receive values from an AMQP broker
441    <Subscribe "some_name">
442      Host "localhost"
443      Port "5672"
444      VHost "/"
445      User "guest"
446      Password "guest"
447      Exchange "amq.fanout"
448  #   ExchangeType "fanout"
449  #   Queue "queue_name"
450  #   RoutingKey "collectd.#"
451    </Subscribe>
452  </Plugin>
454 The plugin's configuration consists of a number of I<Publish> and I<Subscribe>
455 blocks, which configure sending and receiving of values respectively. The two
456 blocks are very similar, so unless otherwise noted, an option can be used in
457 either block. The name given in the blocks starting tag is only used for
458 reporting messages, but may be used to support I<flushing> of certain
459 I<Publish> blocks in the future.
461 =over 4
463 =item B<Host> I<Host>
465 Hostname or IP-address of the AMQP broker. Defaults to the default behavior of
466 the underlying communications library, I<rabbitmq-c>, which is "localhost".
468 =item B<Port> I<Port>
470 Service name or port number on which the AMQP broker accepts connections. This
471 argument must be a string, even if the numeric form is used. Defaults to
472 "5672".
474 =item B<VHost> I<VHost>
476 Name of the I<virtual host> on the AMQP broker to use. Defaults to "/".
478 =item B<User> I<User>
480 =item B<Password> I<Password>
482 Credentials used to authenticate to the AMQP broker. By default "guest"/"guest"
483 is used.
485 =item B<Exchange> I<Exchange>
487 In I<Publish> blocks, this option specifies the I<exchange> to send values to.
488 By default, "amq.fanout" will be used.
490 In I<Subscribe> blocks this option is optional. If given, a I<binding> between
491 the given exchange and the I<queue> is created, using the I<routing key> if
492 configured. See the B<Queue> and B<RoutingKey> options below.
494 =item B<ExchangeType> I<Type>
496 If given, the plugin will try to create the configured I<exchange> with this
497 I<type> after connecting. When in a I<Subscribe> block, the I<queue> will then
498 be bound to this exchange.
500 =item B<Queue> I<Queue> (Subscribe only)
502 Configures the I<queue> name to subscribe to. If no queue name was configures
503 explicitly, a unique queue name will be created by the broker.
505 =item B<RoutingKey> I<Key>
507 In I<Publish> blocks, this configures the routing key to set on all outgoing
508 messages. If not given, the routing key will be computed from the I<identifier>
509 of the value. The host, plugin, type and the two instances are concatenated
510 together using dots as the separator and all containing dots replaced with
511 slashes. For example "collectd.host/example/com.cpu.0.cpu.user". This makes it
512 possible to receive only specific values using a "topic" exchange.
514 In I<Subscribe> blocks, configures the I<routing key> used when creating a
515 I<binding> between an I<exchange> and the I<queue>. The usual wildcards can be
516 used to filter messages when using a "topic" exchange. If you're only
517 interested in CPU statistics, you could use the routing key "collectd.*.cpu.#"
518 for example.
520 =item B<Persistent> B<true>|B<false> (Publish only)
522 Selects the I<delivery method> to use. If set to B<true>, the I<persistent>
523 mode will be used, i.e. delivery is guaranteed. If set to B<false> (the
524 default), the I<transient> delivery mode will be used, i.e. messages may be
525 lost due to high load, overflowing queues or similar issues.
527 =item B<Format> B<Command>|B<JSON>|B<Graphite> (Publish only)
529 Selects the format in which messages are sent to the broker. If set to
530 B<Command> (the default), values are sent as C<PUTVAL> commands which are
531 identical to the syntax used by the I<Exec> and I<UnixSock plugins>. In this
532 case, the C<Content-Type> header field will be set to C<text/collectd>.
534 If set to B<JSON>, the values are encoded in the I<JavaScript Object Notation>,
535 an easy and straight forward exchange format. The C<Content-Type> header field
536 will be set to C<application/json>.
538 If set to B<Graphite>, values are encoded in the I<Graphite> format, which is
539 "<metric> <value> <timestamp>\n". The C<Content-Type> header field will be set to
540 C<text/graphite>.
542 A subscribing client I<should> use the C<Content-Type> header field to
543 determine how to decode the values. Currently, the I<AMQP plugin> itself can
544 only decode the B<Command> format.
546 =item B<StoreRates> B<true>|B<false> (Publish only)
548 Determines whether or not C<COUNTER>, C<DERIVE> and C<ABSOLUTE> data sources
549 are converted to a I<rate> (i.e. a C<GAUGE> value). If set to B<false> (the
550 default), no conversion is performed. Otherwise the conversion is performed
551 using the internal value cache.
553 Please note that currently this option is only used if the B<Format> option has
554 been set to B<JSON>.
556 =item B<GraphitePrefix> (Publish and B<Format>=I<Graphite> only)
558 A prefix can be added in the metric name when outputting in the I<Graphite> format.
559 It's added before the I<Host> name.
560 Metric name will be "<prefix><host><postfix><plugin><type><name>"
562 =item B<GraphitePostfix> (Publish and B<Format>=I<Graphite> only)
564 A postfix can be added in the metric name when outputting in the I<Graphite> format.
565 It's added after the I<Host> name.
566 Metric name will be "<prefix><host><postfix><plugin><type><name>"
568 =item B<GraphiteEscapeChar> (Publish and B<Format>=I<Graphite> only)
570 Specify a character to replace dots (.) in the host part of the metric name.
571 In I<Graphite> metric name, dots are used as separators between different
572 metric parts (host, plugin, type).
573 Default is "_" (I<Underscore>).
575 =back
577 =head2 Plugin C<apache>
579 To configure the C<apache>-plugin you first need to configure the Apache
580 webserver correctly. The Apache-plugin C<mod_status> needs to be loaded and
581 working and the C<ExtendedStatus> directive needs to be B<enabled>. You can use
582 the following snipped to base your Apache config upon:
584   ExtendedStatus on
585   <IfModule mod_status.c>
586     <Location /mod_status>
587       SetHandler server-status
588     </Location>
589   </IfModule>
591 Since its C<mod_status> module is very similar to Apache's, B<lighttpd> is
592 also supported. It introduces a new field, called C<BusyServers>, to count the
593 number of currently connected clients. This field is also supported.
595 The configuration of the I<Apache> plugin consists of one or more
596 C<E<lt>InstanceE<nbsp>/E<gt>> blocks. Each block requires one string argument
597 as the instance name. For example:
599  <Plugin "apache">
600    <Instance "www1">
601      URL "http://www1.example.com/mod_status?auto"
602    </Instance>
603    <Instance "www2">
604      URL "http://www2.example.com/mod_status?auto"
605    </Instance>
606  </Plugin>
608 The instance name will be used as the I<plugin instance>. To emulate the old
609 (versionE<nbsp>4) behavior, you can use an empty string (""). In order for the
610 plugin to work correctly, each instance name must be unique. This is not
611 enforced by the plugin and it is your responsibility to ensure it.
613 The following options are accepted within each I<Instance> block:
615 =over 4
617 =item B<URL> I<http://host/mod_status?auto>
619 Sets the URL of the C<mod_status> output. This needs to be the output generated
620 by C<ExtendedStatus on> and it needs to be the machine readable output
621 generated by appending the C<?auto> argument. This option is I<mandatory>.
623 =item B<User> I<Username>
625 Optional user name needed for authentication.
627 =item B<Password> I<Password>
629 Optional password needed for authentication.
631 =item B<VerifyPeer> B<true|false>
633 Enable or disable peer SSL certificate verification. See
634 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
636 =item B<VerifyHost> B<true|false>
638 Enable or disable peer host name verification. If enabled, the plugin checks
639 if the C<Common Name> or a C<Subject Alternate Name> field of the SSL
640 certificate matches the host name provided by the B<URL> option. If this
641 identity check fails, the connection is aborted. Obviously, only works when
642 connecting to a SSL enabled server. Enabled by default.
644 =item B<CACert> I<File>
646 File that holds one or more SSL certificates. If you want to use HTTPS you will
647 possibly need this option. What CA certificates come bundled with C<libcurl>
648 and are checked by default depends on the distribution you use.
650 =back
652 =head2 Plugin C<apcups>
654 =over 4
656 =item B<Host> I<Hostname>
658 Hostname of the host running B<apcupsd>. Defaults to B<localhost>. Please note
659 that IPv6 support has been disabled unless someone can confirm or decline that
660 B<apcupsd> can handle it.
662 =item B<Port> I<Port>
664 TCP-Port to connect to. Defaults to B<3551>.
666 =item B<ReportSeconds> B<true|false>
668 If set to B<true>, the time reported in the C<timeleft> metric will be
669 converted to seconds. This is the recommended setting. If set to B<false>, the
670 default for backwards compatibility, the time will be reported in minutes.
672 =back
674 =head2 Plugin C<ascent>
676 This plugin collects information about an Ascent server, a free server for the
677 "World of Warcraft" game. This plugin gathers the information by fetching the
678 XML status page using C<libcurl> and parses it using C<libxml2>.
680 The configuration options are the same as for the C<apache> plugin above:
682 =over 4
684 =item B<URL> I<http://localhost/ascent/status/>
686 Sets the URL of the XML status output.
688 =item B<User> I<Username>
690 Optional user name needed for authentication.
692 =item B<Password> I<Password>
694 Optional password needed for authentication.
696 =item B<VerifyPeer> B<true|false>
698 Enable or disable peer SSL certificate verification. See
699 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
701 =item B<VerifyHost> B<true|false>
703 Enable or disable peer host name verification. If enabled, the plugin checks
704 if the C<Common Name> or a C<Subject Alternate Name> field of the SSL
705 certificate matches the host name provided by the B<URL> option. If this
706 identity check fails, the connection is aborted. Obviously, only works when
707 connecting to a SSL enabled server. Enabled by default.
709 =item B<CACert> I<File>
711 File that holds one or more SSL certificates. If you want to use HTTPS you will
712 possibly need this option. What CA certificates come bundled with C<libcurl>
713 and are checked by default depends on the distribution you use.
715 =back
717 =head2 Plugin C<bind>
719 Starting with BIND 9.5.0, the most widely used DNS server software provides
720 extensive statistics about queries, responses and lots of other information.
721 The bind plugin retrieves this information that's encoded in XML and provided
722 via HTTP and submits the values to collectd.
724 To use this plugin, you first need to tell BIND to make this information
725 available. This is done with the C<statistics-channels> configuration option:
727  statistics-channels {
728    inet localhost port 8053;
729  };
731 The configuration follows the grouping that can be seen when looking at the
732 data with an XSLT compatible viewer, such as a modern web browser. It's
733 probably a good idea to make yourself familiar with the provided values, so you
734 can understand what the collected statistics actually mean.
736 Synopsis:
738  <Plugin "bind">
739    URL "http://localhost:8053/"
740    ParseTime       false
741    OpCodes         true
742    QTypes          true
743  
744    ServerStats     true
745    ZoneMaintStats  true
746    ResolverStats   false
747    MemoryStats     true
748  
749    <View "_default">
750      QTypes        true
751      ResolverStats true
752      CacheRRSets   true
753  
754      Zone "127.in-addr.arpa/IN"
755    </View>
756  </Plugin>
758 The bind plugin accepts the following configuration options:
760 =over 4
762 =item B<URL> I<URL>
764 URL from which to retrieve the XML data. If not specified,
765 C<http://localhost:8053/> will be used.
767 =item B<ParseTime> B<true>|B<false>
769 When set to B<true>, the time provided by BIND will be parsed and used to
770 dispatch the values. When set to B<false>, the local time source is queried.
772 This setting is set to B<true> by default for backwards compatibility; setting
773 this to B<false> is I<recommended> to avoid problems with timezones and
774 localization.
776 =item B<OpCodes> B<true>|B<false>
778 When enabled, statistics about the I<"OpCodes">, for example the number of
779 C<QUERY> packets, are collected.
781 Default: Enabled.
783 =item B<QTypes> B<true>|B<false>
785 When enabled, the number of I<incoming> queries by query types (for example
786 C<A>, C<MX>, C<AAAA>) is collected.
788 Default: Enabled.
790 =item B<ServerStats> B<true>|B<false>
792 Collect global server statistics, such as requests received over IPv4 and IPv6,
793 successful queries, and failed updates.
795 Default: Enabled.
797 =item B<ZoneMaintStats> B<true>|B<false>
799 Collect zone maintenance statistics, mostly information about notifications
800 (zone updates) and zone transfers.
802 Default: Enabled.
804 =item B<ResolverStats> B<true>|B<false>
806 Collect resolver statistics, i.E<nbsp>e. statistics about outgoing requests
807 (e.E<nbsp>g. queries over IPv4, lame servers). Since the global resolver
808 counters apparently were removed in BIND 9.5.1 and 9.6.0, this is disabled by
809 default. Use the B<ResolverStats> option within a B<View "_default"> block
810 instead for the same functionality.
812 Default: Disabled.
814 =item B<MemoryStats>
816 Collect global memory statistics.
818 Default: Enabled.
820 =item B<View> I<Name>
822 Collect statistics about a specific I<"view">. BIND can behave different,
823 mostly depending on the source IP-address of the request. These different
824 configurations are called "views". If you don't use this feature, you most
825 likely are only interested in the C<_default> view.
827 Within a E<lt>B<View>E<nbsp>I<name>E<gt> block, you can specify which
828 information you want to collect about a view. If no B<View> block is
829 configured, no detailed view statistics will be collected.
831 =over 4
833 =item B<QTypes> B<true>|B<false>
835 If enabled, the number of I<outgoing> queries by query type (e.E<nbsp>g. C<A>,
836 C<MX>) is collected.
838 Default: Enabled.
840 =item B<ResolverStats> B<true>|B<false>
842 Collect resolver statistics, i.E<nbsp>e. statistics about outgoing requests
843 (e.E<nbsp>g. queries over IPv4, lame servers).
845 Default: Enabled.
847 =item B<CacheRRSets> B<true>|B<false>
849 If enabled, the number of entries (I<"RR sets">) in the view's cache by query
850 type is collected. Negative entries (queries which resulted in an error, for
851 example names that do not exist) are reported with a leading exclamation mark,
852 e.E<nbsp>g. "!A".
854 Default: Enabled.
856 =item B<Zone> I<Name>
858 When given, collect detailed information about the given zone in the view. The
859 information collected if very similar to the global B<ServerStats> information
860 (see above).
862 You can repeat this option to collect detailed information about multiple
863 zones.
865 By default no detailed zone information is collected.
867 =back
869 =back
871 =head2 Plugin C<cpufreq>
873 This plugin doesn't have any options. It reads
874 F</sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq> (for the first CPU
875 installed) to get the current CPU frequency. If this file does not exist make
876 sure B<cpufreqd> (L<http://cpufreqd.sourceforge.net/>) or a similar tool is
877 installed and an "cpu governor" (that's a kernel module) is loaded.
879 =head2 Plugin C<csv>
881 =over 4
883 =item B<DataDir> I<Directory>
885 Set the directory to store CSV-files under. Per default CSV-files are generated
886 beneath the daemon's working directory, i.E<nbsp>e. the B<BaseDir>.
887 The special strings B<stdout> and B<stderr> can be used to write to the standard
888 output and standard error channels, respectively. This, of course, only makes
889 much sense when collectd is running in foreground- or non-daemon-mode.
891 =item B<StoreRates> B<true|false>
893 If set to B<true>, convert counter values to rates. If set to B<false> (the
894 default) counter values are stored as is, i.E<nbsp>e. as an increasing integer
895 number.
897 =back
899 =head2 Plugin C<curl>
901 The curl plugin uses the B<libcurl> (L<http://curl.haxx.se/>) to read web pages
902 and the match infrastructure (the same code used by the tail plugin) to use
903 regular expressions with the received data.
905 The following example will read the current value of AMD stock from Google's
906 finance page and dispatch the value to collectd.
908   <Plugin curl>
909     <Page "stock_quotes">
910       URL "http://finance.google.com/finance?q=NYSE%3AAMD"
911       User "foo"
912       Password "bar"
913       <Match>
914         Regex "<span +class=\"pr\"[^>]*> *([0-9]*\\.[0-9]+) *</span>"
915         DSType "GaugeAverage"
916         # Note: `stock_value' is not a standard type.
917         Type "stock_value"
918         Instance "AMD"
919       </Match>
920     </Page>
921   </Plugin>
923 In the B<Plugin> block, there may be one or more B<Page> blocks, each defining
924 a web page and one or more "matches" to be performed on the returned data. The
925 string argument to the B<Page> block is used as plugin instance.
927 The following options are valid within B<Page> blocks:
929 =over 4
931 =item B<URL> I<URL>
933 URL of the web site to retrieve. Since a regular expression will be used to
934 extract information from this data, non-binary data is a big plus here ;)
936 =item B<User> I<Name>
938 Username to use if authorization is required to read the page.
940 =item B<Password> I<Password>
942 Password to use if authorization is required to read the page.
944 =item B<VerifyPeer> B<true>|B<false>
946 Enable or disable peer SSL certificate verification. See
947 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
949 =item B<VerifyHost> B<true>|B<false>
951 Enable or disable peer host name verification. If enabled, the plugin checks if
952 the C<Common Name> or a C<Subject Alternate Name> field of the SSL certificate
953 matches the host name provided by the B<URL> option. If this identity check
954 fails, the connection is aborted. Obviously, only works when connecting to a
955 SSL enabled server. Enabled by default.
957 =item B<CACert> I<file>
959 File that holds one or more SSL certificates. If you want to use HTTPS you will
960 possibly need this option. What CA certificates come bundled with C<libcurl>
961 and are checked by default depends on the distribution you use.
963 =item B<Header> I<Header>
965 A HTTP header to add to the request. Multiple headers are added if this option
966 is specified more than once.
968 =item B<Post> I<Body>
970 Specifies that the HTTP operation should be a POST instead of a GET. The
971 complete data to be posted is given as the argument.  This option will usually
972 need to be accompanied by a B<Header> option to set an appropriate
973 C<Content-Type> for the post body (e.g. to
974 C<application/x-www-form-urlencoded>).
976 =item B<MeasureResponseTime> B<true>|B<false>
978 Measure response time for the request. If this setting is enabled, B<Match>
979 blocks (see below) are optional. Disabled by default.
981 =item B<E<lt>MatchE<gt>>
983 One or more B<Match> blocks that define how to match information in the data
984 returned by C<libcurl>. The C<curl> plugin uses the same infrastructure that's
985 used by the C<tail> plugin, so please see the documentation of the C<tail>
986 plugin below on how matches are defined. If the B<MeasureResponseTime> option
987 is set to B<true>, B<Match> blocks are optional.
989 =back
991 =head2 Plugin C<curl_json>
993 The B<curl_json plugin> uses B<libcurl> (L<http://curl.haxx.se/>) and
994 B<libyajl> (L<http://www.lloydforge.org/projects/yajl/>) to retrieve JSON data
995 via cURL. This can be used to collect values from CouchDB documents (which are
996 stored JSON notation), for example.
998 The following example will collect several values from the built-in `_stats'
999 runtime statistics module of CouchDB
1000 (L<http://wiki.apache.org/couchdb/Runtime_Statistics>).
1002   <Plugin curl_json>
1003     <URL "http://localhost:5984/_stats">
1004       Instance "httpd"
1005       <Key "httpd/requests/count">
1006         Type "http_requests"
1007       </Key>
1009       <Key "httpd_request_methods/*/count">
1010         Type "http_request_methods"
1011       </Key>
1013       <Key "httpd_status_codes/*/count">
1014         Type "http_response_codes"
1015       </Key>
1016     </URL>
1017   </Plugin>
1019 In the B<Plugin> block, there may be one or more B<URL> blocks, each defining
1020 a URL to be fetched via HTTP (using libcurl) and one or more B<Key> blocks.
1021 The B<Key> string argument must be in a path format, which is used to collect a
1022 value from a JSON map object. If a path element of B<Key> is the
1023 I<*>E<nbsp>wildcard, the values for all keys will be collectd.
1025 The following options are valid within B<URL> blocks:
1027 =over 4
1029 =item B<Instance> I<Instance>
1031 Sets the plugin instance to I<Instance>.
1033 =item B<User> I<Name>
1034 =item B<Password> I<Password>
1035 =item B<VerifyPeer> B<true>|B<false>
1036 =item B<VerifyHost> B<true>|B<false>
1037 =item B<CACert> I<file>
1038 =item B<Header> I<Header>
1039 =item B<Post> I<Body>
1041 These options behave exactly equivalent to the appropriate options of the
1042 I<cURL> plugin. Please see there for a detailed description.
1044 =back
1046 The following options are valid within B<Key> blocks:
1048 =over 4
1050 =item B<Type> I<Type>
1052 Sets the type used to dispatch the values to the daemon. Detailed information
1053 about types and their configuration can be found in L<types.db(5)>. This
1054 option is mandatory.
1056 =item B<Instance> I<Instance>
1058 Type-instance to use. Defaults to the current map key or current string array element value.
1060 =back
1062 =head2 Plugin C<curl_xml>
1064 The B<curl_xml plugin> uses B<libcurl> (L<http://curl.haxx.se/>) and B<libxml2>
1065 (L<http://xmlsoft.org/>) to retrieve XML data via cURL.
1067  <Plugin "curl_xml">
1068    <URL "http://localhost/stats.xml">
1069      Host "my_host"
1070      Instance "some_instance"
1071      User "collectd"
1072      Password "thaiNg0I"
1073      VerifyPeer true
1074      VerifyHost true
1075      CACert "/path/to/ca.crt"
1077      <XPath "table[@id=\"magic_level\"]/tr">
1078        Type "magic_level"
1079        #InstancePrefix "prefix-"
1080        InstanceFrom "td[1]"
1081        ValuesFrom "td[2]/span[@class=\"level\"]"
1082      </XPath>
1083    </URL>
1084  </Plugin>
1086 In the B<Plugin> block, there may be one or more B<URL> blocks, each defining a
1087 URL to be fetched using libcurl. Within each B<URL> block there are
1088 options which specify the connection parameters, for example authentication
1089 information, and one or more B<XPath> blocks.
1091 Each B<XPath> block specifies how to get one type of information. The
1092 string argument must be a valid XPath expression which returns a list
1093 of "base elements". One value is dispatched for each "base element". The
1094 I<type instance> and values are looked up using further I<XPath> expressions
1095 that should be relative to the base element.
1097 Within the B<URL> block the following options are accepted:
1099 =over 4
1101 =item B<Host> I<Name>
1103 Use I<Name> as the host name when submitting values. Defaults to the global
1104 host name setting.
1106 =item B<Instance> I<Instance>
1108 Use I<Instance> as the plugin instance when submitting values. Defaults to an
1109 empty string (no plugin instance).
1111 =item B<Namespace> I<Prefix> I<URL>
1113 If an XPath expression references namespaces, they must be specified
1114 with this option. I<Prefix> is the "namespace prefix" used in the XML document.
1115 I<URL> is the "namespace name", an URI reference uniquely identifying the
1116 namespace. The option can be repeated to register multiple namespaces.
1118 Examples:
1120   Namespace "s" "http://schemas.xmlsoap.org/soap/envelope/"
1121   Namespace "m" "http://www.w3.org/1998/Math/MathML"
1123 =item B<User> I<User>
1125 =item B<Password> I<Password>
1127 =item B<VerifyPeer> B<true>|B<false>
1129 =item B<VerifyHost> B<true>|B<false>
1131 =item B<CACert> I<CA Cert File>
1133 =item B<Header> I<Header>
1135 =item B<Post> I<Body>
1137 These options behave exactly equivalent to the appropriate options of the
1138 I<cURL plugin>. Please see there for a detailed description.
1140 =item E<lt>B<XPath> I<XPath-expression>E<gt>
1142 Within each B<URL> block, there must be one or more B<XPath> blocks. Each
1143 B<XPath> block specifies how to get one type of information. The string
1144 argument must be a valid XPath expression which returns a list of "base
1145 elements". One value is dispatched for each "base element".
1147 Within the B<XPath> block the following options are accepted:
1149 =over 4
1151 =item B<Type> I<Type>
1153 Specifies the I<Type> used for submitting patches. This determines the number
1154 of values that are required / expected and whether the strings are parsed as
1155 signed or unsigned integer or as double values. See L<types.db(5)> for details.
1156 This option is required.
1158 =item B<InstancePrefix> I<InstancePrefix>
1160 Prefix the I<type instance> with I<InstancePrefix>. The values are simply
1161 concatenated together without any separator.
1162 This option is optional.
1164 =item B<InstanceFrom> I<InstanceFrom>
1166 Specifies a XPath expression to use for determining the I<type instance>. The
1167 XPath expression must return exactly one element. The element's value is then
1168 used as I<type instance>, possibly prefixed with I<InstancePrefix> (see above).
1170 This value is required. As a special exception, if the "base XPath expression"
1171 (the argument to the B<XPath> block) returns exactly one argument, then this
1172 option may be omitted.
1174 =item B<ValuesFrom> I<ValuesFrom> [I<ValuesFrom> ...]
1176 Specifies one or more XPath expression to use for reading the values. The
1177 number of XPath expressions must match the number of data sources in the
1178 I<type> specified with B<Type> (see above). Each XPath expression must return
1179 exactly one element. The element's value is then parsed as a number and used as
1180 value for the appropriate value in the value list dispatched to the daemon.
1182 =back
1184 =back
1186 =head2 Plugin C<dbi>
1188 This plugin uses the B<dbi> library (L<http://libdbi.sourceforge.net/>) to
1189 connect to various databases, execute I<SQL> statements and read back the
1190 results. I<dbi> is an acronym for "database interface" in case you were
1191 wondering about the name. You can configure how each column is to be
1192 interpreted and the plugin will generate one or more data sets from each row
1193 returned according to these rules.
1195 Because the plugin is very generic, the configuration is a little more complex
1196 than those of other plugins. It usually looks something like this:
1198   <Plugin dbi>
1199     <Query "out_of_stock">
1200       Statement "SELECT category, COUNT(*) AS value FROM products WHERE in_stock = 0 GROUP BY category"
1201       # Use with MySQL 5.0.0 or later
1202       MinVersion 50000
1203       <Result>
1204         Type "gauge"
1205         InstancePrefix "out_of_stock"
1206         InstancesFrom "category"
1207         ValuesFrom "value"
1208       </Result>
1209     </Query>
1210     <Database "product_information">
1211       Driver "mysql"
1212       DriverOption "host" "localhost"
1213       DriverOption "username" "collectd"
1214       DriverOption "password" "aZo6daiw"
1215       DriverOption "dbname" "prod_info"
1216       SelectDB "prod_info"
1217       Query "out_of_stock"
1218     </Database>
1219   </Plugin>
1221 The configuration above defines one query with one result and one database. The
1222 query is then linked to the database with the B<Query> option I<within> the
1223 B<E<lt>DatabaseE<gt>> block. You can have any number of queries and databases
1224 and you can also use the B<Include> statement to split up the configuration
1225 file in multiple, smaller files. However, the B<E<lt>QueryE<gt>> block I<must>
1226 precede the B<E<lt>DatabaseE<gt>> blocks, because the file is interpreted from
1227 top to bottom!
1229 The following is a complete list of options:
1231 =head3 B<Query> blocks
1233 Query blocks define I<SQL> statements and how the returned data should be
1234 interpreted. They are identified by the name that is given in the opening line
1235 of the block. Thus the name needs to be unique. Other than that, the name is
1236 not used in collectd.
1238 In each B<Query> block, there is one or more B<Result> blocks. B<Result> blocks
1239 define which column holds which value or instance information. You can use
1240 multiple B<Result> blocks to create multiple values from one returned row. This
1241 is especially useful, when queries take a long time and sending almost the same
1242 query again and again is not desirable.
1244 Example:
1246   <Query "environment">
1247     Statement "select station, temperature, humidity from environment"
1248     <Result>
1249       Type "temperature"
1250       # InstancePrefix "foo"
1251       InstancesFrom "station"
1252       ValuesFrom "temperature"
1253     </Result>
1254     <Result>
1255       Type "humidity"
1256       InstancesFrom "station"
1257       ValuesFrom "humidity"
1258     </Result>
1259   </Query>
1261 The following options are accepted:
1263 =over 4
1265 =item B<Statement> I<SQL>
1267 Sets the statement that should be executed on the server. This is B<not>
1268 interpreted by collectd, but simply passed to the database server. Therefore,
1269 the SQL dialect that's used depends on the server collectd is connected to.
1271 The query has to return at least two columns, one for the instance and one
1272 value. You cannot omit the instance, even if the statement is guaranteed to
1273 always return exactly one line. In that case, you can usually specify something
1274 like this:
1276   Statement "SELECT \"instance\", COUNT(*) AS value FROM table"
1278 (That works with MySQL but may not be valid SQL according to the spec. If you
1279 use a more strict database server, you may have to select from a dummy table or
1280 something.)
1282 Please note that some databases, for example B<Oracle>, will fail if you
1283 include a semicolon at the end of the statement.
1285 =item B<MinVersion> I<Version>
1287 =item B<MaxVersion> I<Value>
1289 Only use this query for the specified database version. You can use these
1290 options to provide multiple queries with the same name but with a slightly
1291 different syntax. The plugin will use only those queries, where the specified
1292 minimum and maximum versions fit the version of the database in use.
1294 The database version is determined by C<dbi_conn_get_engine_version>, see the
1295 L<libdbi documentation|http://libdbi.sourceforge.net/docs/programmers-guide/reference-conn.html#DBI-CONN-GET-ENGINE-VERSION>
1296 for details. Basically, each part of the version is assumed to be in the range
1297 from B<00> to B<99> and all dots are removed. So version "4.1.2" becomes
1298 "40102", version "5.0.42" becomes "50042".
1300 B<Warning:> The plugin will use B<all> matching queries, so if you specify
1301 multiple queries with the same name and B<overlapping> ranges, weird stuff will
1302 happen. Don't to it! A valid example would be something along these lines:
1304   MinVersion 40000
1305   MaxVersion 49999
1306   ...
1307   MinVersion 50000
1308   MaxVersion 50099
1309   ...
1310   MinVersion 50100
1311   # No maximum
1313 In the above example, there are three ranges that don't overlap. The last one
1314 goes from version "5.1.0" to infinity, meaning "all later versions". Versions
1315 before "4.0.0" are not specified.
1317 =item B<Type> I<Type>
1319 The B<type> that's used for each line returned. See L<types.db(5)> for more
1320 details on how types are defined. In short: A type is a predefined layout of
1321 data and the number of values and type of values has to match the type
1322 definition.
1324 If you specify "temperature" here, you need exactly one gauge column. If you
1325 specify "if_octets", you will need two counter columns. See the B<ValuesFrom>
1326 setting below.
1328 There must be exactly one B<Type> option inside each B<Result> block.
1330 =item B<InstancePrefix> I<prefix>
1332 Prepends I<prefix> to the type instance. If B<InstancesFrom> (see below) is not
1333 given, the string is simply copied. If B<InstancesFrom> is given, I<prefix> and
1334 all strings returned in the appropriate columns are concatenated together,
1335 separated by dashes I<("-")>.
1337 =item B<InstancesFrom> I<column0> [I<column1> ...]
1339 Specifies the columns whose values will be used to create the "type-instance"
1340 for each row. If you specify more than one column, the value of all columns
1341 will be joined together with dashes I<("-")> as separation characters.
1343 The plugin itself does not check whether or not all built instances are
1344 different. It's your responsibility to assure that each is unique. This is
1345 especially true, if you do not specify B<InstancesFrom>: B<You> have to make
1346 sure that only one row is returned in this case.
1348 If neither B<InstancePrefix> nor B<InstancesFrom> is given, the type-instance
1349 will be empty.
1351 =item B<ValuesFrom> I<column0> [I<column1> ...]
1353 Names the columns whose content is used as the actual data for the data sets
1354 that are dispatched to the daemon. How many such columns you need is determined
1355 by the B<Type> setting above. If you specify too many or not enough columns,
1356 the plugin will complain about that and no data will be submitted to the
1357 daemon.
1359 The actual data type in the columns is not that important. The plugin will
1360 automatically cast the values to the right type if it know how to do that. So
1361 it should be able to handle integer an floating point types, as well as strings
1362 (if they include a number at the beginning).
1364 There must be at least one B<ValuesFrom> option inside each B<Result> block.
1366 =back
1368 =head3 B<Database> blocks
1370 Database blocks define a connection to a database and which queries should be
1371 sent to that database. Since the used "dbi" library can handle a wide variety
1372 of databases, the configuration is very generic. If in doubt, refer to libdbi's
1373 documentationE<nbsp>- we stick as close to the terminology used there.
1375 Each database needs a "name" as string argument in the starting tag of the
1376 block. This name will be used as "PluginInstance" in the values submitted to
1377 the daemon. Other than that, that name is not used.
1379 =over 4
1381 =item B<Driver> I<Driver>
1383 Specifies the driver to use to connect to the database. In many cases those
1384 drivers are named after the database they can connect to, but this is not a
1385 technical necessity. These drivers are sometimes referred to as "DBD",
1386 B<D>ataB<B>ase B<D>river, and some distributions ship them in separate
1387 packages. Drivers for the "dbi" library are developed by the B<libdbi-drivers>
1388 project at L<http://libdbi-drivers.sourceforge.net/>.
1390 You need to give the driver name as expected by the "dbi" library here. You
1391 should be able to find that in the documentation for each driver. If you
1392 mistype the driver name, the plugin will dump a list of all known driver names
1393 to the log.
1395 =item B<DriverOption> I<Key> I<Value>
1397 Sets driver-specific options. What option a driver supports can be found in the
1398 documentation for each driver, somewhere at
1399 L<http://libdbi-drivers.sourceforge.net/>. However, the options "host",
1400 "username", "password", and "dbname" seem to be deE<nbsp>facto standards.
1402 DBDs can register two types of options: String options and numeric options. The
1403 plugin will use the C<dbi_conn_set_option> function when the configuration
1404 provides a string and the C<dbi_conn_require_option_numeric> function when the
1405 configuration provides a number. So these two lines will actually result in
1406 different calls being used:
1408   DriverOption "Port" 1234      # numeric
1409   DriverOption "Port" "1234"    # string
1411 Unfortunately, drivers are not too keen to report errors when an unknown option
1412 is passed to them, so invalid settings here may go unnoticed. This is not the
1413 plugin's fault, it will report errors if it gets them from the libraryE<nbsp>/
1414 the driver. If a driver complains about an option, the plugin will dump a
1415 complete list of all options understood by that driver to the log. There is no
1416 way to programatically find out if an option expects a string or a numeric
1417 argument, so you will have to refer to the appropriate DBD's documentation to
1418 find this out. Sorry.
1420 =item B<SelectDB> I<Database>
1422 In some cases, the database name you connect with is not the database name you
1423 want to use for querying data. If this option is set, the plugin will "select"
1424 (switch to) that database after the connection is established.
1426 =item B<Query> I<QueryName>
1428 Associates the query named I<QueryName> with this database connection. The
1429 query needs to be defined I<before> this statement, i.E<nbsp>e. all query
1430 blocks you want to refer to must be placed above the database block you want to
1431 refer to them from.
1433 =item B<Host> I<Hostname>
1435 Sets the B<host> field of I<value lists> to I<Hostname> when dispatching
1436 values. Defaults to the global hostname setting.
1438 =back
1440 =head2 Plugin C<df>
1442 =over 4
1444 =item B<Device> I<Device>
1446 Select partitions based on the devicename.
1448 =item B<MountPoint> I<Directory>
1450 Select partitions based on the mountpoint.
1452 =item B<FSType> I<FSType>
1454 Select partitions based on the filesystem type.
1456 =item B<IgnoreSelected> B<true>|B<false>
1458 Invert the selection: If set to true, all partitions B<except> the ones that
1459 match any one of the criteria are collected. By default only selected
1460 partitions are collected if a selection is made. If no selection is configured
1461 at all, B<all> partitions are selected.
1463 =item B<ReportByDevice> B<true>|B<false>
1465 Report using the device name rather than the mountpoint. i.e. with this I<false>,
1466 (the default), it will report a disk as "root", but with it I<true>, it will be
1467 "sda1" (or whichever).
1469 =item B<ReportInodes> B<true>|B<false>
1471 Enables or disables reporting of free, reserved and used inodes. Defaults to
1472 inode collection being disabled.
1474 Enable this option if inodes are a scarce resource for you, usually because
1475 many small files are stored on the disk. This is a usual scenario for mail
1476 transfer agents and web caches.
1478 =back
1480 =head2 Plugin C<disk>
1482 The C<disk> plugin collects information about the usage of physical disks and
1483 logical disks (partitions). Values collected are the number of octets written
1484 to and read from a disk or partition, the number of read/write operations
1485 issued to the disk and a rather complex "time" it took for these commands to be
1486 issued.
1488 Using the following two options you can ignore some disks or configure the
1489 collection only of specific disks.
1491 =over 4
1493 =item B<Disk> I<Name>
1495 Select the disk I<Name>. Whether it is collected or ignored depends on the
1496 B<IgnoreSelected> setting, see below. As with other plugins that use the
1497 daemon's ignorelist functionality, a string that starts and ends with a slash
1498 is interpreted as a regular expression. Examples:
1500   Disk "sdd"
1501   Disk "/hda[34]/"
1503 =item B<IgnoreSelected> B<true>|B<false>
1505 Sets whether selected disks, i.E<nbsp>e. the ones matches by any of the B<Disk>
1506 statements, are ignored or if all other disks are ignored. The behavior
1507 (hopefully) is intuitive: If no B<Disk> option is configured, all disks are
1508 collected. If at least one B<Disk> option is given and no B<IgnoreSelected> or
1509 set to B<false>, B<only> matching disks will be collected. If B<IgnoreSelected>
1510 is set to B<true>, all disks are collected B<except> the ones matched.
1512 =back
1514 =head2 Plugin C<dns>
1516 =over 4
1518 =item B<Interface> I<Interface>
1520 The dns plugin uses B<libpcap> to capture dns traffic and analyzes it. This
1521 option sets the interface that should be used. If this option is not set, or
1522 set to "any", the plugin will try to get packets from B<all> interfaces. This
1523 may not work on certain platforms, such as MacE<nbsp>OSE<nbsp>X.
1525 =item B<IgnoreSource> I<IP-address>
1527 Ignore packets that originate from this address.
1529 =item B<SelectNumericQueryTypes> B<true>|B<false>
1531 Enabled by default, collects unknown (and thus presented as numeric only) query types.
1533 =back
1535 =head2 Plugin C<email>
1537 =over 4
1539 =item B<SocketFile> I<Path>
1541 Sets the socket-file which is to be created.
1543 =item B<SocketGroup> I<Group>
1545 If running as root change the group of the UNIX-socket after it has been
1546 created. Defaults to B<collectd>.
1548 =item B<SocketPerms> I<Permissions>
1550 Change the file permissions of the UNIX-socket after it has been created. The
1551 permissions must be given as a numeric, octal value as you would pass to
1552 L<chmod(1)>. Defaults to B<0770>.
1554 =item B<MaxConns> I<Number>
1556 Sets the maximum number of connections that can be handled in parallel. Since
1557 this many threads will be started immediately setting this to a very high
1558 value will waste valuable resources. Defaults to B<5> and will be forced to be
1559 at most B<16384> to prevent typos and dumb mistakes.
1561 =back
1563 =head2 Plugin C<ethstat>
1565 The I<ethstat plugin> collects information about network interface cards (NICs)
1566 by talking directly with the underlying kernel driver using L<ioctl(2)>.
1568 B<Synopsis:>
1570  <Plugin "ethstat">
1571    Interface "eth0"
1572    Map "rx_csum_offload_errors" "if_rx_errors" "checksum_offload"
1573    Map "multicast" "if_multicast"
1574  </Plugin>
1576 B<Options:>
1578 =over 4
1580 =item B<Interface> I<Name>
1582 Collect statistical information about interface I<Name>.
1584 =item B<Map> I<Name> I<Type> [I<TypeInstance>]
1586 By default, the plugin will submit values as type C<derive> and I<type
1587 instance> set to I<Name>, the name of the metric as reported by the driver. If
1588 an appropriate B<Map> option exists, the given I<Type> and, optionally,
1589 I<TypeInstance> will be used.
1591 =item B<MappedOnly> B<true>|B<false>
1593 When set to B<true>, only metrics that can be mapped to to a I<type> will be
1594 collected, all other metrics will be ignored. Defaults to B<false>.
1596 =back
1598 =head2 Plugin C<exec>
1600 Please make sure to read L<collectd-exec(5)> before using this plugin. It
1601 contains valuable information on when the executable is executed and the
1602 output that is expected from it.
1604 =over 4
1606 =item B<Exec> I<User>[:[I<Group>]] I<Executable> [I<E<lt>argE<gt>> [I<E<lt>argE<gt>> ...]]
1608 =item B<NotificationExec> I<User>[:[I<Group>]] I<Executable> [I<E<lt>argE<gt>> [I<E<lt>argE<gt>> ...]]
1610 Execute the executable I<Executable> as user I<User>. If the user name is
1611 followed by a colon and a group name, the effective group is set to that group.
1612 The real group and saved-set group will be set to the default group of that
1613 user. If no group is given the effective group ID will be the same as the real
1614 group ID.
1616 Please note that in order to change the user and/or group the daemon needs
1617 superuser privileges. If the daemon is run as an unprivileged user you must
1618 specify the same user/group here. If the daemon is run with superuser
1619 privileges, you must supply a non-root user here.
1621 The executable may be followed by optional arguments that are passed to the
1622 program. Please note that due to the configuration parsing numbers and boolean
1623 values may be changed. If you want to be absolutely sure that something is
1624 passed as-is please enclose it in quotes.
1626 The B<Exec> and B<NotificationExec> statements change the semantics of the
1627 programs executed, i.E<nbsp>e. the data passed to them and the response
1628 expected from them. This is documented in great detail in L<collectd-exec(5)>.
1630 =back
1632 =head2 Plugin C<filecount>
1634 The C<filecount> plugin counts the number of files in a certain directory (and
1635 its subdirectories) and their combined size. The configuration is very straight
1636 forward:
1638   <Plugin "filecount">
1639     <Directory "/var/qmail/queue/mess">
1640       Instance "qmail-message"
1641     </Directory>
1642     <Directory "/var/qmail/queue/todo">
1643       Instance "qmail-todo"
1644     </Directory>
1645     <Directory "/var/lib/php5">
1646       Instance "php5-sessions"
1647       Name "sess_*"
1648     </Directory>
1649   </Plugin>
1651 The example above counts the number of files in QMail's queue directories and
1652 the number of PHP5 sessions. Jfiy: The "todo" queue holds the messages that
1653 QMail has not yet looked at, the "message" queue holds the messages that were
1654 classified into "local" and "remote".
1656 As you can see, the configuration consists of one or more C<Directory> blocks,
1657 each of which specifies a directory in which to count the files. Within those
1658 blocks, the following options are recognized:
1660 =over 4
1662 =item B<Instance> I<Instance>
1664 Sets the plugin instance to I<Instance>. That instance name must be unique, but
1665 it's your responsibility, the plugin doesn't check for that. If not given, the
1666 instance is set to the directory name with all slashes replaced by underscores
1667 and all leading underscores removed.
1669 =item B<Name> I<Pattern>
1671 Only count files that match I<Pattern>, where I<Pattern> is a shell-like
1672 wildcard as understood by L<fnmatch(3)>. Only the B<filename> is checked
1673 against the pattern, not the entire path. In case this makes it easier for you:
1674 This option has been named after the B<-name> parameter to L<find(1)>.
1676 =item B<MTime> I<Age>
1678 Count only files of a specific age: If I<Age> is greater than zero, only files
1679 that haven't been touched in the last I<Age> seconds are counted. If I<Age> is
1680 a negative number, this is inversed. For example, if B<-60> is specified, only
1681 files that have been modified in the last minute will be counted.
1683 The number can also be followed by a "multiplier" to easily specify a larger
1684 timespan. When given in this notation, the argument must in quoted, i.E<nbsp>e.
1685 must be passed as string. So the B<-60> could also be written as B<"-1m"> (one
1686 minute). Valid multipliers are C<s> (second), C<m> (minute), C<h> (hour), C<d>
1687 (day), C<w> (week), and C<y> (year). There is no "month" multiplier. You can
1688 also specify fractional numbers, e.E<nbsp>g. B<"0.5d"> is identical to
1689 B<"12h">.
1691 =item B<Size> I<Size>
1693 Count only files of a specific size. When I<Size> is a positive number, only
1694 files that are at least this big are counted. If I<Size> is a negative number,
1695 this is inversed, i.E<nbsp>e. only files smaller than the absolute value of
1696 I<Size> are counted.
1698 As with the B<MTime> option, a "multiplier" may be added. For a detailed
1699 description see above. Valid multipliers here are C<b> (byte), C<k> (kilobyte),
1700 C<m> (megabyte), C<g> (gigabyte), C<t> (terabyte), and C<p> (petabyte). Please
1701 note that there are 1000 bytes in a kilobyte, not 1024.
1703 =item B<Recursive> I<true>|I<false>
1705 Controls whether or not to recurse into subdirectories. Enabled by default.
1707 =item B<IncludeHidden> I<true>|I<false>
1709 Controls whether or not to include "hidden" files and directories in the count.
1710 "Hidden" files and directories are those, whose name begins with a dot.
1711 Defaults to I<false>, i.e. by default hidden files and directories are ignored.
1713 =back
1715 =head2 Plugin C<GenericJMX>
1717 The I<GenericJMX plugin> is written in I<Java> and therefore documented in
1718 L<collectd-java(5)>.
1720 =head2 Plugin C<gmond>
1722 The I<gmond> plugin received the multicast traffic sent by B<gmond>, the
1723 statistics collection daemon of Ganglia. Mappings for the standard "metrics"
1724 are built-in, custom mappings may be added via B<Metric> blocks, see below.
1726 Synopsis:
1728  <Plugin "gmond">
1729    MCReceiveFrom "239.2.11.71" "8649"
1730    <Metric "swap_total">
1731      Type "swap"
1732      TypeInstance "total"
1733      DataSource "value"
1734    </Metric>
1735    <Metric "swap_free">
1736      Type "swap"
1737      TypeInstance "free"
1738      DataSource "value"
1739    </Metric>
1740  </Plugin>
1742 The following metrics are built-in:
1744 =over 4
1746 =item *
1748 load_one, load_five, load_fifteen
1750 =item *
1752 cpu_user, cpu_system, cpu_idle, cpu_nice, cpu_wio
1754 =item *
1756 mem_free, mem_shared, mem_buffers, mem_cached, mem_total
1758 =item *
1760 bytes_in, bytes_out
1762 =item *
1764 pkts_in, pkts_out
1766 =back
1768 Available configuration options:
1770 =over 4
1772 =item B<MCReceiveFrom> I<MCGroup> [I<Port>]
1774 Sets sets the multicast group and UDP port to which to subscribe.
1776 Default: B<239.2.11.71>E<nbsp>/E<nbsp>B<8649>
1778 =item E<lt>B<Metric> I<Name>E<gt>
1780 These blocks add a new metric conversion to the internal table. I<Name>, the
1781 string argument to the B<Metric> block, is the metric name as used by Ganglia.
1783 =over 4
1785 =item B<Type> I<Type>
1787 Type to map this metric to. Required.
1789 =item B<TypeInstance> I<Instance>
1791 Type-instance to use. Optional.
1793 =item B<DataSource> I<Name>
1795 Data source to map this metric to. If the configured type has exactly one data
1796 source, this is optional. Otherwise the option is required.
1798 =back
1800 =back
1802 =head2 Plugin C<hddtemp>
1804 To get values from B<hddtemp> collectd connects to B<localhost> (127.0.0.1),
1805 port B<7634/tcp>. The B<Host> and B<Port> options can be used to change these
1806 default values, see below. C<hddtemp> has to be running to work correctly. If
1807 C<hddtemp> is not running timeouts may appear which may interfere with other
1808 statistics..
1810 The B<hddtemp> homepage can be found at
1811 L<http://www.guzu.net/linux/hddtemp.php>.
1813 =over 4
1815 =item B<Host> I<Hostname>
1817 Hostname to connect to. Defaults to B<127.0.0.1>.
1819 =item B<Port> I<Port>
1821 TCP-Port to connect to. Defaults to B<7634>.
1823 =back
1825 =head2 Plugin C<interface>
1827 =over 4
1829 =item B<Interface> I<Interface>
1831 Select this interface. By default these interfaces will then be collected. For
1832 a more detailed description see B<IgnoreSelected> below.
1834 =item B<IgnoreSelected> I<true>|I<false>
1836 If no configuration if given, the B<traffic>-plugin will collect data from
1837 all interfaces. This may not be practical, especially for loopback- and
1838 similar interfaces. Thus, you can use the B<Interface>-option to pick the
1839 interfaces you're interested in. Sometimes, however, it's easier/preferred
1840 to collect all interfaces I<except> a few ones. This option enables you to
1841 do that: By setting B<IgnoreSelected> to I<true> the effect of
1842 B<Interface> is inverted: All selected interfaces are ignored and all
1843 other interfaces are collected.
1845 =back
1847 =head2 Plugin C<ipmi>
1849 =over 4
1851 =item B<Sensor> I<Sensor>
1853 Selects sensors to collect or to ignore, depending on B<IgnoreSelected>.
1855 =item B<IgnoreSelected> I<true>|I<false>
1857 If no configuration if given, the B<ipmi> plugin will collect data from all
1858 sensors found of type "temperature", "voltage", "current" and "fanspeed".
1859 This option enables you to do that: By setting B<IgnoreSelected> to I<true>
1860 the effect of B<Sensor> is inverted: All selected sensors are ignored and
1861 all other sensors are collected.
1863 =item B<NotifySensorAdd> I<true>|I<false>
1865 If a sensor appears after initialization time of a minute a notification
1866 is sent.
1868 =item B<NotifySensorRemove> I<true>|I<false>
1870 If a sensor disappears a notification is sent.
1872 =item B<NotifySensorNotPresent> I<true>|I<false>
1874 If you have for example dual power supply and one of them is (un)plugged then
1875 a notification is sent.
1877 =back
1879 =head2 Plugin C<iptables>
1881 =over 4
1883 =item B<Chain> I<Table> I<Chain> [I<Comment|Number> [I<Name>]]
1885 Select the rules to count. If only I<Table> and I<Chain> are given, this plugin
1886 will collect the counters of all rules which have a comment-match. The comment
1887 is then used as type-instance.
1889 If I<Comment> or I<Number> is given, only the rule with the matching comment or
1890 the I<n>th rule will be collected. Again, the comment (or the number) will be
1891 used as the type-instance.
1893 If I<Name> is supplied, it will be used as the type-instance instead of the
1894 comment or the number.
1896 =back
1898 =head2 Plugin C<irq>
1900 =over 4
1902 =item B<Irq> I<Irq>
1904 Select this irq. By default these irqs will then be collected. For a more
1905 detailed description see B<IgnoreSelected> below.
1907 =item B<IgnoreSelected> I<true>|I<false>
1909 If no configuration if given, the B<irq>-plugin will collect data from all
1910 irqs. This may not be practical, especially if no interrupts happen. Thus, you
1911 can use the B<Irq>-option to pick the interrupt you're interested in.
1912 Sometimes, however, it's easier/preferred to collect all interrupts I<except> a
1913 few ones. This option enables you to do that: By setting B<IgnoreSelected> to
1914 I<true> the effect of B<Irq> is inverted: All selected interrupts are ignored
1915 and all other interrupts are collected.
1917 =back
1919 =head2 Plugin C<java>
1921 The I<Java> plugin makes it possible to write extensions for collectd in Java.
1922 This section only discusses the syntax and semantic of the configuration
1923 options. For more in-depth information on the I<Java> plugin, please read
1924 L<collectd-java(5)>.
1926 Synopsis:
1928  <Plugin "java">
1929    JVMArg "-verbose:jni"
1930    JVMArg "-Djava.class.path=/opt/collectd/lib/collectd/bindings/java"
1931    LoadPlugin "org.collectd.java.Foobar"
1932    <Plugin "org.collectd.java.Foobar">
1933      # To be parsed by the plugin
1934    </Plugin>
1935  </Plugin>
1937 Available configuration options:
1939 =over 4
1941 =item B<JVMArg> I<Argument>
1943 Argument that is to be passed to the I<Java Virtual Machine> (JVM). This works
1944 exactly the way the arguments to the I<java> binary on the command line work.
1945 Execute C<javaE<nbsp>--help> for details.
1947 Please note that B<all> these options must appear B<before> (i.E<nbsp>e. above)
1948 any other options! When another option is found, the JVM will be started and
1949 later options will have to be ignored!
1951 =item B<LoadPlugin> I<JavaClass>
1953 Instantiates a new I<JavaClass> object. The constructor of this object very
1954 likely then registers one or more callback methods with the server.
1956 See L<collectd-java(5)> for details.
1958 When the first such option is found, the virtual machine (JVM) is created. This
1959 means that all B<JVMArg> options must appear before (i.E<nbsp>e. above) all
1960 B<LoadPlugin> options!
1962 =item B<Plugin> I<Name>
1964 The entire block is passed to the Java plugin as an
1965 I<org.collectd.api.OConfigItem> object.
1967 For this to work, the plugin has to register a configuration callback first,
1968 see L<collectd-java(5)/"config callback">. This means, that the B<Plugin> block
1969 must appear after the appropriate B<LoadPlugin> block. Also note, that I<Name>
1970 depends on the (Java) plugin registering the callback and is completely
1971 independent from the I<JavaClass> argument passed to B<LoadPlugin>.
1973 =back
1975 =head2 Plugin C<libvirt>
1977 This plugin allows CPU, disk and network load to be collected for virtualized
1978 guests on the machine. This means that these characteristics can be collected
1979 for guest systems without installing any software on them - collectd only runs
1980 on the hosting system. The statistics are collected through libvirt
1981 (L<http://libvirt.org/>).
1983 Only I<Connection> is required.
1985 =over 4
1987 =item B<Connection> I<uri>
1989 Connect to the hypervisor given by I<uri>. For example if using Xen use:
1991  Connection "xen:///"
1993 Details which URIs allowed are given at L<http://libvirt.org/uri.html>.
1995 =item B<RefreshInterval> I<seconds>
1997 Refresh the list of domains and devices every I<seconds>. The default is 60
1998 seconds. Setting this to be the same or smaller than the I<Interval> will cause
1999 the list of domains and devices to be refreshed on every iteration.
2001 Refreshing the devices in particular is quite a costly operation, so if your
2002 virtualization setup is static you might consider increasing this. If this
2003 option is set to 0, refreshing is disabled completely.
2005 =item B<Domain> I<name>
2007 =item B<BlockDevice> I<name:dev>
2009 =item B<InterfaceDevice> I<name:dev>
2011 =item B<IgnoreSelected> I<true>|I<false>
2013 Select which domains and devices are collected.
2015 If I<IgnoreSelected> is not given or I<false> then only the listed domains and
2016 disk/network devices are collected.
2018 If I<IgnoreSelected> is I<true> then the test is reversed and the listed
2019 domains and disk/network devices are ignored, while the rest are collected.
2021 The domain name and device names may use a regular expression, if the name is
2022 surrounded by I</.../> and collectd was compiled with support for regexps.
2024 The default is to collect statistics for all domains and all their devices.
2026 Example:
2028  BlockDevice "/:hdb/"
2029  IgnoreSelected "true"
2031 Ignore all I<hdb> devices on any domain, but other block devices (eg. I<hda>)
2032 will be collected.
2034 =item B<HostnameFormat> B<name|uuid|hostname|...>
2036 When the libvirt plugin logs data, it sets the hostname of the collected data
2037 according to this setting. The default is to use the guest name as provided by
2038 the hypervisor, which is equal to setting B<name>.
2040 B<uuid> means use the guest's UUID. This is useful if you want to track the
2041 same guest across migrations.
2043 B<hostname> means to use the global B<Hostname> setting, which is probably not
2044 useful on its own because all guests will appear to have the same name.
2046 You can also specify combinations of these fields. For example B<name uuid>
2047 means to concatenate the guest name and UUID (with a literal colon character
2048 between, thus I<"foo:1234-1234-1234-1234">).
2050 =item B<InterfaceFormat> B<name>|B<address>
2052 When the libvirt plugin logs interface data, it sets the name of the collected
2053 data according to this setting. The default is to use the path as provided by
2054 the hypervisor (the "dev" property of the target node), which is equal to
2055 setting B<name>.
2057 B<address> means use the interface's mac address. This is useful since the
2058 interface path might change between reboots of a guest or across migrations.
2060 =back
2062 =head2 Plugin C<logfile>
2064 =over 4
2066 =item B<LogLevel> B<debug|info|notice|warning|err>
2068 Sets the log-level. If, for example, set to B<notice>, then all events with
2069 severity B<notice>, B<warning>, or B<err> will be written to the logfile.
2071 Please note that B<debug> is only available if collectd has been compiled with
2072 debugging support.
2074 =item B<File> I<File>
2076 Sets the file to write log messages to. The special strings B<stdout> and
2077 B<stderr> can be used to write to the standard output and standard error
2078 channels, respectively. This, of course, only makes much sense when I<collectd>
2079 is running in foreground- or non-daemon-mode.
2081 =item B<Timestamp> B<true>|B<false>
2083 Prefix all lines printed by the current time. Defaults to B<true>.
2085 =item B<PrintSeverity> B<true>|B<false>
2087 When enabled, all lines are prefixed by the severity of the log message, for
2088 example "warning". Defaults to B<false>.
2090 =back
2092 B<Note>: There is no need to notify the daemon after moving or removing the
2093 log file (e.E<nbsp>g. when rotating the logs). The plugin reopens the file
2094 for each line it writes.
2096 =head2 Plugin C<lpar>
2098 The I<LPAR plugin> reads CPU statistics of I<Logical Partitions>, a
2099 virtualization technique for IBM POWER processors. It takes into account CPU
2100 time stolen from or donated to a partition, in addition to the usual user,
2101 system, I/O statistics.
2103 The following configuration options are available:
2105 =over 4
2107 =item B<CpuPoolStats> B<false>|B<true>
2109 When enabled, statistics about the processor pool are read, too. The partition
2110 needs to have pool authority in order to be able to acquire this information.
2111 Defaults to false.
2113 =item B<ReportBySerial> B<false>|B<true>
2115 If enabled, the serial of the physical machine the partition is currently
2116 running on is reported as I<hostname> and the logical hostname of the machine
2117 is reported in the I<plugin instance>. Otherwise, the logical hostname will be
2118 used (just like other plugins) and the I<plugin instance> will be empty.
2119 Defaults to false.
2121 =back
2123 =head2 Plugin C<mbmon>
2125 The C<mbmon plugin> uses mbmon to retrieve temperature, voltage, etc.
2127 Be default collectd connects to B<localhost> (127.0.0.1), port B<411/tcp>. The
2128 B<Host> and B<Port> options can be used to change these values, see below.
2129 C<mbmon> has to be running to work correctly. If C<mbmon> is not running
2130 timeouts may appear which may interfere with other statistics..
2132 C<mbmon> must be run with the -r option ("print TAG and Value format");
2133 Debian's F</etc/init.d/mbmon> script already does this, other people
2134 will need to ensure that this is the case.
2136 =over 4
2138 =item B<Host> I<Hostname>
2140 Hostname to connect to. Defaults to B<127.0.0.1>.
2142 =item B<Port> I<Port>
2144 TCP-Port to connect to. Defaults to B<411>.
2146 =back
2148 =head2 Plugin C<md>
2150 The C<md plugin> collects information from Linux Software-RAID devices (md).
2152 All reported values are of the type C<md_disks>. Reported type instances are
2153 I<active>, I<failed> (present but not operational), I<spare> (hot stand-by) and
2154 I<missing> (physically absent) disks.
2156 =over 4
2158 =item B<Device> I<Device>
2160 Select md devices based on device name. The I<device name> is the basename of
2161 the device, i.e. the name of the block device without the leading C</dev/>.
2162 See B<IgnoreSelected> for more details.
2164 =item B<IgnoreSelected> B<true>|B<false>
2166 Invert device selection: If set to B<true>, all md devices B<except> those
2167 listed using B<Device> are collected. If B<false> (the default), only those
2168 listed are collected. If no configuration is given, the B<md> plugin will
2169 collect data from all md devices.
2171 =back
2173 =head2 Plugin C<memcachec>
2175 The C<memcachec plugin> connects to a memcached server, queries one or more
2176 given I<pages> and parses the returned data according to user specification.
2177 The I<matches> used are the same as the matches used in the C<curl> and C<tail>
2178 plugins.
2180 In order to talk to the memcached server, this plugin uses the I<libmemcached>
2181 library. Please note that there is another library with a very similar name,
2182 libmemcache (notice the missing `d'), which is not applicable.
2184 Synopsis of the configuration:
2186  <Plugin "memcachec">
2187    <Page "plugin_instance">
2188      Server "localhost"
2189      Key "page_key"
2190      <Match>
2191        Regex "(\\d+) bytes sent"
2192        DSType CounterAdd
2193        Type "ipt_octets"
2194        Instance "type_instance"
2195      </Match>
2196    </Page>
2197  </Plugin>
2199 The configuration options are:
2201 =over 4
2203 =item E<lt>B<Page> I<Name>E<gt>
2205 Each B<Page> block defines one I<page> to be queried from the memcached server.
2206 The block requires one string argument which is used as I<plugin instance>.
2208 =item B<Server> I<Address>
2210 Sets the server address to connect to when querying the page. Must be inside a
2211 B<Page> block.
2213 =item B<Key> I<Key>
2215 When connected to the memcached server, asks for the page I<Key>.
2217 =item E<lt>B<Match>E<gt>
2219 Match blocks define which strings to look for and how matches substrings are
2220 interpreted. For a description of match blocks, please see L<"Plugin tail">.
2222 =back
2224 =head2 Plugin C<memcached>
2226 The C<memcached plugin> connects to a memcached server and queries statistics
2227 about cache utilization, memory and bandwidth used.
2228 L<http://www.danga.com/memcached/>
2230  <Plugin "memcached">
2231    <Instance "name">
2232      Host "memcache.example.com"
2233      Port 11211
2234    </Instance>
2235  </Plugin>
2237 The plugin configuration consists of one or more B<Instance> blocks which
2238 specify one I<memcached> connection each. Within the B<Instance> blocks, the
2239 following options are allowed:
2241 =over 4
2243 =item B<Host> I<Hostname>
2245 Hostname to connect to. Defaults to B<127.0.0.1>.
2247 =item B<Port> I<Port>
2249 TCP-Port to connect to. Defaults to B<11211>.
2251 =item B<Socket> I<Path>
2253 Connect to I<memcached> using the UNIX domain socket at I<Path>. If this
2254 setting is given, the B<Host> and B<Port> settings are ignored.
2256 =back
2258 =head2 Plugin C<modbus>
2260 The B<modbus plugin> connects to a Modbus "slave" via Modbus/TCP and reads
2261 register values. It supports reading single registers (unsigned 16E<nbsp>bit
2262 values), large integer values (unsigned 32E<nbsp>bit values) and floating point
2263 values (two registers interpreted as IEEE floats in big endian notation).
2265 Synopsis:
2267  <Data "voltage-input-1">
2268    RegisterBase 0
2269    RegisterType float
2270    Type voltage
2271    Instance "input-1"
2272  </Data>
2273  
2274  <Data "voltage-input-2">
2275    RegisterBase 2
2276    RegisterType float
2277    Type voltage
2278    Instance "input-2"
2279  </Data>
2280  
2281  <Host "modbus.example.com">
2282    Address "192.168.0.42"
2283    Port    "502"
2284    Interval 60
2285    
2286    <Slave 1>
2287      Instance "power-supply"
2288      Collect  "voltage-input-1"
2289      Collect  "voltage-input-2"
2290    </Slave>
2291  </Host>
2293 =over 4
2295 =item E<lt>B<Data> I<Name>E<gt> blocks
2297 Data blocks define a mapping between register numbers and the "types" used by
2298 I<collectd>.
2300 Within E<lt>DataE<nbsp>/E<gt> blocks, the following options are allowed:
2302 =over 4
2304 =item B<RegisterBase> I<Number>
2306 Configures the base register to read from the device. If the option
2307 B<RegisterType> has been set to B<Uint32> or B<Float>, this and the next
2308 register will be read (the register number is increased by one).
2310 =item B<RegisterType> B<Int16>|B<Int32>|B<Uint16>|B<Uint32>|B<Float>
2312 Specifies what kind of data is returned by the device. If the type is B<Int32>,
2313 B<Uint32> or B<Float>, two 16E<nbsp>bit registers will be read and the data is
2314 combined into one value. Defaults to B<Uint16>.
2316 =item B<Type> I<Type>
2318 Specifies the "type" (data set) to use when dispatching the value to
2319 I<collectd>. Currently, only data sets with exactly one data source are
2320 supported.
2322 =item B<Instance> I<Instance>
2324 Sets the type instance to use when dispatching the value to I<collectd>. If
2325 unset, an empty string (no type instance) is used.
2327 =back
2329 =item E<lt>B<Host> I<Name>E<gt> blocks
2331 Host blocks are used to specify to which hosts to connect and what data to read
2332 from their "slaves". The string argument I<Name> is used as hostname when
2333 dispatching the values to I<collectd>.
2335 Within E<lt>HostE<nbsp>/E<gt> blocks, the following options are allowed:
2337 =over 4
2339 =item B<Address> I<Hostname>
2341 Specifies the node name (the actual network address) used to connect to the
2342 host. This may be an IP address or a hostname. Please note that the used
2343 I<libmodbus> library only supports IPv4 at the moment.
2345 =item B<Port> I<Service>
2347 Specifies the port used to connect to the host. The port can either be given as
2348 a number or as a service name. Please note that the I<Service> argument must be
2349 a string, even if ports are given in their numerical form. Defaults to "502".
2351 =item B<Interval> I<Interval>
2353 Sets the interval (in seconds) in which the values will be collected from this
2354 host. By default the global B<Interval> setting will be used.
2356 =item E<lt>B<Slave> I<ID>E<gt>
2358 Over each TCP connection, multiple Modbus devices may be reached. The slave ID
2359 is used to specify which device should be addressed. For each device you want
2360 to query, one B<Slave> block must be given.
2362 Within E<lt>SlaveE<nbsp>/E<gt> blocks, the following options are allowed:
2364 =over 4
2366 =item B<Instance> I<Instance>
2368 Specify the plugin instance to use when dispatching the values to I<collectd>.
2369 By default "slave_I<ID>" is used.
2371 =item B<Collect> I<DataName>
2373 Specifies which data to retrieve from the device. I<DataName> must be the same
2374 string as the I<Name> argument passed to a B<Data> block. You can specify this
2375 option multiple times to collect more than one value from a slave. At least one
2376 B<Collect> option is mandatory.
2378 =back
2380 =back
2382 =back
2384 =head2 Plugin C<mysql>
2386 The C<mysql plugin> requires B<mysqlclient> to be installed. It connects to
2387 one or more databases when started and keeps the connection up as long as
2388 possible. When the connection is interrupted for whatever reason it will try
2389 to re-connect. The plugin will complain loudly in case anything goes wrong.
2391 This plugin issues the MySQL C<SHOW STATUS> / C<SHOW GLOBAL STATUS> command
2392 and collects information about MySQL network traffic, executed statements,
2393 requests, the query cache and threads by evaluating the
2394 C<Bytes_{received,sent}>, C<Com_*>, C<Handler_*>, C<Qcache_*> and C<Threads_*>
2395 return values. Please refer to the B<MySQL reference manual>, I<5.1.6. Server
2396 Status Variables> for an explanation of these values.
2398 Optionally, master and slave statistics may be collected in a MySQL
2399 replication setup. In that case, information about the synchronization state
2400 of the nodes are collected by evaluating the C<Position> return value of the
2401 C<SHOW MASTER STATUS> command and the C<Seconds_Behind_Master>,
2402 C<Read_Master_Log_Pos> and C<Exec_Master_Log_Pos> return values of the
2403 C<SHOW SLAVE STATUS> command. See the B<MySQL reference manual>,
2404 I<12.5.5.21 SHOW MASTER STATUS Syntax> and
2405 I<12.5.5.31 SHOW SLAVE STATUS Syntax> for details.
2407 Synopsis:
2409   <Plugin mysql>
2410     <Database foo>
2411       Host "hostname"
2412       User "username"
2413       Password "password"
2414       Port "3306"
2415       MasterStats true
2416     </Database>
2418     <Database bar>
2419       Host "localhost"
2420       Socket "/var/run/mysql/mysqld.sock"
2421       SlaveStats true
2422       SlaveNotifications true
2423     </Database>
2424   </Plugin>
2426 A B<Database> block defines one connection to a MySQL database. It accepts a
2427 single argument which specifies the name of the database. None of the other
2428 options are required. MySQL will use default values as documented in the
2429 section "mysql_real_connect()" in the B<MySQL reference manual>.
2431 =over 4
2433 =item B<Host> I<Hostname>
2435 Hostname of the database server. Defaults to B<localhost>.
2437 =item B<User> I<Username>
2439 Username to use when connecting to the database. The user does not have to be
2440 granted any privileges (which is synonym to granting the C<USAGE> privilege),
2441 unless you want to collectd replication statistics (see B<MasterStats> and
2442 B<SlaveStats> below). In this case, the user needs the C<REPLICATION CLIENT>
2443 (or C<SUPER>) privileges. Else, any existing MySQL user will do.
2445 =item B<Password> I<Password>
2447 Password needed to log into the database.
2449 =item B<Database> I<Database>
2451 Select this database. Defaults to I<no database> which is a perfectly reasonable
2452 option for what this plugin does.
2454 =item B<Port> I<Port>
2456 TCP-port to connect to. The port must be specified in its numeric form, but it
2457 must be passed as a string nonetheless. For example:
2459   Port "3306"
2461 If B<Host> is set to B<localhost> (the default), this setting has no effect.
2462 See the documentation for the C<mysql_real_connect> function for details.
2464 =item B<Socket> I<Socket>
2466 Specifies the path to the UNIX domain socket of the MySQL server. This option
2467 only has any effect, if B<Host> is set to B<localhost> (the default).
2468 Otherwise, use the B<Port> option above. See the documentation for the
2469 C<mysql_real_connect> function for details.
2471 =item B<MasterStats> I<true|false>
2473 =item B<SlaveStats> I<true|false>
2475 Enable the collection of master / slave statistics in a replication setup. In
2476 order to be able to get access to these statistics, the user needs special
2477 privileges. See the B<User> documentation above.
2479 =item B<SlaveNotifications> I<true|false>
2481 If enabled, the plugin sends a notification if the replication slave I/O and /
2482 or SQL threads are not running.
2484 =back
2486 =head2 Plugin C<netapp>
2488 The netapp plugin can collect various performance and capacity information
2489 from a NetApp filer using the NetApp API.
2491 Please note that NetApp has a wide line of products and a lot of different
2492 software versions for each of these products. This plugin was developed for a
2493 NetApp FAS3040 running OnTap 7.2.3P8 and tested on FAS2050 7.3.1.1L1,
2494 FAS3140 7.2.5.1 and FAS3020 7.2.4P9. It I<should> work for most combinations of
2495 model and software version but it is very hard to test this.
2496 If you have used this plugin with other models and/or software version, feel
2497 free to send us a mail to tell us about the results, even if it's just a short
2498 "It works".
2500 To collect these data collectd will log in to the NetApp via HTTP(S) and HTTP
2501 basic authentication.
2503 B<Do not use a regular user for this!> Create a special collectd user with just
2504 the minimum of capabilities needed. The user only needs the "login-http-admin"
2505 capability as well as a few more depending on which data will be collected.
2506 Required capabilities are documented below.
2508 =head3 Synopsis
2510  <Plugin "netapp">
2511    <Host "netapp1.example.com">
2512     Protocol      "https"
2513     Address       "10.0.0.1"
2514     Port          443
2515     User          "username"
2516     Password      "aef4Aebe"
2517     Interval      30
2518     
2519     <WAFL>
2520       Interval 30
2521       GetNameCache   true
2522       GetDirCache    true
2523       GetBufferCache true
2524       GetInodeCache  true
2525     </WAFL>
2526     
2527     <Disks>
2528       Interval 30
2529       GetBusy true
2530     </Disks>
2531     
2532     <VolumePerf>
2533       Interval 30
2534       GetIO      "volume0"
2535       IgnoreSelectedIO      false
2536       GetOps     "volume0"
2537       IgnoreSelectedOps     false
2538       GetLatency "volume0"
2539       IgnoreSelectedLatency false
2540     </VolumePerf>
2541     
2542     <VolumeUsage>
2543       Interval 30
2544       GetCapacity "vol0"
2545       GetCapacity "vol1"
2546       IgnoreSelectedCapacity false
2547       GetSnapshot "vol1"
2548       GetSnapshot "vol3"
2549       IgnoreSelectedSnapshot false
2550     </VolumeUsage>
2551     
2552     <Quota>
2553       Interval 60
2554     </Quota>
2555     
2556     <Snapvault>
2557       Interval 30
2558     </Snapvault>
2559     
2560     <System>
2561       Interval 30
2562       GetCPULoad     true
2563       GetInterfaces  true
2564       GetDiskOps     true
2565       GetDiskIO      true
2566     </System>
2568     <VFiler vfilerA>
2569       Interval 60
2571       SnapVault true
2572       # ...
2573     </VFiler>
2574    </Host>
2575  </Plugin>
2577 The netapp plugin accepts the following configuration options:
2579 =over 4
2581 =item B<Host> I<Name>
2583 A host block defines one NetApp filer. It will appear in collectd with the name
2584 you specify here which does not have to be its real name nor its hostname (see
2585 the B<Address> option below).
2587 =item B<VFiler> I<Name>
2589 A B<VFiler> block may only be used inside a host block. It accepts all the
2590 same options as the B<Host> block (except for cascaded B<VFiler> blocks) and
2591 will execute all NetApp API commands in the context of the specified
2592 VFiler(R). It will appear in collectd with the name you specify here which
2593 does not have to be its real name. The VFiler name may be specified using the
2594 B<VFilerName> option. If this is not specified, it will default to the name
2595 you specify here.
2597 The VFiler block inherits all connection related settings from the surrounding
2598 B<Host> block (which appear before the B<VFiler> block) but they may be
2599 overwritten inside the B<VFiler> block.
2601 This feature is useful, for example, when using a VFiler as SnapVault target
2602 (supported since OnTap 8.1). In that case, the SnapVault statistics are not
2603 available in the host filer (vfiler0) but only in the respective VFiler
2604 context.
2606 =item B<Protocol> B<httpd>|B<http>
2608 The protocol collectd will use to query this host.
2610 Optional
2612 Type: string
2614 Default: https
2616 Valid options: http, https
2618 =item B<Address> I<Address>
2620 The hostname or IP address of the host.
2622 Optional
2624 Type: string
2626 Default: The "host" block's name.
2628 =item B<Port> I<Port>
2630 The TCP port to connect to on the host.
2632 Optional
2634 Type: integer
2636 Default: 80 for protocol "http", 443 for protocol "https"
2638 =item B<User> I<User>
2640 =item B<Password> I<Password>
2642 The username and password to use to login to the NetApp.
2644 Mandatory
2646 Type: string
2648 =item B<VFilerName> I<Name>
2650 The name of the VFiler in which context to execute API commands. If not
2651 specified, the name provided to the B<VFiler> block will be used instead.
2653 Optional
2655 Type: string
2657 Default: name of the B<VFiler> block
2659 B<Note:> This option may only be used inside B<VFiler> blocks.
2661 =item B<Interval> I<Interval>
2663 B<TODO>
2665 =back
2667 The following options decide what kind of data will be collected. You can
2668 either use them as a block and fine tune various parameters inside this block,
2669 use them as a single statement to just accept all default values, or omit it to
2670 not collect any data.
2672 The following options are valid inside all blocks:
2674 =over 4
2676 =item B<Interval> I<Seconds>
2678 Collect the respective statistics every I<Seconds> seconds. Defaults to the
2679 host specific setting.
2681 =back
2683 =head3 The System block
2685 This will collect various performance data about the whole system.
2687 B<Note:> To get this data the collectd user needs the
2688 "api-perf-object-get-instances" capability.
2690 =over 4
2692 =item B<Interval> I<Seconds>
2694 Collect disk statistics every I<Seconds> seconds.
2696 =item B<GetCPULoad> B<true>|B<false>
2698 If you set this option to true the current CPU usage will be read. This will be
2699 the average usage between all CPUs in your NetApp without any information about
2700 individual CPUs.
2702 B<Note:> These are the same values that the NetApp CLI command "sysstat"
2703 returns in the "CPU" field.
2705 Optional
2707 Type: boolean
2709 Default: true
2711 Result: Two value lists of type "cpu", and type instances "idle" and "system".
2713 =item B<GetInterfaces> B<true>|B<false>
2715 If you set this option to true the current traffic of the network interfaces
2716 will be read. This will be the total traffic over all interfaces of your NetApp
2717 without any information about individual interfaces.
2719 B<Note:> This is the same values that the NetApp CLI command "sysstat" returns
2720 in the "Net kB/s" field.
2722 B<Or is it?>
2724 Optional
2726 Type: boolean
2728 Default: true
2730 Result: One value list of type "if_octects".
2732 =item B<GetDiskIO> B<true>|B<false>
2734 If you set this option to true the current IO throughput will be read. This
2735 will be the total IO of your NetApp without any information about individual
2736 disks, volumes or aggregates.
2738 B<Note:> This is the same values that the NetApp CLI command "sysstat" returns
2739 in the "DiskE<nbsp>kB/s" field.
2741 Optional
2743 Type: boolean
2745 Default: true
2747 Result: One value list of type "disk_octets".
2749 =item B<GetDiskOps> B<true>|B<false>
2751 If you set this option to true the current number of HTTP, NFS, CIFS, FCP,
2752 iSCSI, etc. operations will be read. This will be the total number of
2753 operations on your NetApp without any information about individual volumes or
2754 aggregates.
2756 B<Note:> These are the same values that the NetApp CLI command "sysstat"
2757 returns in the "NFS", "CIFS", "HTTP", "FCP" and "iSCSI" fields.
2759 Optional
2761 Type: boolean
2763 Default: true
2765 Result: A variable number of value lists of type "disk_ops_complex". Each type
2766 of operation will result in one value list with the name of the operation as
2767 type instance.
2769 =back
2771 =head3 The WAFL block
2773 This will collect various performance data about the WAFL file system. At the
2774 moment this just means cache performance.
2776 B<Note:> To get this data the collectd user needs the
2777 "api-perf-object-get-instances" capability.
2779 B<Note:> The interface to get these values is classified as "Diagnostics" by
2780 NetApp. This means that it is not guaranteed to be stable even between minor
2781 releases.
2783 =over 4
2785 =item B<Interval> I<Seconds>
2787 Collect disk statistics every I<Seconds> seconds.
2789 =item B<GetNameCache> B<true>|B<false>
2791 Optional
2793 Type: boolean
2795 Default: true
2797 Result: One value list of type "cache_ratio" and type instance
2798 "name_cache_hit".
2800 =item B<GetDirCache> B<true>|B<false>
2802 Optional
2804 Type: boolean
2806 Default: true
2808 Result: One value list of type "cache_ratio" and type instance "find_dir_hit".
2810 =item B<GetInodeCache> B<true>|B<false>
2812 Optional
2814 Type: boolean
2816 Default: true
2818 Result: One value list of type "cache_ratio" and type instance
2819 "inode_cache_hit".
2821 =item B<GetBufferCache> B<true>|B<false>
2823 B<Note:> This is the same value that the NetApp CLI command "sysstat" returns
2824 in the "Cache hit" field.
2826 Optional
2828 Type: boolean
2830 Default: true
2832 Result: One value list of type "cache_ratio" and type instance "buf_hash_hit".
2834 =back
2836 =head3 The Disks block
2838 This will collect performance data about the individual disks in the NetApp.
2840 B<Note:> To get this data the collectd user needs the
2841 "api-perf-object-get-instances" capability.
2843 =over 4
2845 =item B<Interval> I<Seconds>
2847 Collect disk statistics every I<Seconds> seconds.
2849 =item B<GetBusy> B<true>|B<false>
2851 If you set this option to true the busy time of all disks will be calculated
2852 and the value of the busiest disk in the system will be written.
2854 B<Note:> This is the same values that the NetApp CLI command "sysstat" returns
2855 in the "Disk util" field. Probably.
2857 Optional
2859 Type: boolean
2861 Default: true
2863 Result: One value list of type "percent" and type instance "disk_busy".
2865 =back
2867 =head3 The VolumePerf block
2869 This will collect various performance data about the individual volumes.
2871 You can select which data to collect about which volume using the following
2872 options. They follow the standard ignorelist semantic.
2874 B<Note:> To get this data the collectd user needs the
2875 I<api-perf-object-get-instances> capability.
2877 =over 4
2879 =item B<Interval> I<Seconds>
2881 Collect volume performance data every I<Seconds> seconds.
2883 =item B<GetIO> I<Volume>
2885 =item B<GetOps> I<Volume>
2887 =item B<GetLatency> I<Volume>
2889 Select the given volume for IO, operations or latency statistics collection.
2890 The argument is the name of the volume without the C</vol/> prefix.
2892 Since the standard ignorelist functionality is used here, you can use a string
2893 starting and ending with a slash to specify regular expression matching: To
2894 match the volumes "vol0", "vol2" and "vol7", you can use this regular
2895 expression:
2897   GetIO "/^vol[027]$/"
2899 If no regular expression is specified, an exact match is required. Both,
2900 regular and exact matching are case sensitive.
2902 If no volume was specified at all for either of the three options, that data
2903 will be collected for all available volumes.
2905 =item B<IgnoreSelectedIO> B<true>|B<false>
2907 =item B<IgnoreSelectedOps> B<true>|B<false>
2909 =item B<IgnoreSelectedLatency> B<true>|B<false>
2911 When set to B<true>, the volumes selected for IO, operations or latency
2912 statistics collection will be ignored and the data will be collected for all
2913 other volumes.
2915 When set to B<false>, data will only be collected for the specified volumes and
2916 all other volumes will be ignored.
2918 If no volumes have been specified with the above B<Get*> options, all volumes
2919 will be collected regardless of the B<IgnoreSelected*> option.
2921 Defaults to B<false>
2923 =back
2925 =head3 The VolumeUsage block
2927 This will collect capacity data about the individual volumes.
2929 B<Note:> To get this data the collectd user needs the I<api-volume-list-info>
2930 capability.
2932 =over 4
2934 =item B<Interval> I<Seconds>
2936 Collect volume usage statistics every I<Seconds> seconds.
2938 =item B<GetCapacity> I<VolumeName>
2940 The current capacity of the volume will be collected. This will result in two
2941 to four value lists, depending on the configuration of the volume. All data
2942 sources are of type "df_complex" with the name of the volume as
2943 plugin_instance.
2945 There will be type_instances "used" and "free" for the number of used and
2946 available bytes on the volume.  If the volume has some space reserved for
2947 snapshots, a type_instance "snap_reserved" will be available.  If the volume
2948 has SIS enabled, a type_instance "sis_saved" will be available. This is the
2949 number of bytes saved by the SIS feature.
2951 B<Note:> The current NetApp API has a bug that results in this value being
2952 reported as a 32E<nbsp>bit number. This plugin tries to guess the correct
2953 number which works most of the time.  If you see strange values here, bug
2954 NetApp support to fix this.
2956 Repeat this option to specify multiple volumes.
2958 =item B<IgnoreSelectedCapacity> B<true>|B<false>
2960 Specify whether to collect only the volumes selected by the B<GetCapacity>
2961 option or to ignore those volumes. B<IgnoreSelectedCapacity> defaults to
2962 B<false>. However, if no B<GetCapacity> option is specified at all, all
2963 capacities will be selected anyway.
2965 =item B<GetSnapshot> I<VolumeName>
2967 Select volumes from which to collect snapshot information.
2969 Usually, the space used for snapshots is included in the space reported as
2970 "used". If snapshot information is collected as well, the space used for
2971 snapshots is subtracted from the used space.
2973 To make things even more interesting, it is possible to reserve space to be
2974 used for snapshots. If the space required for snapshots is less than that
2975 reserved space, there is "reserved free" and "reserved used" space in addition
2976 to "free" and "used". If the space required for snapshots exceeds the reserved
2977 space, that part allocated in the normal space is subtracted from the "used"
2978 space again.
2980 Repeat this option to specify multiple volumes.
2982 =item B<IgnoreSelectedSnapshot>
2984 Specify whether to collect only the volumes selected by the B<GetSnapshot>
2985 option or to ignore those volumes. B<IgnoreSelectedSnapshot> defaults to
2986 B<false>. However, if no B<GetSnapshot> option is specified at all, all
2987 capacities will be selected anyway.
2989 =back
2991 =head3 The Quota block
2993 This will collect (tree) quota statistics (used disk space and number of used
2994 files). This mechanism is useful to get usage information for single qtrees.
2995 In case the quotas are not used for any other purpose, an entry similar to the
2996 following in C</etc/quotas> would be sufficient:
2998   /vol/volA/some_qtree tree - - - - -
3000 After adding the entry, issue C<quota on -w volA> on the NetApp filer.
3002 =over 4
3004 =item B<Interval> I<Seconds>
3006 Collect SnapVault(R) statistics every I<Seconds> seconds.
3008 =back
3010 =head3 The SnapVault block
3012 This will collect statistics about the time and traffic of SnapVault(R)
3013 transfers.
3015 =over 4
3017 =item B<Interval> I<Seconds>
3019 Collect SnapVault(R) statistics every I<Seconds> seconds.
3021 =back
3023 =head2 Plugin C<netlink>
3025 The C<netlink> plugin uses a netlink socket to query the Linux kernel about
3026 statistics of various interface and routing aspects.
3028 =over 4
3030 =item B<Interface> I<Interface>
3032 =item B<VerboseInterface> I<Interface>
3034 Instruct the plugin to collect interface statistics. This is basically the same
3035 as the statistics provided by the C<interface> plugin (see above) but
3036 potentially much more detailed.
3038 When configuring with B<Interface> only the basic statistics will be collected,
3039 namely octets, packets, and errors. These statistics are collected by
3040 the C<interface> plugin, too, so using both at the same time is no benefit.
3042 When configured with B<VerboseInterface> all counters B<except> the basic ones,
3043 so that no data needs to be collected twice if you use the C<interface> plugin.
3044 This includes dropped packets, received multicast packets, collisions and a
3045 whole zoo of differentiated RX and TX errors. You can try the following command
3046 to get an idea of what awaits you:
3048   ip -s -s link list
3050 If I<Interface> is B<All>, all interfaces will be selected.
3052 =item B<QDisc> I<Interface> [I<QDisc>]
3054 =item B<Class> I<Interface> [I<Class>]
3056 =item B<Filter> I<Interface> [I<Filter>]
3058 Collect the octets and packets that pass a certain qdisc, class or filter.
3060 QDiscs and classes are identified by their type and handle (or classid).
3061 Filters don't necessarily have a handle, therefore the parent's handle is used.
3062 The notation used in collectd differs from that used in tc(1) in that it
3063 doesn't skip the major or minor number if it's zero and doesn't print special
3064 ids by their name. So, for example, a qdisc may be identified by
3065 C<pfifo_fast-1:0> even though the minor number of B<all> qdiscs is zero and
3066 thus not displayed by tc(1).
3068 If B<QDisc>, B<Class>, or B<Filter> is given without the second argument,
3069 i.E<nbsp>.e. without an identifier, all qdiscs, classes, or filters that are
3070 associated with that interface will be collected.
3072 Since a filter itself doesn't necessarily have a handle, the parent's handle is
3073 used. This may lead to problems when more than one filter is attached to a
3074 qdisc or class. This isn't nice, but we don't know how this could be done any
3075 better. If you have a idea, please don't hesitate to tell us.
3077 As with the B<Interface> option you can specify B<All> as the interface,
3078 meaning all interfaces.
3080 Here are some examples to help you understand the above text more easily:
3082   <Plugin netlink>
3083     VerboseInterface "All"
3084     QDisc "eth0" "pfifo_fast-1:0"
3085     QDisc "ppp0"
3086     Class "ppp0" "htb-1:10"
3087     Filter "ppp0" "u32-1:0"
3088   </Plugin>
3090 =item B<IgnoreSelected>
3092 The behavior is the same as with all other similar plugins: If nothing is
3093 selected at all, everything is collected. If some things are selected using the
3094 options described above, only these statistics are collected. If you set
3095 B<IgnoreSelected> to B<true>, this behavior is inverted, i.E<nbsp>e. the
3096 specified statistics will not be collected.
3098 =back
3100 =head2 Plugin C<network>
3102 The Network plugin sends data to a remote instance of collectd, receives data
3103 from a remote instance, or both at the same time. Data which has been received
3104 from the network is usually not transmitted again, but this can be activated, see
3105 the B<Forward> option below.
3107 The default IPv6 multicast group is C<ff18::efc0:4a42>. The default IPv4
3108 multicast group is C<239.192.74.66>. The default I<UDP> port is B<25826>.
3110 Both, B<Server> and B<Listen> can be used as single option or as block. When
3111 used as block, given options are valid for this socket only. The following
3112 example will export the metrics twice: Once to an "internal" server (without
3113 encryption and signing) and one to an external server (with cryptographic
3114 signature):
3116  <Plugin "network">
3117    # Export to an internal server
3118    # (demonstrates usage without additional options)
3119    Server "collectd.internal.tld"
3120    
3121    # Export to an external server
3122    # (demonstrates usage with signature options)
3123    <Server "collectd.external.tld">
3124      SecurityLevel "sign"
3125      Username "myhostname"
3126      Password "ohl0eQue"
3127    </Server>
3128  </Plugin>
3130 =over 4
3132 =item B<E<lt>Server> I<Host> [I<Port>]B<E<gt>>
3134 The B<Server> statement/block sets the server to send datagrams to. The
3135 statement may occur multiple times to send each datagram to multiple
3136 destinations.
3138 The argument I<Host> may be a hostname, an IPv4 address or an IPv6 address. The
3139 optional second argument specifies a port number or a service name. If not
3140 given, the default, B<25826>, is used.
3142 The following options are recognized within B<Server> blocks:
3144 =over 4
3146 =item B<SecurityLevel> B<Encrypt>|B<Sign>|B<None>
3148 Set the security you require for network communication. When the security level
3149 has been set to B<Encrypt>, data sent over the network will be encrypted using
3150 I<AES-256>. The integrity of encrypted packets is ensured using I<SHA-1>. When
3151 set to B<Sign>, transmitted data is signed using the I<HMAC-SHA-256> message
3152 authentication code. When set to B<None>, data is sent without any security.
3154 This feature is only available if the I<network> plugin was linked with
3155 I<libgcrypt>.
3157 =item B<Username> I<Username>
3159 Sets the username to transmit. This is used by the server to lookup the
3160 password. See B<AuthFile> below. All security levels except B<None> require
3161 this setting.
3163 This feature is only available if the I<network> plugin was linked with
3164 I<libgcrypt>.
3166 =item B<Password> I<Password>
3168 Sets a password (shared secret) for this socket. All security levels except
3169 B<None> require this setting.
3171 This feature is only available if the I<network> plugin was linked with
3172 I<libgcrypt>.
3174 =item B<Interface> I<Interface name>
3176 Set the outgoing interface for IP packets. This applies at least
3177 to IPv6 packets and if possible to IPv4. If this option is not applicable,
3178 undefined or a non-existent interface name is specified, the default
3179 behavior is to let the kernel choose the appropriate interface. Be warned
3180 that the manual selection of an interface for unicast traffic is only
3181 necessary in rare cases.
3183 =back
3185 =item B<E<lt>Listen> I<Host> [I<Port>]B<E<gt>>
3187 The B<Listen> statement sets the interfaces to bind to. When multiple
3188 statements are found the daemon will bind to multiple interfaces.
3190 The argument I<Host> may be a hostname, an IPv4 address or an IPv6 address. If
3191 the argument is a multicast address the daemon will join that multicast group.
3192 The optional second argument specifies a port number or a service name. If not
3193 given, the default, B<25826>, is used.
3195 The following options are recognized within C<E<lt>ListenE<gt>> blocks:
3197 =over 4
3199 =item B<SecurityLevel> B<Encrypt>|B<Sign>|B<None>
3201 Set the security you require for network communication. When the security level
3202 has been set to B<Encrypt>, only encrypted data will be accepted. The integrity
3203 of encrypted packets is ensured using I<SHA-1>. When set to B<Sign>, only
3204 signed and encrypted data is accepted. When set to B<None>, all data will be
3205 accepted. If an B<AuthFile> option was given (see below), encrypted data is
3206 decrypted if possible.
3208 This feature is only available if the I<network> plugin was linked with
3209 I<libgcrypt>.
3211 =item B<AuthFile> I<Filename>
3213 Sets a file in which usernames are mapped to passwords. These passwords are
3214 used to verify signatures and to decrypt encrypted network packets. If
3215 B<SecurityLevel> is set to B<None>, this is optional. If given, signed data is
3216 verified and encrypted packets are decrypted. Otherwise, signed data is
3217 accepted without checking the signature and encrypted data cannot be decrypted.
3218 For the other security levels this option is mandatory.
3220 The file format is very simple: Each line consists of a username followed by a
3221 colon and any number of spaces followed by the password. To demonstrate, an
3222 example file could look like this:
3224   user0: foo
3225   user1: bar
3227 Each time a packet is received, the modification time of the file is checked
3228 using L<stat(2)>. If the file has been changed, the contents is re-read. While
3229 the file is being read, it is locked using L<fcntl(2)>.
3231 =item B<Interface> I<Interface name>
3233 Set the incoming interface for IP packets explicitly. This applies at least
3234 to IPv6 packets and if possible to IPv4. If this option is not applicable,
3235 undefined or a non-existent interface name is specified, the default
3236 behavior is, to let the kernel choose the appropriate interface. Thus incoming
3237 traffic gets only accepted, if it arrives on the given interface.
3239 =back
3241 =item B<TimeToLive> I<1-255>
3243 Set the time-to-live of sent packets. This applies to all, unicast and
3244 multicast, and IPv4 and IPv6 packets. The default is to not change this value.
3245 That means that multicast packets will be sent with a TTL of C<1> (one) on most
3246 operating systems.
3248 =item B<MaxPacketSize> I<1024-65535>
3250 Set the maximum size for datagrams received over the network. Packets larger
3251 than this will be truncated. Defaults to 1452E<nbsp>bytes, which is the maximum
3252 payload size that can be transmitted in one Ethernet frame using IPv6E<nbsp>/
3253 UDP.
3255 On the server side, this limit should be set to the largest value used on
3256 I<any> client. Likewise, the value on the client must not be larger than the
3257 value on the server, or data will be lost.
3259 B<Compatibility:> Versions prior to I<versionE<nbsp>4.8> used a fixed sized
3260 buffer of 1024E<nbsp>bytes. Versions I<4.8>, I<4.9> and I<4.10> used a default
3261 value of 1024E<nbsp>bytes to avoid problems when sending data to an older
3262 server.
3264 =item B<Forward> I<true|false>
3266 If set to I<true>, write packets that were received via the network plugin to
3267 the sending sockets. This should only be activated when the B<Listen>- and
3268 B<Server>-statements differ. Otherwise packets may be send multiple times to
3269 the same multicast group. While this results in more network traffic than
3270 necessary it's not a huge problem since the plugin has a duplicate detection,
3271 so the values will not loop.
3273 =item B<ReportStats> B<true>|B<false>
3275 The network plugin cannot only receive and send statistics, it can also create
3276 statistics about itself. Collected data included the number of received and
3277 sent octets and packets, the length of the receive queue and the number of
3278 values handled. When set to B<true>, the I<Network plugin> will make these
3279 statistics available. Defaults to B<false>.
3281 =back
3283 =head2 Plugin C<nginx>
3285 This plugin collects the number of connections and requests handled by the
3286 C<nginx daemon> (speak: engineE<nbsp>X), a HTTP and mail server/proxy. It
3287 queries the page provided by the C<ngx_http_stub_status_module> module, which
3288 isn't compiled by default. Please refer to
3289 L<http://wiki.codemongers.com/NginxStubStatusModule> for more information on
3290 how to compile and configure nginx and this module.
3292 The following options are accepted by the C<nginx plugin>:
3294 =over 4
3296 =item B<URL> I<http://host/nginx_status>
3298 Sets the URL of the C<ngx_http_stub_status_module> output.
3300 =item B<User> I<Username>
3302 Optional user name needed for authentication.
3304 =item B<Password> I<Password>
3306 Optional password needed for authentication.
3308 =item B<VerifyPeer> B<true|false>
3310 Enable or disable peer SSL certificate verification. See
3311 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
3313 =item B<VerifyHost> B<true|false>
3315 Enable or disable peer host name verification. If enabled, the plugin checks
3316 if the C<Common Name> or a C<Subject Alternate Name> field of the SSL
3317 certificate matches the host name provided by the B<URL> option. If this
3318 identity check fails, the connection is aborted. Obviously, only works when
3319 connecting to a SSL enabled server. Enabled by default.
3321 =item B<CACert> I<File>
3323 File that holds one or more SSL certificates. If you want to use HTTPS you will
3324 possibly need this option. What CA certificates come bundled with C<libcurl>
3325 and are checked by default depends on the distribution you use.
3327 =back
3329 =head2 Plugin C<notify_desktop>
3331 This plugin sends a desktop notification to a notification daemon, as defined
3332 in the Desktop Notification Specification. To actually display the
3333 notifications, B<notification-daemon> is required and B<collectd> has to be
3334 able to access the X server (i.E<nbsp>e., the C<DISPLAY> and C<XAUTHORITY>
3335 environment variables have to be set correctly) and the D-Bus message bus.
3337 The Desktop Notification Specification can be found at
3338 L<http://www.galago-project.org/specs/notification/>.
3340 =over 4
3342 =item B<OkayTimeout> I<timeout>
3344 =item B<WarningTimeout> I<timeout>
3346 =item B<FailureTimeout> I<timeout>
3348 Set the I<timeout>, in milliseconds, after which to expire the notification
3349 for C<OKAY>, C<WARNING> and C<FAILURE> severities respectively. If zero has
3350 been specified, the displayed notification will not be closed at all - the
3351 user has to do so herself. These options default to 5000. If a negative number
3352 has been specified, the default is used as well.
3354 =back
3356 =head2 Plugin C<notify_email>
3358 The I<notify_email> plugin uses the I<ESMTP> library to send notifications to a
3359 configured email address.
3361 I<libESMTP> is available from L<http://www.stafford.uklinux.net/libesmtp/>.
3363 Available configuration options:
3365 =over 4
3367 =item B<From> I<Address>
3369 Email address from which the emails should appear to come from.
3371 Default: C<root@localhost>
3373 =item B<Recipient> I<Address>
3375 Configures the email address(es) to which the notifications should be mailed.
3376 May be repeated to send notifications to multiple addresses.
3378 At least one B<Recipient> must be present for the plugin to work correctly.
3380 =item B<SMTPServer> I<Hostname>
3382 Hostname of the SMTP server to connect to.
3384 Default: C<localhost>
3386 =item B<SMTPPort> I<Port>
3388 TCP port to connect to.
3390 Default: C<25>
3392 =item B<SMTPUser> I<Username>
3394 Username for ASMTP authentication. Optional.
3396 =item B<SMTPPassword> I<Password>
3398 Password for ASMTP authentication. Optional.
3400 =item B<Subject> I<Subject>
3402 Subject-template to use when sending emails. There must be exactly two
3403 string-placeholders in the subject, given in the standard I<printf(3)> syntax,
3404 i.E<nbsp>e. C<%s>. The first will be replaced with the severity, the second
3405 with the hostname.
3407 Default: C<Collectd notify: %s@%s>
3409 =back
3411 =head2 Plugin C<ntpd>
3413 =over 4
3415 =item B<Host> I<Hostname>
3417 Hostname of the host running B<ntpd>. Defaults to B<localhost>.
3419 =item B<Port> I<Port>
3421 UDP-Port to connect to. Defaults to B<123>.
3423 =item B<ReverseLookups> B<true>|B<false>
3425 Sets whether or not to perform reverse lookups on peers. Since the name or
3426 IP-address may be used in a filename it is recommended to disable reverse
3427 lookups. The default is to do reverse lookups to preserve backwards
3428 compatibility, though.
3430 =item B<IncludeUnitID> B<true>|B<false>
3432 When a peer is a refclock, include the unit ID in the I<type instance>.
3433 Defaults to B<false> for backward compatibility.
3435 If two refclock peers use the same driver and this is B<false>, the plugin will
3436 try to write simultaneous measurements from both to the same type instance.
3437 This will result in error messages in the log and only one set of measurements
3438 making it through.
3440 =back
3442 =head2 Plugin C<nut>
3444 =over 4
3446 =item B<UPS> I<upsname>B<@>I<hostname>[B<:>I<port>]
3448 Add a UPS to collect data from. The format is identical to the one accepted by
3449 L<upsc(8)>.
3451 =back
3453 =head2 Plugin C<olsrd>
3455 The I<olsrd> plugin connects to the TCP port opened by the I<txtinfo> plugin of
3456 the Optimized Link State Routing daemon and reads information about the current
3457 state of the meshed network.
3459 The following configuration options are understood:
3461 =over 4
3463 =item B<Host> I<Host>
3465 Connect to I<Host>. Defaults to B<"localhost">.
3467 =item B<Port> I<Port>
3469 Specifies the port to connect to. This must be a string, even if you give the
3470 port as a number rather than a service name. Defaults to B<"2006">.
3472 =item B<CollectLinks> B<No>|B<Summary>|B<Detail>
3474 Specifies what information to collect about links, i.E<nbsp>e. direct
3475 connections of the daemon queried. If set to B<No>, no information is
3476 collected. If set to B<Summary>, the number of links and the average of all
3477 I<link quality> (LQ) and I<neighbor link quality> (NLQ) values is calculated.
3478 If set to B<Detail> LQ and NLQ are collected per link.
3480 Defaults to B<Detail>.
3482 =item B<CollectRoutes> B<No>|B<Summary>|B<Detail>
3484 Specifies what information to collect about routes of the daemon queried. If
3485 set to B<No>, no information is collected. If set to B<Summary>, the number of
3486 routes and the average I<metric> and I<ETX> is calculated. If set to B<Detail>
3487 metric and ETX are collected per route.
3489 Defaults to B<Summary>.
3491 =item B<CollectTopology> B<No>|B<Summary>|B<Detail>
3493 Specifies what information to collect about the global topology. If set to
3494 B<No>, no information is collected. If set to B<Summary>, the number of links
3495 in the entire topology and the average I<link quality> (LQ) is calculated.
3496 If set to B<Detail> LQ and NLQ are collected for each link in the entire topology.
3498 Defaults to B<Summary>.
3500 =back
3502 =head2 Plugin C<onewire>
3504 B<EXPERIMENTAL!> See notes below.
3506 The C<onewire> plugin uses the B<owcapi> library from the B<owfs> project
3507 L<http://owfs.org/> to read sensors connected via the onewire bus.
3509 Currently only temperature sensors (sensors with the family code C<10>,
3510 e.E<nbsp>g. DS1820, DS18S20, DS1920) can be read. If you have other sensors you
3511 would like to have included, please send a sort request to the mailing list.
3513 Hubs (the DS2409 chips) are working, but read the note, why this plugin is
3514 experimental, below.
3516 =over 4
3518 =item B<Device> I<Device>
3520 Sets the device to read the values from. This can either be a "real" hardware
3521 device, such as a serial port or an USB port, or the address of the
3522 L<owserver(1)> socket, usually B<localhost:4304>.
3524 Though the documentation claims to automatically recognize the given address
3525 format, with versionE<nbsp>2.7p4 we had to specify the type explicitly. So
3526 with that version, the following configuration worked for us:
3528   <Plugin onewire>
3529     Device "-s localhost:4304"
3530   </Plugin>
3532 This directive is B<required> and does not have a default value.
3534 =item B<Sensor> I<Sensor>
3536 Selects sensors to collect or to ignore, depending on B<IgnoreSelected>, see
3537 below. Sensors are specified without the family byte at the beginning, to you'd
3538 use C<F10FCA000800>, and B<not> include the leading C<10.> family byte and
3539 point.
3541 =item B<IgnoreSelected> I<true>|I<false>
3543 If no configuration if given, the B<onewire> plugin will collect data from all
3544 sensors found. This may not be practical, especially if sensors are added and
3545 removed regularly. Sometimes, however, it's easier/preferred to collect only
3546 specific sensors or all sensors I<except> a few specified ones. This option
3547 enables you to do that: By setting B<IgnoreSelected> to I<true> the effect of
3548 B<Sensor> is inverted: All selected interfaces are ignored and all other
3549 interfaces are collected.
3551 =item B<Interval> I<Seconds>
3553 Sets the interval in which all sensors should be read. If not specified, the
3554 global B<Interval> setting is used.
3556 =back
3558 B<EXPERIMENTAL!> The C<onewire> plugin is experimental, because it doesn't yet
3559 work with big setups. It works with one sensor being attached to one
3560 controller, but as soon as you throw in a couple more senors and maybe a hub
3561 or two, reading all values will take more than ten seconds (the default
3562 interval). We will probably add some separate thread for reading the sensors
3563 and some cache or something like that, but it's not done yet. We will try to
3564 maintain backwards compatibility in the future, but we can't promise. So in
3565 short: If it works for you: Great! But keep in mind that the config I<might>
3566 change, though this is unlikely. Oh, and if you want to help improving this
3567 plugin, just send a short notice to the mailing list. ThanksE<nbsp>:)
3569 =head2 Plugin C<openvpn>
3571 The OpenVPN plugin reads a status file maintained by OpenVPN and gathers
3572 traffic statistics about connected clients.
3574 To set up OpenVPN to write to the status file periodically, use the
3575 B<--status> option of OpenVPN. Since OpenVPN can write two different formats,
3576 you need to set the required format, too. This is done by setting
3577 B<--status-version> to B<2>.
3579 So, in a nutshell you need:
3581   openvpn $OTHER_OPTIONS \
3582     --status "/var/run/openvpn-status" 10 \
3583     --status-version 2
3585 Available options:
3587 =over 4
3589 =item B<StatusFile> I<File>
3591 Specifies the location of the status file.
3593 =item B<ImprovedNamingSchema> B<true>|B<false>
3595 When enabled, the filename of the status file will be used as plugin instance
3596 and the client's "common name" will be used as type instance. This is required
3597 when reading multiple status files. Enabling this option is recommended, but to
3598 maintain backwards compatibility this option is disabled by default.
3600 =item B<CollectCompression> B<true>|B<false>
3602 Sets whether or not statistics about the compression used by OpenVPN should be
3603 collected. This information is only available in I<single> mode. Enabled by
3604 default.
3606 =item B<CollectIndividualUsers> B<true>|B<false>
3608 Sets whether or not traffic information is collected for each connected client
3609 individually. If set to false, currently no traffic data is collected at all
3610 because aggregating this data in a save manner is tricky. Defaults to B<true>.
3612 =item B<CollectUserCount> B<true>|B<false>
3614 When enabled, the number of currently connected clients or users is collected.
3615 This is especially interesting when B<CollectIndividualUsers> is disabled, but
3616 can be configured independently from that option. Defaults to B<false>.
3618 =back
3620 =head2 Plugin C<oracle>
3622 The "oracle" plugin uses the Oracle® Call Interface I<(OCI)> to connect to an
3623 Oracle® Database and lets you execute SQL statements there. It is very similar
3624 to the "dbi" plugin, because it was written around the same time. See the "dbi"
3625 plugin's documentation above for details.
3627   <Plugin oracle>
3628     <Query "out_of_stock">
3629       Statement "SELECT category, COUNT(*) AS value FROM products WHERE in_stock = 0 GROUP BY category"
3630       <Result>
3631         Type "gauge"
3632         # InstancePrefix "foo"
3633         InstancesFrom "category"
3634         ValuesFrom "value"
3635       </Result>
3636     </Query>
3637     <Database "product_information">
3638       ConnectID "db01"
3639       Username "oracle"
3640       Password "secret"
3641       Query "out_of_stock"
3642     </Database>
3643   </Plugin>
3645 =head3 B<Query> blocks
3647 The Query blocks are handled identically to the Query blocks of the "dbi"
3648 plugin. Please see its documentation above for details on how to specify
3649 queries.
3651 =head3 B<Database> blocks
3653 Database blocks define a connection to a database and which queries should be
3654 sent to that database. Each database needs a "name" as string argument in the
3655 starting tag of the block. This name will be used as "PluginInstance" in the
3656 values submitted to the daemon. Other than that, that name is not used.
3658 =over 4
3660 =item B<ConnectID> I<ID>
3662 Defines the "database alias" or "service name" to connect to. Usually, these
3663 names are defined in the file named C<$ORACLE_HOME/network/admin/tnsnames.ora>.
3665 =item B<Host> I<Host>
3667 Hostname to use when dispatching values for this database. Defaults to using
3668 the global hostname of the I<collectd> instance.
3670 =item B<Username> I<Username>
3672 Username used for authentication.
3674 =item B<Password> I<Password>
3676 Password used for authentication.
3678 =item B<Query> I<QueryName>
3680 Associates the query named I<QueryName> with this database connection. The
3681 query needs to be defined I<before> this statement, i.E<nbsp>e. all query
3682 blocks you want to refer to must be placed above the database block you want to
3683 refer to them from.
3685 =back
3687 =head2 Plugin C<perl>
3689 This plugin embeds a Perl-interpreter into collectd and provides an interface
3690 to collectd's plugin system. See L<collectd-perl(5)> for its documentation.
3692 =head2 Plugin C<pinba>
3694 The I<Pinba plugin> receives profiling information from I<Pinba>, an extension
3695 for the I<PHP> interpreter. At the end of executing a script, i.e. after a
3696 PHP-based webpage has been delivered, the extension will send a UDP packet
3697 containing timing information, peak memory usage and so on. The plugin will
3698 wait for such packets, parse them and account the provided information, which
3699 is then dispatched to the daemon once per interval.
3701 Synopsis:
3703  <Plugin pinba>
3704    Address "::0"
3705    Port "30002"
3706    # Overall statistics for the website.
3707    <View "www-total">
3708      Server "www.example.com"
3709    </View>
3710    # Statistics for www-a only
3711    <View "www-a">
3712      Host "www-a.example.com"
3713      Server "www.example.com"
3714    </View>
3715    # Statistics for www-b only
3716    <View "www-b">
3717      Host "www-b.example.com"
3718      Server "www.example.com"
3719    </View>
3720  </Plugin>
3722 The plugin provides the following configuration options:
3724 =over 4
3726 =item B<Address> I<Node>
3728 Configures the address used to open a listening socket. By default, plugin will
3729 bind to the I<any> address C<::0>.
3731 =item B<Port> I<Service>
3733 Configures the port (service) to bind to. By default the default Pinba port
3734 "30002" will be used. The option accepts service names in addition to port
3735 numbers and thus requires a I<string> argument.
3737 =item E<lt>B<View> I<Name>E<gt> block
3739 The packets sent by the Pinba extension include the hostname of the server, the
3740 server name (the name of the virtual host) and the script that was executed.
3741 Using B<View> blocks it is possible to separate the data into multiple groups
3742 to get more meaningful statistics. Each packet is added to all matching groups,
3743 so that a packet may be accounted for more than once.
3745 =over 4
3747 =item B<Host> I<Host>
3749 Matches the hostname of the system the webserver / script is running on. This
3750 will contain the result of the L<gethostname(2)> system call. If not
3751 configured, all hostnames will be accepted.
3753 =item B<Server> I<Server>
3755 Matches the name of the I<virtual host>, i.e. the contents of the
3756 C<$_SERVER["SERVER_NAME"]> variable when within PHP. If not configured, all
3757 server names will be accepted.
3759 =item B<Script> I<Script>
3761 Matches the name of the I<script name>, i.e. the contents of the
3762 C<$_SERVER["SCRIPT_NAME"]> variable when within PHP. If not configured, all
3763 script names will be accepted.
3765 =back
3767 =back
3769 =head2 Plugin C<ping>
3771 The I<Ping> plugin starts a new thread which sends ICMP "ping" packets to the
3772 configured hosts periodically and measures the network latency. Whenever the
3773 C<read> function of the plugin is called, it submits the average latency, the
3774 standard deviation and the drop rate for each host.
3776 Available configuration options:
3778 =over 4
3780 =item B<Host> I<IP-address>
3782 Host to ping periodically. This option may be repeated several times to ping
3783 multiple hosts.
3785 =item B<Interval> I<Seconds>
3787 Sets the interval in which to send ICMP echo packets to the configured hosts.
3788 This is B<not> the interval in which statistics are queries from the plugin but
3789 the interval in which the hosts are "pinged". Therefore, the setting here
3790 should be smaller than or equal to the global B<Interval> setting. Fractional
3791 times, such as "1.24" are allowed.
3793 Default: B<1.0>
3795 =item B<Timeout> I<Seconds>
3797 Time to wait for a response from the host to which an ICMP packet had been
3798 sent. If a reply was not received after I<Seconds> seconds, the host is assumed
3799 to be down or the packet to be dropped. This setting must be smaller than the
3800 B<Interval> setting above for the plugin to work correctly. Fractional
3801 arguments are accepted.
3803 Default: B<0.9>
3805 =item B<TTL> I<0-255>
3807 Sets the Time-To-Live of generated ICMP packets.
3809 =item B<SourceAddress> I<host>
3811 Sets the source address to use. I<host> may either be a numerical network
3812 address or a network hostname.
3814 =item B<Device> I<name>
3816 Sets the outgoing network device to be used. I<name> has to specify an
3817 interface name (e.E<nbsp>g. C<eth0>). This might not be supported by all
3818 operating systems.
3820 =item B<MaxMissed> I<Packets>
3822 Trigger a DNS resolve after the host has not replied to I<Packets> packets. This
3823 enables the use of dynamic DNS services (like dyndns.org) with the ping plugin.
3825 Default: B<-1> (disabled)
3827 =back
3829 =head2 Plugin C<postgresql>
3831 The C<postgresql> plugin queries statistics from PostgreSQL databases. It
3832 keeps a persistent connection to all configured databases and tries to
3833 reconnect if the connection has been interrupted. A database is configured by
3834 specifying a B<Database> block as described below. The default statistics are
3835 collected from PostgreSQL's B<statistics collector> which thus has to be
3836 enabled for this plugin to work correctly. This should usually be the case by
3837 default. See the section "The Statistics Collector" of the B<PostgreSQL
3838 Documentation> for details.
3840 By specifying custom database queries using a B<Query> block as described
3841 below, you may collect any data that is available from some PostgreSQL
3842 database. This way, you are able to access statistics of external daemons
3843 which are available in a PostgreSQL database or use future or special
3844 statistics provided by PostgreSQL without the need to upgrade your collectd
3845 installation.
3847 Starting with version 5.2, the C<postgresql> plugin supports writing data to
3848 PostgreSQL databases as well. This has been implemented in a generic way. You
3849 need to specify an SQL statement which will then be executed by collectd in
3850 order to write the data (see below for details). The benefit of that approach
3851 is that there is no fixed database layout. Rather, the layout may be optimized
3852 for the current setup.
3854 The B<PostgreSQL Documentation> manual can be found at
3855 L<http://www.postgresql.org/docs/manuals/>.
3857   <Plugin postgresql>
3858     <Query magic>
3859       Statement "SELECT magic FROM wizard WHERE host = $1;"
3860       Param hostname
3861       <Result>
3862         Type gauge
3863         InstancePrefix "magic"
3864         ValuesFrom magic
3865       </Result>
3866     </Query>
3868     <Query rt36_tickets>
3869       Statement "SELECT COUNT(type) AS count, type \
3870                         FROM (SELECT CASE \
3871                                      WHEN resolved = 'epoch' THEN 'open' \
3872                                      ELSE 'resolved' END AS type \
3873                                      FROM tickets) type \
3874                         GROUP BY type;"
3875       <Result>
3876         Type counter
3877         InstancePrefix "rt36_tickets"
3878         InstancesFrom "type"
3879         ValuesFrom "count"
3880       </Result>
3881     </Query>
3883     <Writer sqlstore>
3884       Statement "SELECT collectd_insert($1, $2, $3, $4, $5, $6, $7, $8, $9);"
3885       StoreRates true
3886     </Writer>
3888     <Database foo>
3889       Host "hostname"
3890       Port "5432"
3891       User "username"
3892       Password "secret"
3893       SSLMode "prefer"
3894       KRBSrvName "kerberos_service_name"
3895       Query magic
3896     </Database>
3898     <Database bar>
3899       Interval 300
3900       Service "service_name"
3901       Query backend # predefined
3902       Query rt36_tickets
3903     </Database>
3905     <Database qux>
3906       # ...
3907       Writer sqlstore
3908       CommitInterval 10
3909     </Database>
3910   </Plugin>
3912 The B<Query> block defines one database query which may later be used by a
3913 database definition. It accepts a single mandatory argument which specifies
3914 the name of the query. The names of all queries have to be unique (see the
3915 B<MinVersion> and B<MaxVersion> options below for an exception to this
3916 rule). The following configuration options are available to define the query:
3918 In each B<Query> block, there is one or more B<Result> blocks. B<Result>
3919 blocks define how to handle the values returned from the query. They define
3920 which column holds which value and how to dispatch that value to the daemon.
3921 Multiple B<Result> blocks may be used to extract multiple values from a single
3922 query.
3924 =over 4
3926 =item B<Statement> I<sql query statement>
3928 Specify the I<sql query statement> which the plugin should execute. The string
3929 may contain the tokens B<$1>, B<$2>, etc. which are used to reference the
3930 first, second, etc. parameter. The value of the parameters is specified by the
3931 B<Param> configuration option - see below for details. To include a literal
3932 B<$> character followed by a number, surround it with single quotes (B<'>).
3934 Any SQL command which may return data (such as C<SELECT> or C<SHOW>) is
3935 allowed. Note, however, that only a single command may be used. Semicolons are
3936 allowed as long as a single non-empty command has been specified only.
3938 The returned lines will be handled separately one after another.
3940 =item B<Param> I<hostname>|I<database>|I<username>|I<interval>
3942 Specify the parameters which should be passed to the SQL query. The parameters
3943 are referred to in the SQL query as B<$1>, B<$2>, etc. in the same order as
3944 they appear in the configuration file. The value of the parameter is
3945 determined depending on the value of the B<Param> option as follows:
3947 =over 4
3949 =item I<hostname>
3951 The configured hostname of the database connection. If a UNIX domain socket is
3952 used, the parameter expands to "localhost".
3954 =item I<database>
3956 The name of the database of the current connection.
3958 =item I<instance>
3960 The name of the database plugin instance. See the B<Instance> option of the
3961 database specification below for details.
3963 =item I<username>
3965 The username used to connect to the database.
3967 =item I<interval>
3969 The interval with which this database is queried (as specified by the database
3970 specific or global B<Interval> options).
3972 =back
3974 Please note that parameters are only supported by PostgreSQL's protocol
3975 version 3 and above which was introduced in version 7.4 of PostgreSQL.
3977 =item B<Type> I<type>
3979 The I<type> name to be used when dispatching the values. The type describes
3980 how to handle the data and where to store it. See L<types.db(5)> for more
3981 details on types and their configuration. The number and type of values (as
3982 selected by the B<ValuesFrom> option) has to match the type of the given name.
3984 This option is required inside a B<Result> block.
3986 =item B<InstancePrefix> I<prefix>
3988 =item B<InstancesFrom> I<column0> [I<column1> ...]
3990 Specify how to create the "TypeInstance" for each data set (i.E<nbsp>e. line).
3991 B<InstancePrefix> defines a static prefix that will be prepended to all type
3992 instances. B<InstancesFrom> defines the column names whose values will be used
3993 to create the type instance. Multiple values will be joined together using the
3994 hyphen (C<->) as separation character.
3996 The plugin itself does not check whether or not all built instances are
3997 different. It is your responsibility to assure that each is unique.
3999 Both options are optional. If none is specified, the type instance will be
4000 empty.
4002 =item B<ValuesFrom> I<column0> [I<column1> ...]
4004 Names the columns whose content is used as the actual data for the data sets
4005 that are dispatched to the daemon. How many such columns you need is
4006 determined by the B<Type> setting as explained above. If you specify too many
4007 or not enough columns, the plugin will complain about that and no data will be
4008 submitted to the daemon.
4010 The actual data type, as seen by PostgreSQL, is not that important as long as
4011 it represents numbers. The plugin will automatically cast the values to the
4012 right type if it know how to do that. For that, it uses the L<strtoll(3)> and
4013 L<strtod(3)> functions, so anything supported by those functions is supported
4014 by the plugin as well.
4016 This option is required inside a B<Result> block and may be specified multiple
4017 times. If multiple B<ValuesFrom> options are specified, the columns are read
4018 in the given order.
4020 =item B<MinVersion> I<version>
4022 =item B<MaxVersion> I<version>
4024 Specify the minimum or maximum version of PostgreSQL that this query should be
4025 used with. Some statistics might only be available with certain versions of
4026 PostgreSQL. This allows you to specify multiple queries with the same name but
4027 which apply to different versions, thus allowing you to use the same
4028 configuration in a heterogeneous environment.
4030 The I<version> has to be specified as the concatenation of the major, minor
4031 and patch-level versions, each represented as two-decimal-digit numbers. For
4032 example, version 8.2.3 will become 80203.
4034 =back
4036 The following predefined queries are available (the definitions can be found
4037 in the F<postgresql_default.conf> file which, by default, is available at
4038 C<I<prefix>/share/collectd/>):
4040 =over 4
4042 =item B<backends>
4044 This query collects the number of backends, i.E<nbsp>e. the number of
4045 connected clients.
4047 =item B<transactions>
4049 This query collects the numbers of committed and rolled-back transactions of
4050 the user tables.
4052 =item B<queries>
4054 This query collects the numbers of various table modifications (i.E<nbsp>e.
4055 insertions, updates, deletions) of the user tables.
4057 =item B<query_plans>
4059 This query collects the numbers of various table scans and returned tuples of
4060 the user tables.
4062 =item B<table_states>
4064 This query collects the numbers of live and dead rows in the user tables.
4066 =item B<disk_io>
4068 This query collects disk block access counts for user tables.
4070 =item B<disk_usage>
4072 This query collects the on-disk size of the database in bytes.
4074 =back
4076 In addition, the following detailed queries are available by default. Please
4077 note that each of those queries collects information B<by table>, thus,
4078 potentially producing B<a lot> of data. For details see the description of the
4079 non-by_table queries above.
4081 =over 4
4083 =item B<queries_by_table>
4085 =item B<query_plans_by_table>
4087 =item B<table_states_by_table>
4089 =item B<disk_io_by_table>
4091 =back
4093 The B<Writer> block defines a PostgreSQL writer backend. It accepts a single
4094 mandatory argument specifying the name of the writer. This will then be used
4095 in the B<Database> specification in order to activate the writer instance. The
4096 names of all writers have to be unique. The following options may be
4097 specified:
4099 =over 4
4101 =item B<Statement> I<sql statement>
4103 This mandatory option specifies the SQL statement that will be executed for
4104 each submitted value. A single SQL statement is allowed only. Anything after
4105 the first semicolon will be ignored.
4107 Nine parameters will be passed to the statement and should be specified as
4108 tokens B<$1>, B<$2>, through B<$9> in the statement string. The following
4109 values are made available through those parameters:
4111 =over 4
4113 =item B<$1>
4115 The timestamp of the queried value as a floating point number.
4117 =item B<$2>
4119 The hostname of the queried value.
4121 =item B<$3>
4123 The plugin name of the queried value.
4125 =item B<$4>
4127 The plugin instance of the queried value. This value may be B<NULL> if there
4128 is no plugin instance.
4130 =item B<$5>
4132 The type of the queried value (cf. L<types.db(5)>).
4134 =item B<$6>
4136 The type instance of the queried value. This value may be B<NULL> if there is
4137 no type instance.
4139 =item B<$7>
4141 An array of names for the submitted values (i.E<nbsp>e., the name of the data
4142 sources of the submitted value-list).
4144 =item B<$8>
4146 An array of types for the submitted values (i.E<nbsp>e., the type of the data
4147 sources of the submitted value-list; C<counter>, C<gauge>, ...). Note, that if
4148 B<StoreRates> is enabled (which is the default, see below), all types will be
4149 C<gauge>.
4151 =item B<$9>
4153 An array of the submitted values. The dimensions of the value name and value
4154 arrays match.
4156 =back
4158 In general, it is advisable to create and call a custom function in the
4159 PostgreSQL database for this purpose. Any procedural language supported by
4160 PostgreSQL will do (see chapter "Server Programming" in the PostgreSQL manual
4161 for details).
4163 =item B<StoreRates> B<false>|B<true>
4165 If set to B<true> (the default), convert counter values to rates. If set to
4166 B<false> counter values are stored as is, i.E<nbsp>e. as an increasing integer
4167 number.
4169 =back
4171 The B<Database> block defines one PostgreSQL database for which to collect
4172 statistics. It accepts a single mandatory argument which specifies the
4173 database name. None of the other options are required. PostgreSQL will use
4174 default values as documented in the section "CONNECTING TO A DATABASE" in the
4175 L<psql(1)> manpage. However, be aware that those defaults may be influenced by
4176 the user collectd is run as and special environment variables. See the manpage
4177 for details.
4179 =over 4
4181 =item B<Interval> I<seconds>
4183 Specify the interval with which the database should be queried. The default is
4184 to use the global B<Interval> setting.
4186 =item B<CommitInterval> I<seconds>
4188 This option may be used for database connections which have "writers" assigned
4189 (see above). If specified, it causes a writer to put several updates into a
4190 single transaction. This transaction will last for the specified amount of
4191 time. By default, each update will be executed in a separate transaction. Each
4192 transaction generates a fair amount of overhead which can, thus, be reduced by
4193 activating this option. The draw-back is, that data covering the specified
4194 amount of time will be lost, for example, if a single statement within the
4195 transaction fails or if the database server crashes.
4197 =item B<Host> I<hostname>
4199 Specify the hostname or IP of the PostgreSQL server to connect to. If the
4200 value begins with a slash, it is interpreted as the directory name in which to
4201 look for the UNIX domain socket.
4203 This option is also used to determine the hostname that is associated with a
4204 collected data set. If it has been omitted or either begins with with a slash
4205 or equals B<localhost> it will be replaced with the global hostname definition
4206 of collectd. Any other value will be passed literally to collectd when
4207 dispatching values. Also see the global B<Hostname> and B<FQDNLookup> options.
4209 =item B<Port> I<port>
4211 Specify the TCP port or the local UNIX domain socket file extension of the
4212 server.
4214 =item B<User> I<username>
4216 Specify the username to be used when connecting to the server.
4218 =item B<Password> I<password>
4220 Specify the password to be used when connecting to the server.
4222 =item B<SSLMode> I<disable>|I<allow>|I<prefer>|I<require>
4224 Specify whether to use an SSL connection when contacting the server. The
4225 following modes are supported:
4227 =item B<Instance> I<name>
4229 Specify the plugin instance name that should be used instead of the database
4230 name (which is the default, if this option has not been specified). This
4231 allows to query multiple databases of the same name on the same host (e.g.
4232 when running multiple database server versions in parallel).
4234 =over 4
4236 =item I<disable>
4238 Do not use SSL at all.
4240 =item I<allow>
4242 First, try to connect without using SSL. If that fails, try using SSL.
4244 =item I<prefer> (default)
4246 First, try to connect using SSL. If that fails, try without using SSL.
4248 =item I<require>
4250 Use SSL only.
4252 =back
4254 =item B<KRBSrvName> I<kerberos_service_name>
4256 Specify the Kerberos service name to use when authenticating with Kerberos 5
4257 or GSSAPI. See the sections "Kerberos authentication" and "GSSAPI" of the
4258 B<PostgreSQL Documentation> for details.
4260 =item B<Service> I<service_name>
4262 Specify the PostgreSQL service name to use for additional parameters. That
4263 service has to be defined in F<pg_service.conf> and holds additional
4264 connection parameters. See the section "The Connection Service File" in the
4265 B<PostgreSQL Documentation> for details.
4267 =item B<Query> I<query>
4269 Specifies a I<query> which should be executed in the context of the database
4270 connection. This may be any of the predefined or user-defined queries. If no
4271 such option is given, it defaults to "backends", "transactions", "queries",
4272 "query_plans", "table_states", "disk_io" and "disk_usage" (unless a B<Writer>
4273 has been specified). Else, the specified queries are used only.
4275 =item B<Writer> I<writer>
4277 Assigns the specified I<writer> backend to the database connection. This
4278 causes all collected data to be send to the database using the settings
4279 defined in the writer configuration (see the section "FILTER CONFIGURATION"
4280 below for details on how to selectively send data to certain plugins).
4282 Each writer will register a flush callback which may be used when having long
4283 transactions enabled (see the B<CommitInterval> option above). When issuing
4284 the B<FLUSH> command (see L<collectd-unixsock(5)> for details) the current
4285 transaction will be committed right away. Two different kinds of flush
4286 callbacks are available with the C<postgresql> plugin:
4288 =over 4
4290 =item B<postgresql>
4292 Flush all writer backends.
4294 =item B<postgresql->I<database>
4296 Flush all writers of the specified I<database> only.
4298 =back
4300 =back
4302 =head2 Plugin C<powerdns>
4304 The C<powerdns> plugin queries statistics from an authoritative PowerDNS
4305 nameserver and/or a PowerDNS recursor. Since both offer a wide variety of
4306 values, many of which are probably meaningless to most users, but may be useful
4307 for some. So you may chose which values to collect, but if you don't, some
4308 reasonable defaults will be collected.
4310   <Plugin "powerdns">
4311     <Server "server_name">
4312       Collect "latency"
4313       Collect "udp-answers" "udp-queries"
4314       Socket "/var/run/pdns.controlsocket"
4315     </Server>
4316     <Recursor "recursor_name">
4317       Collect "questions"
4318       Collect "cache-hits" "cache-misses"
4319       Socket "/var/run/pdns_recursor.controlsocket"
4320     </Recursor>
4321     LocalSocket "/opt/collectd/var/run/collectd-powerdns"
4322   </Plugin>
4324 =over 4
4326 =item B<Server> and B<Recursor> block
4328 The B<Server> block defines one authoritative server to query, the B<Recursor>
4329 does the same for an recursing server. The possible options in both blocks are
4330 the same, though. The argument defines a name for the serverE<nbsp>/ recursor
4331 and is required.
4333 =over 4
4335 =item B<Collect> I<Field>
4337 Using the B<Collect> statement you can select which values to collect. Here,
4338 you specify the name of the values as used by the PowerDNS servers, e.E<nbsp>g.
4339 C<dlg-only-drops>, C<answers10-100>.
4341 The method of getting the values differs for B<Server> and B<Recursor> blocks:
4342 When querying the server a C<SHOW *> command is issued in any case, because
4343 that's the only way of getting multiple values out of the server at once.
4344 collectd then picks out the values you have selected. When querying the
4345 recursor, a command is generated to query exactly these values. So if you
4346 specify invalid fields when querying the recursor, a syntax error may be
4347 returned by the daemon and collectd may not collect any values at all.
4349 If no B<Collect> statement is given, the following B<Server> values will be
4350 collected:
4352 =over 4
4354 =item latency
4356 =item packetcache-hit
4358 =item packetcache-miss
4360 =item packetcache-size
4362 =item query-cache-hit
4364 =item query-cache-miss
4366 =item recursing-answers
4368 =item recursing-questions
4370 =item tcp-answers
4372 =item tcp-queries
4374 =item udp-answers
4376 =item udp-queries
4378 =back
4380 The following B<Recursor> values will be collected by default:
4382 =over 4
4384 =item noerror-answers
4386 =item nxdomain-answers
4388 =item servfail-answers
4390 =item sys-msec
4392 =item user-msec
4394 =item qa-latency
4396 =item cache-entries
4398 =item cache-hits
4400 =item cache-misses
4402 =item questions
4404 =back
4406 Please note that up to that point collectd doesn't know what values are
4407 available on the server and values that are added do not need a change of the
4408 mechanism so far. However, the values must be mapped to collectd's naming
4409 scheme, which is done using a lookup table that lists all known values. If
4410 values are added in the future and collectd does not know about them, you will
4411 get an error much like this:
4413   powerdns plugin: submit: Not found in lookup table: foobar = 42
4415 In this case please file a bug report with the collectd team.
4417 =item B<Socket> I<Path>
4419 Configures the path to the UNIX domain socket to be used when connecting to the
4420 daemon. By default C<${localstatedir}/run/pdns.controlsocket> will be used for
4421 an authoritative server and C<${localstatedir}/run/pdns_recursor.controlsocket>
4422 will be used for the recursor.
4424 =back
4426 =item B<LocalSocket> I<Path>
4428 Querying the recursor is done using UDP. When using UDP over UNIX domain
4429 sockets, the client socket needs a name in the file system, too. You can set
4430 this local name to I<Path> using the B<LocalSocket> option. The default is
4431 C<I<prefix>/var/run/collectd-powerdns>.
4433 =back
4435 =head2 Plugin C<processes>
4437 =over 4
4439 =item B<Process> I<Name>
4441 Select more detailed statistics of processes matching this name. The statistics
4442 collected for these selected processes are size of the resident segment size
4443 (RSS), user- and system-time used, number of processes and number of threads,
4444 io data (where available) and minor and major pagefaults.
4446 =item B<ProcessMatch> I<name> I<regex>
4448 Similar to the B<Process> option this allows to select more detailed
4449 statistics of processes matching the specified I<regex> (see L<regex(7)> for
4450 details). The statistics of all matching processes are summed up and
4451 dispatched to the daemon using the specified I<name> as an identifier. This
4452 allows to "group" several processes together. I<name> must not contain
4453 slashes.
4455 =back
4457 =head2 Plugin C<protocols>
4459 Collects a lot of information about various network protocols, such as I<IP>,
4460 I<TCP>, I<UDP>, etc.
4462 Available configuration options:
4464 =over 4
4466 =item B<Value> I<Selector>
4468 Selects whether or not to select a specific value. The string being matched is
4469 of the form "I<Protocol>:I<ValueName>", where I<Protocol> will be used as the
4470 plugin instance and I<ValueName> will be used as type instance. An example of
4471 the string being used would be C<Tcp:RetransSegs>.
4473 You can use regular expressions to match a large number of values with just one
4474 configuration option. To select all "extended" I<TCP> values, you could use the
4475 following statement:
4477   Value "/^TcpExt:/"
4479 Whether only matched values are selected or all matched values are ignored
4480 depends on the B<IgnoreSelected>. By default, only matched values are selected.
4481 If no value is configured at all, all values will be selected.
4483 =item B<IgnoreSelected> B<true>|B<false>
4485 If set to B<true>, inverts the selection made by B<Value>, i.E<nbsp>e. all
4486 matching values will be ignored.
4488 =back
4490 =head2 Plugin C<python>
4492 This plugin embeds a Python-interpreter into collectd and provides an interface
4493 to collectd's plugin system. See L<collectd-python(5)> for its documentation.
4495 =head2 Plugin C<routeros>
4497 The C<routeros> plugin connects to a device running I<RouterOS>, the
4498 Linux-based operating system for routers by I<MikroTik>. The plugin uses
4499 I<librouteros> to connect and reads information about the interfaces and
4500 wireless connections of the device. The configuration supports querying
4501 multiple routers:
4503   <Plugin "routeros">
4504     <Router>
4505       Host "router0.example.com"
4506       User "collectd"
4507       Password "secr3t"
4508       CollectInterface true
4509       CollectCPULoad true
4510       CollectMemory true
4511     </Router>
4512     <Router>
4513       Host "router1.example.com"
4514       User "collectd"
4515       Password "5ecret"
4516       CollectInterface true
4517       CollectRegistrationTable true
4518       CollectDF true
4519       CollectDisk true
4520     </Router>
4521   </Plugin>
4523 As you can see above, the configuration of the I<routeros> plugin consists of
4524 one or more B<E<lt>RouterE<gt>> blocks. Within each block, the following
4525 options are understood:
4527 =over 4
4529 =item B<Host> I<Host>
4531 Hostname or IP-address of the router to connect to.
4533 =item B<Port> I<Port>
4535 Port name or port number used when connecting. If left unspecified, the default
4536 will be chosen by I<librouteros>, currently "8728". This option expects a
4537 string argument, even when a numeric port number is given.
4539 =item B<User> I<User>
4541 Use the user name I<User> to authenticate. Defaults to "admin".
4543 =item B<Password> I<Password>
4545 Set the password used to authenticate.
4547 =item B<CollectInterface> B<true>|B<false>
4549 When set to B<true>, interface statistics will be collected for all interfaces
4550 present on the device. Defaults to B<false>.
4552 =item B<CollectRegistrationTable> B<true>|B<false>
4554 When set to B<true>, information about wireless LAN connections will be
4555 collected. Defaults to B<false>.
4557 =item B<CollectCPULoad> B<true>|B<false>
4559 When set to B<true>, information about the CPU usage will be collected. The
4560 number is a dimensionless value where zero indicates no CPU usage at all.
4561 Defaults to B<false>.
4563 =item B<CollectMemory> B<true>|B<false>
4565 When enabled, the amount of used and free memory will be collected. How used
4566 memory is calculated is unknown, for example whether or not caches are counted
4567 as used space.
4568 Defaults to B<false>.
4570 =item B<CollectDF> B<true>|B<false>
4572 When enabled, the amount of used and free disk space will be collected.
4573 Defaults to B<false>.
4575 =item B<CollectDisk> B<true>|B<false>
4577 When enabled, the number of sectors written and bad blocks will be collected.
4578 Defaults to B<false>.
4580 =back
4582 =head2 Plugin C<redis>
4584 The I<Redis plugin> connects to one or more Redis servers and gathers
4585 information about each server's state. For each server there is a I<Node> block
4586 which configures the connection parameters for this node.
4588   <Plugin redis>
4589     <Node "example">
4590         Host "localhost"
4591         Port "6379"
4592         Timeout 2000
4593     </Node>
4594   </Plugin>
4596 The information shown in the synopsis above is the I<default configuration>
4597 which is used by the plugin if no configuration is present.
4599 =over 4
4601 =item B<Node> I<Nodename>
4603 The B<Node> block identifies a new Redis node, that is a new Redis instance
4604 running in an specified host and port. The name for node is a canonical
4605 identifier which is used as I<plugin instance>. It is limited to
4606 64E<nbsp>characters in length.
4608 =item B<Host> I<Hostname>
4610 The B<Host> option is the hostname or IP-address where the Redis instance is
4611 running on.
4613 =item B<Port> I<Port>
4615 The B<Port> option is the TCP port on which the Redis instance accepts
4616 connections. Either a service name of a port number may be given. Please note
4617 that numerical port numbers must be given as a string, too.
4619 =item B<Password> I<Password>
4621 Use I<Password> to authenticate when connecting to I<Redis>.
4623 =item B<Timeout> I<Timeout in miliseconds>
4625 The B<Timeout> option set the socket timeout for node response. Since the Redis
4626 read function is blocking, you should keep this value as low as possible. Keep
4627 in mind that the sum of all B<Timeout> values for all B<Nodes> should be lower
4628 than B<Interval> defined globally.
4630 =back
4632 =head2 Plugin C<rrdcached>
4634 The C<rrdcached> plugin uses the RRDtool accelerator daemon, L<rrdcached(1)>,
4635 to store values to RRD files in an efficient manner. The combination of the
4636 C<rrdcached> B<plugin> and the C<rrdcached> B<daemon> is very similar to the
4637 way the C<rrdtool> plugin works (see below). The added abstraction layer
4638 provides a number of benefits, though: Because the cache is not within
4639 C<collectd> anymore, it does not need to be flushed when C<collectd> is to be
4640 restarted. This results in much shorter (if any) gaps in graphs, especially
4641 under heavy load. Also, the C<rrdtool> command line utility is aware of the
4642 daemon so that it can flush values to disk automatically when needed. This
4643 allows to integrate automated flushing of values into graphing solutions much
4644 more easily.
4646 There are disadvantages, though: The daemon may reside on a different host, so
4647 it may not be possible for C<collectd> to create the appropriate RRD files
4648 anymore. And even if C<rrdcached> runs on the same host, it may run in a
4649 different base directory, so relative paths may do weird stuff if you're not
4650 careful.
4652 So the B<recommended configuration> is to let C<collectd> and C<rrdcached> run
4653 on the same host, communicating via a UNIX domain socket. The B<DataDir>
4654 setting should be set to an absolute path, so that a changed base directory
4655 does not result in RRD files being createdE<nbsp>/ expected in the wrong place.
4657 =over 4
4659 =item B<DaemonAddress> I<Address>
4661 Address of the daemon as understood by the C<rrdc_connect> function of the RRD
4662 library. See L<rrdcached(1)> for details. Example:
4664   <Plugin "rrdcached">
4665     DaemonAddress "unix:/var/run/rrdcached.sock"
4666   </Plugin>
4668 =item B<DataDir> I<Directory>
4670 Set the base directory in which the RRD files reside. If this is a relative
4671 path, it is relative to the working base directory of the C<rrdcached> daemon!
4672 Use of an absolute path is recommended.
4674 =item B<CreateFiles> B<true>|B<false>
4676 Enables or disables the creation of RRD files. If the daemon is not running
4677 locally, or B<DataDir> is set to a relative path, this will not work as
4678 expected. Default is B<true>.
4680 =item B<CreateFilesAsync> B<false>|B<true>
4682 When enabled, new RRD files are enabled asynchronously, using a separate thread
4683 that runs in the background. This prevents writes to block, which is a problem
4684 especially when many hundreds of files need to be created at once. However,
4685 since the purpose of creating the files asynchronously is I<not> to block until
4686 the file is available, values before the file is available will be discarded.
4687 When disabled (the default) files are created synchronously, blocking for a
4688 short while, while the file is being written.
4690 =item B<StepSize> I<Seconds>
4692 B<Force> the stepsize of newly created RRD-files. Ideally (and per default)
4693 this setting is unset and the stepsize is set to the interval in which the data
4694 is collected. Do not use this option unless you absolutely have to for some
4695 reason. Setting this option may cause problems with the C<snmp plugin>, the
4696 C<exec plugin> or when the daemon is set up to receive data from other hosts.
4698 =item B<HeartBeat> I<Seconds>
4700 B<Force> the heartbeat of newly created RRD-files. This setting should be unset
4701 in which case the heartbeat is set to twice the B<StepSize> which should equal
4702 the interval in which data is collected. Do not set this option unless you have
4703 a very good reason to do so.
4705 =item B<RRARows> I<NumRows>
4707 The C<rrdtool plugin> calculates the number of PDPs per CDP based on the
4708 B<StepSize>, this setting and a timespan. This plugin creates RRD-files with
4709 three times five RRAs, i. e. five RRAs with the CFs B<MIN>, B<AVERAGE>, and
4710 B<MAX>. The five RRAs are optimized for graphs covering one hour, one day, one
4711 week, one month, and one year.
4713 So for each timespan, it calculates how many PDPs need to be consolidated into
4714 one CDP by calculating:
4715   number of PDPs = timespan / (stepsize * rrarows)
4717 Bottom line is, set this no smaller than the width of you graphs in pixels. The
4718 default is 1200.
4720 =item B<RRATimespan> I<Seconds>
4722 Adds an RRA-timespan, given in seconds. Use this option multiple times to have
4723 more then one RRA. If this option is never used, the built-in default of (3600,
4724 86400, 604800, 2678400, 31622400) is used.
4726 For more information on how RRA-sizes are calculated see B<RRARows> above.
4728 =item B<XFF> I<Factor>
4730 Set the "XFiles Factor". The default is 0.1. If unsure, don't set this option.
4731 I<Factor> must be in the range C<[0.0-1.0)>, i.e. between zero (inclusive) and
4732 one (exclusive).
4734 =back
4736 =head2 Plugin C<rrdtool>
4738 You can use the settings B<StepSize>, B<HeartBeat>, B<RRARows>, and B<XFF> to
4739 fine-tune your RRD-files. Please read L<rrdcreate(1)> if you encounter problems
4740 using these settings. If you don't want to dive into the depths of RRDtool, you
4741 can safely ignore these settings.
4743 =over 4
4745 =item B<DataDir> I<Directory>
4747 Set the directory to store RRD files under. By default RRD files are generated
4748 beneath the daemon's working directory, i.e. the B<BaseDir>.
4750 =item B<CreateFilesAsync> B<false>|B<true>
4752 When enabled, new RRD files are enabled asynchronously, using a separate thread
4753 that runs in the background. This prevents writes to block, which is a problem
4754 especially when many hundreds of files need to be created at once. However,
4755 since the purpose of creating the files asynchronously is I<not> to block until
4756 the file is available, values before the file is available will be discarded.
4757 When disabled (the default) files are created synchronously, blocking for a
4758 short while, while the file is being written.
4760 =item B<StepSize> I<Seconds>
4762 B<Force> the stepsize of newly created RRD-files. Ideally (and per default)
4763 this setting is unset and the stepsize is set to the interval in which the data
4764 is collected. Do not use this option unless you absolutely have to for some
4765 reason. Setting this option may cause problems with the C<snmp plugin>, the
4766 C<exec plugin> or when the daemon is set up to receive data from other hosts.
4768 =item B<HeartBeat> I<Seconds>
4770 B<Force> the heartbeat of newly created RRD-files. This setting should be unset
4771 in which case the heartbeat is set to twice the B<StepSize> which should equal
4772 the interval in which data is collected. Do not set this option unless you have
4773 a very good reason to do so.
4775 =item B<RRARows> I<NumRows>
4777 The C<rrdtool plugin> calculates the number of PDPs per CDP based on the
4778 B<StepSize>, this setting and a timespan. This plugin creates RRD-files with
4779 three times five RRAs, i.e. five RRAs with the CFs B<MIN>, B<AVERAGE>, and
4780 B<MAX>. The five RRAs are optimized for graphs covering one hour, one day, one
4781 week, one month, and one year.
4783 So for each timespan, it calculates how many PDPs need to be consolidated into
4784 one CDP by calculating:
4785   number of PDPs = timespan / (stepsize * rrarows)
4787 Bottom line is, set this no smaller than the width of you graphs in pixels. The
4788 default is 1200.
4790 =item B<RRATimespan> I<Seconds>
4792 Adds an RRA-timespan, given in seconds. Use this option multiple times to have
4793 more then one RRA. If this option is never used, the built-in default of (3600,
4794 86400, 604800, 2678400, 31622400) is used.
4796 For more information on how RRA-sizes are calculated see B<RRARows> above.
4798 =item B<XFF> I<Factor>
4800 Set the "XFiles Factor". The default is 0.1. If unsure, don't set this option.
4801 I<Factor> must be in the range C<[0.0-1.0)>, i.e. between zero (inclusive) and
4802 one (exclusive).
4804 =item B<CacheFlush> I<Seconds>
4806 When the C<rrdtool> plugin uses a cache (by setting B<CacheTimeout>, see below)
4807 it writes all values for a certain RRD-file if the oldest value is older than
4808 (or equal to) the number of seconds specified. If some RRD-file is not updated
4809 anymore for some reason (the computer was shut down, the network is broken,
4810 etc.) some values may still be in the cache. If B<CacheFlush> is set, then the
4811 entire cache is searched for entries older than B<CacheTimeout> seconds and
4812 written to disk every I<Seconds> seconds. Since this is kind of expensive and
4813 does nothing under normal circumstances, this value should not be too small.
4814 900 seconds might be a good value, though setting this to 7200 seconds doesn't
4815 normally do much harm either.
4817 =item B<CacheTimeout> I<Seconds>
4819 If this option is set to a value greater than zero, the C<rrdtool plugin> will
4820 save values in a cache, as described above. Writing multiple values at once
4821 reduces IO-operations and thus lessens the load produced by updating the files.
4822 The trade off is that the graphs kind of "drag behind" and that more memory is
4823 used.
4825 =item B<WritesPerSecond> I<Updates>
4827 When collecting many statistics with collectd and the C<rrdtool> plugin, you
4828 will run serious performance problems. The B<CacheFlush> setting and the
4829 internal update queue assert that collectd continues to work just fine even
4830 under heavy load, but the system may become very unresponsive and slow. This is
4831 a problem especially if you create graphs from the RRD files on the same
4832 machine, for example using the C<graph.cgi> script included in the
4833 C<contrib/collection3/> directory.
4835 This setting is designed for very large setups. Setting this option to a value
4836 between 25 and 80 updates per second, depending on your hardware, will leave
4837 the server responsive enough to draw graphs even while all the cached values
4838 are written to disk. Flushed values, i.E<nbsp>e. values that are forced to disk
4839 by the B<FLUSH> command, are B<not> effected by this limit. They are still
4840 written as fast as possible, so that web frontends have up to date data when
4841 generating graphs.
4843 For example: If you have 100,000 RRD files and set B<WritesPerSecond> to 30
4844 updates per second, writing all values to disk will take approximately
4845 56E<nbsp>minutes. Together with the flushing ability that's integrated into
4846 "collection3" you'll end up with a responsive and fast system, up to date
4847 graphs and basically a "backup" of your values every hour.
4849 =item B<RandomTimeout> I<Seconds>
4851 When set, the actual timeout for each value is chosen randomly between
4852 I<CacheTimeout>-I<RandomTimeout> and I<CacheTimeout>+I<RandomTimeout>. The
4853 intention is to avoid high load situations that appear when many values timeout
4854 at the same time. This is especially a problem shortly after the daemon starts,
4855 because all values were added to the internal cache at roughly the same time.
4857 =back
4859 =head2 Plugin C<sensors>
4861 The I<Sensors plugin> uses B<lm_sensors> to retrieve sensor-values. This means
4862 that all the needed modules have to be loaded and lm_sensors has to be
4863 configured (most likely by editing F</etc/sensors.conf>. Read
4864 L<sensors.conf(5)> for details.
4866 The B<lm_sensors> homepage can be found at
4867 L<http://secure.netroedge.com/~lm78/>.
4869 =over 4
4871 =item B<SensorConfigFile> I<File>
4873 Read the I<lm_sensors> configuration from I<File>. When unset (recommended),
4874 the library's default will be used.
4876 =item B<Sensor> I<chip-bus-address/type-feature>
4878 Selects the name of the sensor which you want to collect or ignore, depending
4879 on the B<IgnoreSelected> below. For example, the option "B<Sensor>
4880 I<it8712-isa-0290/voltage-in1>" will cause collectd to gather data for the
4881 voltage sensor I<in1> of the I<it8712> on the isa bus at the address 0290.
4883 =item B<IgnoreSelected> I<true>|I<false>
4885 If no configuration if given, the B<sensors>-plugin will collect data from all
4886 sensors. This may not be practical, especially for uninteresting sensors.
4887 Thus, you can use the B<Sensor>-option to pick the sensors you're interested
4888 in. Sometimes, however, it's easier/preferred to collect all sensors I<except> a
4889 few ones. This option enables you to do that: By setting B<IgnoreSelected> to
4890 I<true> the effect of B<Sensor> is inverted: All selected sensors are ignored
4891 and all other sensors are collected.
4893 =back
4895 =head2 Plugin C<snmp>
4897 Since the configuration of the C<snmp plugin> is a little more complicated than
4898 other plugins, its documentation has been moved to an own manpage,
4899 L<collectd-snmp(5)>. Please see there for details.
4901 =head2 Plugin C<swap>
4903 The I<Swap plugin> collects information about used and available swap space. On
4904 I<Linux> and I<Solaris>, the following options are available:
4906 =over 4
4908 =item B<ReportByDevice> B<false>|B<true>
4910 Configures how to report physical swap devices. If set to B<false> (the
4911 default), the summary over all swap devices is reported only, i.e. the globally
4912 used and available space over all devices. If B<true> is configured, the used
4913 and available space of each device will be reported separately.
4915 This option is only available if the I<Swap plugin> can read C</proc/swaps>
4916 (under Linux) or use the L<swapctl(2)> mechanism (under I<Solaris>).
4918 =item B<ReportBytes> B<false>|B<true>
4920 When enabled, the I<swap I/O> is reported in bytes. When disabled, the default,
4921 I<swap I/O> is reported in pages. This option is available under Linux only.
4923 =back
4925 =head2 Plugin C<syslog>
4927 =over 4
4929 =item B<LogLevel> B<debug|info|notice|warning|err>
4931 Sets the log-level. If, for example, set to B<notice>, then all events with
4932 severity B<notice>, B<warning>, or B<err> will be submitted to the
4933 syslog-daemon.
4935 Please note that B<debug> is only available if collectd has been compiled with
4936 debugging support.
4938 =item B<NotifyLevel> B<OKAY>|B<WARNING>|B<FAILURE>
4940 Controls which notifications should be sent to syslog. The default behaviour is
4941 not to send any. Less severe notifications always imply logging more severe
4942 notifications: Setting this to B<OKAY> means all notifications will be sent to
4943 syslog, setting this to B<WARNING> will send B<WARNING> and B<FAILURE>
4944 notifications but will dismiss B<OKAY> notifications. Setting this option to
4945 B<FAILURE> will only send failures to syslog.
4947 =back
4949 =head2 Plugin C<table>
4951 The C<table plugin> provides generic means to parse tabular data and dispatch
4952 user specified values. Values are selected based on column numbers. For
4953 example, this plugin may be used to get values from the Linux L<proc(5)>
4954 filesystem or CSV (comma separated values) files.
4956   <Plugin table>
4957     <Table "/proc/slabinfo">
4958       Instance "slabinfo"
4959       Separator " "
4960       <Result>
4961         Type gauge
4962         InstancePrefix "active_objs"
4963         InstancesFrom 0
4964         ValuesFrom 1
4965       </Result>
4966       <Result>
4967         Type gauge
4968         InstancePrefix "objperslab"
4969         InstancesFrom 0
4970         ValuesFrom 4
4971       </Result>
4972     </Table>
4973   </Plugin>
4975 The configuration consists of one or more B<Table> blocks, each of which
4976 configures one file to parse. Within each B<Table> block, there are one or
4977 more B<Result> blocks, which configure which data to select and how to
4978 interpret it.
4980 The following options are available inside a B<Table> block:
4982 =over 4
4984 =item B<Instance> I<instance>
4986 If specified, I<instance> is used as the plugin instance. So, in the above
4987 example, the plugin name C<table-slabinfo> would be used. If omitted, the
4988 filename of the table is used instead, with all special characters replaced
4989 with an underscore (C<_>).
4991 =item B<Separator> I<string>
4993 Any character of I<string> is interpreted as a delimiter between the different
4994 columns of the table. A sequence of two or more contiguous delimiters in the
4995 table is considered to be a single delimiter, i.E<nbsp>e. there cannot be any
4996 empty columns. The plugin uses the L<strtok_r(3)> function to parse the lines
4997 of a table - see its documentation for more details. This option is mandatory.
4999 A horizontal tab, newline and carriage return may be specified by C<\\t>,
5000 C<\\n> and C<\\r> respectively. Please note that the double backslashes are
5001 required because of collectd's config parsing.
5003 =back
5005 The following options are available inside a B<Result> block:
5007 =over 4
5009 =item B<Type> I<type>
5011 Sets the type used to dispatch the values to the daemon. Detailed information
5012 about types and their configuration can be found in L<types.db(5)>. This
5013 option is mandatory.
5015 =item B<InstancePrefix> I<prefix>
5017 If specified, prepend I<prefix> to the type instance. If omitted, only the
5018 B<InstancesFrom> option is considered for the type instance.
5020 =item B<InstancesFrom> I<column0> [I<column1> ...]
5022 If specified, the content of the given columns (identified by the column
5023 number starting at zero) will be used to create the type instance for each
5024 row. Multiple values (and the instance prefix) will be joined together with
5025 dashes (I<->) as separation character. If omitted, only the B<InstancePrefix>
5026 option is considered for the type instance.
5028 The plugin itself does not check whether or not all built instances are
5029 different. It’s your responsibility to assure that each is unique. This is
5030 especially true, if you do not specify B<InstancesFrom>: B<You> have to make
5031 sure that the table only contains one row.
5033 If neither B<InstancePrefix> nor B<InstancesFrom> is given, the type instance
5034 will be empty.
5036 =item B<ValuesFrom> I<column0> [I<column1> ...]
5038 Specifies the columns (identified by the column numbers starting at zero)
5039 whose content is used as the actual data for the data sets that are dispatched
5040 to the daemon. How many such columns you need is determined by the B<Type>
5041 setting above. If you specify too many or not enough columns, the plugin will
5042 complain about that and no data will be submitted to the daemon. The plugin
5043 uses L<strtoll(3)> and L<strtod(3)> to parse counter and gauge values
5044 respectively, so anything supported by those functions is supported by the
5045 plugin as well. This option is mandatory.
5047 =back
5049 =head2 Plugin C<tail>
5051 The C<tail plugin> follows logfiles, just like L<tail(1)> does, parses
5052 each line and dispatches found values. What is matched can be configured by the
5053 user using (extended) regular expressions, as described in L<regex(7)>.
5055   <Plugin "tail">
5056     <File "/var/log/exim4/mainlog">
5057       Instance "exim"
5058       <Match>
5059         Regex "S=([1-9][0-9]*)"
5060         DSType "CounterAdd"
5061         Type "ipt_bytes"
5062         Instance "total"
5063       </Match>
5064       <Match>
5065         Regex "\\<R=local_user\\>"
5066         ExcludeRegex "\\<R=local_user\\>.*mail_spool defer"
5067         DSType "CounterInc"
5068         Type "counter"
5069         Instance "local_user"
5070       </Match>
5071     </File>
5072   </Plugin>
5074 The config consists of one or more B<File> blocks, each of which configures one
5075 logfile to parse. Within each B<File> block, there are one or more B<Match>
5076 blocks, which configure a regular expression to search for.
5078 The B<Instance> option in the B<File> block may be used to set the plugin
5079 instance. So in the above example the plugin name C<tail-foo> would be used.
5080 This plugin instance is for all B<Match> blocks that B<follow> it, until the
5081 next B<Instance> option. This way you can extract several plugin instances from
5082 one logfile, handy when parsing syslog and the like.
5084 Each B<Match> block has the following options to describe how the match should
5085 be performed:
5087 =over 4
5089 =item B<Regex> I<regex>
5091 Sets the regular expression to use for matching against a line. The first
5092 subexpression has to match something that can be turned into a number by
5093 L<strtoll(3)> or L<strtod(3)>, depending on the value of C<CounterAdd>, see
5094 below. Because B<extended> regular expressions are used, you do not need to use
5095 backslashes for subexpressions! If in doubt, please consult L<regex(7)>. Due to
5096 collectd's config parsing you need to escape backslashes, though. So if you
5097 want to match literal parentheses you need to do the following:
5099   Regex "SPAM \\(Score: (-?[0-9]+\\.[0-9]+)\\)"
5101 =item B<ExcludeRegex> I<regex>
5103 Sets an optional regular expression to use for excluding lines from the match.
5104 An example which excludes all connections from localhost from the match:
5106   ExcludeRegex "127\\.0\\.0\\.1"
5108 =item B<DSType> I<Type>
5110 Sets how the values are cumulated. I<Type> is one of:
5112 =over 4
5114 =item B<GaugeAverage>
5116 Calculate the average.
5118 =item B<GaugeMin>
5120 Use the smallest number only.
5122 =item B<GaugeMax>
5124 Use the greatest number only.
5126 =item B<GaugeLast>
5128 Use the last number found.
5130 =item B<CounterSet>
5132 =item B<DeriveSet>
5134 =item B<AbsoluteSet>
5136 The matched number is a counter. Simply I<sets> the internal counter to this
5137 value. Variants exist for C<COUNTER>, C<DERIVE>, and C<ABSOLUTE> data sources.
5139 =item B<CounterAdd>
5141 =item B<DeriveAdd>
5143 Add the matched value to the internal counter. In case of B<DeriveAdd>, the
5144 matched number may be negative, which will effectively subtract from the
5145 internal counter.
5147 =item B<CounterInc>
5149 =item B<DeriveInc>
5151 Increase the internal counter by one. These B<DSType> are the only ones that do
5152 not use the matched subexpression, but simply count the number of matched
5153 lines. Thus, you may use a regular expression without submatch in this case.
5155 =back
5157 As you'd expect the B<Gauge*> types interpret the submatch as a floating point
5158 number, using L<strtod(3)>. The B<Counter*> and B<AbsoluteSet> types interpret
5159 the submatch as an unsigned integer using L<strtoull(3)>. The B<Derive*> types
5160 interpret the submatch as a signed integer using L<strtoll(3)>. B<CounterInc>
5161 and B<DeriveInc> do not use the submatch at all and it may be omitted in this
5162 case.
5164 =item B<Type> I<Type>
5166 Sets the type used to dispatch this value. Detailed information about types and
5167 their configuration can be found in L<types.db(5)>.
5169 =item B<Instance> I<TypeInstance>
5171 This optional setting sets the type instance to use.
5173 =back
5175 =head2 Plugin C<tail_csv>
5177 The I<tail_csv plugin> reads files in the CSV format, e.g. the statistics file
5178 written by I<Snort>.
5180 B<Synopsis:>
5182  <Plugin "tail_csv">
5183    <Metric "snort-dropped">
5184        Type "percent"
5185        Instance "dropped"
5186        Index 1
5187    </Metric>
5188    <File "/var/log/snort/snort.stats">
5189        Instance "snort-eth0"
5190        Interval 600
5191        Collect "snort-dropped"
5192    </File>
5193  </Plugin>
5195 The configuration consists of one or more B<Metric> blocks that define an index
5196 into the line of the CSV file and how this value is mapped to I<collectd's>
5197 internal representation. These are followed by one or more B<Instance> blocks
5198 which configure which file to read, in which interval and which metrics to
5199 extract.
5201 =over 4
5203 =item E<lt>B<Metric> I<Name>E<gt>
5205 The B<Metric> block configures a new metric to be extracted from the statistics
5206 file and how it is mapped on I<collectd's> data model. The string I<Name> is
5207 only used inside the B<Instance> blocks to refer to this block, so you can use
5208 one B<Metric> block for multiple CSV files.
5210 =over 4
5212 =item B<Type> I<Type>
5214 Configures which I<Type> to use when dispatching this metric. Types are defined
5215 in the L<types.db(5)> file, see the appropriate manual page for more
5216 information on specifying types. Only types with a single I<data source> are
5217 supported by the I<tail_csv plugin>. The information whether the value is an
5218 absolute value (i.e. a C<GAUGE>) or a rate (i.e. a C<DERIVE>) is taken from the
5219 I<Type's> definition.
5221 =item B<Instance> I<TypeInstance>
5223 If set, I<TypeInstance> is used to populate the type instance field of the
5224 created value lists. Otherwise, no type instance is used.
5226 =item B<ValueFrom> I<Index>
5228 Configure to read the value from the field with the zero-based index I<Index>.
5229 If the value is parsed as signed integer, unsigned integer or double depends on
5230 the B<Type> setting, see above.
5232 =back
5234 =item E<lt>B<File> I<Path>E<gt>
5236 Each B<File> block represents one CSV file to read. There must be at least one
5237 I<File> block but there can be multiple if you have multiple CSV files.
5239 =over 4
5241 =item B<Instance> I<PluginInstance>
5243 Sets the I<plugin instance> used when dispatching the values.
5245 =item B<Collect> I<Metric>
5247 Specifies which I<Metric> to collect. This option must be specified at least
5248 once, and you can use this option multiple times to specify more than one
5249 metric to be extracted from this statistic file.
5251 =item B<Interval> I<Seconds>
5253 Configures the interval in which to read values from this instance / file.
5254 Defaults to the plugin's default interval.
5256 =item B<TimeFrom> I<Index>
5258 Rather than using the local time when dispatching a value, read the timestamp
5259 from the field with the zero-based index I<Index>. The value is interpreted as
5260 seconds since epoch. The value is parsed as a double and may be factional.
5262 =back
5264 =back
5266 =head2 Plugin C<teamspeak2>
5268 The C<teamspeak2 plugin> connects to the query port of a teamspeak2 server and
5269 polls interesting global and virtual server data. The plugin can query only one
5270 physical server but unlimited virtual servers. You can use the following
5271 options to configure it:
5273 =over 4
5275 =item B<Host> I<hostname/ip>
5277 The hostname or ip which identifies the physical server.
5278 Default: 127.0.0.1
5280 =item B<Port> I<port>
5282 The query port of the physical server. This needs to be a string.
5283 Default: "51234"
5285 =item B<Server> I<port>
5287 This option has to be added once for every virtual server the plugin should
5288 query. If you want to query the virtual server on port 8767 this is what the
5289 option would look like:
5291   Server "8767"
5293 This option, although numeric, needs to be a string, i.E<nbsp>e. you B<must>
5294 use quotes around it! If no such statement is given only global information
5295 will be collected.
5297 =back
5299 =head2 Plugin C<ted>
5301 The I<TED> plugin connects to a device of "The Energy Detective", a device to
5302 measure power consumption. These devices are usually connected to a serial
5303 (RS232) or USB port. The plugin opens a configured device and tries to read the
5304 current energy readings. For more information on TED, visit
5305 L<http://www.theenergydetective.com/>.
5307 Available configuration options:
5309 =over 4
5311 =item B<Device> I<Path>
5313 Path to the device on which TED is connected. collectd will need read and write
5314 permissions on that file.
5316 Default: B</dev/ttyUSB0>
5318 =item B<Retries> I<Num>
5320 Apparently reading from TED is not that reliable. You can therefore configure a
5321 number of retries here. You only configure the I<retries> here, to if you
5322 specify zero, one reading will be performed (but no retries if that fails); if
5323 you specify three, a maximum of four readings are performed. Negative values
5324 are illegal.
5326 Default: B<0>
5328 =back
5330 =head2 Plugin C<tcpconns>
5332 The C<tcpconns plugin> counts the number of currently established TCP
5333 connections based on the local port and/or the remote port. Since there may be
5334 a lot of connections the default if to count all connections with a local port,
5335 for which a listening socket is opened. You can use the following options to
5336 fine-tune the ports you are interested in:
5338 =over 4
5340 =item B<ListeningPorts> I<true>|I<false>
5342 If this option is set to I<true>, statistics for all local ports for which a
5343 listening socket exists are collected. The default depends on B<LocalPort> and
5344 B<RemotePort> (see below): If no port at all is specifically selected, the
5345 default is to collect listening ports. If specific ports (no matter if local or
5346 remote ports) are selected, this option defaults to I<false>, i.E<nbsp>e. only
5347 the selected ports will be collected unless this option is set to I<true>
5348 specifically.
5350 =item B<LocalPort> I<Port>
5352 Count the connections to a specific local port. This can be used to see how
5353 many connections are handled by a specific daemon, e.E<nbsp>g. the mailserver.
5354 You have to specify the port in numeric form, so for the mailserver example
5355 you'd need to set B<25>.
5357 =item B<RemotePort> I<Port>
5359 Count the connections to a specific remote port. This is useful to see how
5360 much a remote service is used. This is most useful if you want to know how many
5361 connections a local service has opened to remote services, e.E<nbsp>g. how many
5362 connections a mail server or news server has to other mail or news servers, or
5363 how many connections a web proxy holds to web servers. You have to give the
5364 port in numeric form.
5366 =back
5368 =head2 Plugin C<thermal>
5370 =over 4
5372 =item B<ForceUseProcfs> I<true>|I<false>
5374 By default, the I<Thermal plugin> tries to read the statistics from the Linux
5375 C<sysfs> interface. If that is not available, the plugin falls back to the
5376 C<procfs> interface. By setting this option to I<true>, you can force the
5377 plugin to use the latter. This option defaults to I<false>.
5379 =item B<Device> I<Device>
5381 Selects the name of the thermal device that you want to collect or ignore,
5382 depending on the value of the B<IgnoreSelected> option. This option may be
5383 used multiple times to specify a list of devices.
5385 =item B<IgnoreSelected> I<true>|I<false>
5387 Invert the selection: If set to true, all devices B<except> the ones that
5388 match the device names specified by the B<Device> option are collected. By
5389 default only selected devices are collected if a selection is made. If no
5390 selection is configured at all, B<all> devices are selected.
5392 =back
5394 =head2 Plugin C<threshold>
5396 The I<Threshold plugin> checks values collected or received by I<collectd>
5397 against a configurable I<threshold> and issues I<notifications> if values are
5398 out of bounds.
5400 Documentation for this plugin is available in the L<collectd-threshold(5)>
5401 manual page.
5403 =head2 Plugin C<tokyotyrant>
5405 The I<TokyoTyrant plugin> connects to a TokyoTyrant server and collects a
5406 couple metrics: number of records, and database size on disk.
5408 =over 4
5410 =item B<Host> I<Hostname/IP>
5412 The hostname or ip which identifies the server.
5413 Default: B<127.0.0.1>
5415 =item B<Port> I<Service/Port>
5417 The query port of the server. This needs to be a string, even if the port is
5418 given in its numeric form.
5419 Default: B<1978>
5421 =back
5423 =head2 Plugin C<unixsock>
5425 =over 4
5427 =item B<SocketFile> I<Path>
5429 Sets the socket-file which is to be created.
5431 =item B<SocketGroup> I<Group>
5433 If running as root change the group of the UNIX-socket after it has been
5434 created. Defaults to B<collectd>.
5436 =item B<SocketPerms> I<Permissions>
5438 Change the file permissions of the UNIX-socket after it has been created. The
5439 permissions must be given as a numeric, octal value as you would pass to
5440 L<chmod(1)>. Defaults to B<0770>.
5442 =item B<DeleteSocket> B<false>|B<true>
5444 If set to B<true>, delete the socket file before calling L<bind(2)>, if a file
5445 with the given name already exists. If I<collectd> crashes a socket file may be
5446 left over, preventing the daemon from opening a new socket when restarted.
5447 Since this is potentially dangerous, this defaults to B<false>.
5449 =back
5451 =head2 Plugin C<uuid>
5453 This plugin, if loaded, causes the Hostname to be taken from the machine's
5454 UUID. The UUID is a universally unique designation for the machine, usually
5455 taken from the machine's BIOS. This is most useful if the machine is running in
5456 a virtual environment such as Xen, in which case the UUID is preserved across
5457 shutdowns and migration.
5459 The following methods are used to find the machine's UUID, in order:
5461 =over 4
5463 =item
5465 Check I</etc/uuid> (or I<UUIDFile>).
5467 =item
5469 Check for UUID from HAL (L<http://www.freedesktop.org/wiki/Software/hal>) if
5470 present.
5472 =item
5474 Check for UUID from C<dmidecode> / SMBIOS.
5476 =item
5478 Check for UUID from Xen hypervisor.
5480 =back
5482 If no UUID can be found then the hostname is not modified.
5484 =over 4
5486 =item B<UUIDFile> I<Path>
5488 Take the UUID from the given file (default I</etc/uuid>).
5490 =back
5492 =head2 Plugin C<varnish>
5494 The I<varnish plugin> collects information about Varnish, an HTTP accelerator.
5496 Synopsis:
5498  <Plugin "varnish">
5499    <Instance "example">
5500      CollectCache       true
5501      CollectConnections true
5502      CollectBackend     true
5503      CollectSHM         true
5504      CollectESI         false
5505      CollectFetch       false
5506      CollectHCB         false
5507      CollectSMA         false
5508      CollectSMS         false
5509      CollectSM          false
5510      CollectTotals      false
5511      CollectWorkers     false
5512    </Instance>
5513  </Plugin>
5515 The configuration consists of one or more E<lt>B<Instance>E<nbsp>I<Name>E<gt>
5516 blocks. I<Name> is the parameter passed to "varnishd -n". If left empty, it
5517 will collectd statistics from the default "varnishd" instance (this should work
5518 fine in most cases).
5520 Inside each E<lt>B<Instance>E<gt> blocks, the following options are recognized:
5522 =over 4
5524 =item B<CollectCache> B<true>|B<false>
5526 Cache hits and misses. True by default.
5528 =item B<CollectConnections> B<true>|B<false>
5530 Number of client connections received, accepted and dropped. True by default.
5532 =item B<CollectBackend> B<true>|B<false>
5534 Back-end connection statistics, such as successful, reused,
5535 and closed connections. True by default.
5537 =item B<CollectSHM> B<true>|B<false>
5539 Statistics about the shared memory log, a memory region to store
5540 log messages which is flushed to disk when full. True by default.
5542 =item B<CollectESI> B<true>|B<false>
5544 Edge Side Includes (ESI) parse statistics. False by default.
5546 =item B<CollectFetch> B<true>|B<false>
5548 Statistics about fetches (HTTP requests sent to the backend). False by default.
5550 =item B<CollectHCB> B<true>|B<false>
5552 Inserts and look-ups in the crit bit tree based hash. Look-ups are
5553 divided into locked and unlocked look-ups. False by default.
5555 =item B<CollectSMA> B<true>|B<false>
5557 malloc or umem (umem_alloc(3MALLOC) based) storage statistics.
5558 The umem storage component is Solaris specific. False by default.
5560 =item B<CollectSMS> B<true>|B<false>
5562 synth (synthetic content) storage statistics. This storage
5563 component is used internally only. False by default.
5565 =item B<CollectSM> B<true>|B<false>
5567 file (memory mapped file) storage statistics. False by default.
5569 =item B<CollectTotals> B<true>|B<false>
5571 Collects overview counters, such as the number of sessions created,
5572 the number of requests and bytes transferred. False by default.
5574 =item B<CollectWorkers> B<true>|B<false>
5576 Collect statistics about worker threads. False by default.
5578 =back
5580 =head2 Plugin C<vmem>
5582 The C<vmem> plugin collects information about the usage of virtual memory.
5583 Since the statistics provided by the Linux kernel are very detailed, they are
5584 collected very detailed. However, to get all the details, you have to switch
5585 them on manually. Most people just want an overview over, such as the number of
5586 pages read from swap space.
5588 =over 4
5590 =item B<Verbose> B<true>|B<false>
5592 Enables verbose collection of information. This will start collecting page
5593 "actions", e.E<nbsp>g. page allocations, (de)activations, steals and so on.
5594 Part of these statistics are collected on a "per zone" basis.
5596 =back
5598 =head2 Plugin C<vserver>
5600 This plugin doesn't have any options. B<VServer> support is only available for
5601 Linux. It cannot yet be found in a vanilla kernel, though. To make use of this
5602 plugin you need a kernel that has B<VServer> support built in, i.E<nbsp>e. you
5603 need to apply the patches and compile your own kernel, which will then provide
5604 the F</proc/virtual> filesystem that is required by this plugin.
5606 The B<VServer> homepage can be found at L<http://linux-vserver.org/>.
5608 B<Note>: The traffic collected by this plugin accounts for the amount of
5609 traffic passing a socket which might be a lot less than the actual on-wire
5610 traffic (e.E<nbsp>g. due to headers and retransmission). If you want to
5611 collect on-wire traffic you could, for example, use the logging facilities of
5612 iptables to feed data for the guest IPs into the iptables plugin.
5614 =head2 Plugin C<write_graphite>
5616 The C<write_graphite> plugin writes data to I<Graphite>, an open-source metrics
5617 storage and graphing project. The plugin connects to I<Carbon>, the data layer
5618 of I<Graphite>, and sends data via the "line based" protocol (per default using
5619 portE<nbsp>2003). The data will be sent in blocks of at most 1428 bytes to
5620 minimize the number of network packets.
5622 Synopsis:
5624  <Plugin write_graphite>
5625    <Node "example">
5626      Host "localhost"
5627      Port "2003"
5628      Prefix "collectd"
5629    </Node>
5630  </Plugin>
5632 The configuration consists of one or more E<lt>B<Node>E<nbsp>I<Name>E<gt>
5633 blocks. Inside the B<Node> blocks, the following options are recognized:
5635 =over 4
5637 =item B<Host> I<Address>
5639 Hostname or address to connect to. Defaults to C<localhost>.
5641 =item B<Port> I<Service>
5643 Service name or port number to connect to. Defaults to C<2003>.
5645 =item B<Prefix> I<String>
5647 When set, I<String> is added in front of the host name. Dots and whitespace are
5648 I<not> escaped in this string (see B<EscapeCharacter> below).
5650 =item B<Postfix> I<String>
5652 When set, I<String> is appended to the host name. Dots and whitespace are
5653 I<not> escaped in this string (see B<EscapeCharacter> below).
5655 =item B<EscapeCharacter> I<Char>
5657 I<Carbon> uses the dot (C<.>) as escape character and doesn't allow whitespace
5658 in the identifier. The B<EscapeCharacter> option determines which character
5659 dots, whitespace and control characters are replaced with. Defaults to
5660 underscore (C<_>).
5662 =item B<StoreRates> B<false>|B<true>
5664 If set to B<true> (the default), convert counter values to rates. If set to
5665 B<false> counter values are stored as is, i.E<nbsp>e. as an increasing integer
5666 number.
5668 =item B<SeparateInstances> B<false>|B<true>
5670 If set to B<true>, the plugin instance and type instance will be in their own
5671 path component, for example C<host.cpu.0.cpu.idle>. If set to B<false> (the
5672 default), the plugin and plugin instance (and likewise the type and type
5673 instance) are put into one component, for example C<host.cpu-0.cpu-idle>.
5675 =item B<AlwaysAppendDS> B<false>|B<true>
5677 If set the B<true>, append the name of the I<Data Source> (DS) to the "metric"
5678 identifier. If set to B<false> (the default), this is only done when there is
5679 more than one DS.
5681 =back
5683 =head2 Plugin C<write_mongodb>
5685 The I<write_mongodb plugin> will send values to I<MongoDB>, a schema-less
5686 NoSQL database.
5688 B<Synopsis:>
5690  <Plugin "write_mongodb">
5691    <Node "default">
5692      Host "localhost"
5693      Port "27017"
5694      Timeout 1000
5695      StoreRates true
5696    </Node>
5697  </Plugin>
5699 The plugin can send values to multiple instances of I<MongoDB> by specifying
5700 one B<Node> block for each instance. Within the B<Node> blocks, the following
5701 options are available:
5703 =over 4
5705 =item B<Host> I<Address>
5707 Hostname or address to connect to. Defaults to C<localhost>.
5709 =item B<Port> I<Service>
5711 Service name or port number to connect to. Defaults to C<27017>.
5713 =item B<Timeout> I<Timeout>
5715 Set the timeout for each operation on I<MongoDB> to I<Timeout> milliseconds.
5716 Setting this option to zero means no timeout, which is the default.
5718 =item B<StoreRates> B<false>|B<true>
5720 If set to B<true> (the default), convert counter values to rates. If set to
5721 B<false> counter values are stored as is, i.e. as an increasing integer
5722 number.
5724 =item B<Database> I<Database>
5726 =item B<User> I<User>
5728 =item B<Password> I<Password>
5730 Sets the information used when authenticating to a I<MongoDB> database. The
5731 fields are optional (in which case no authentication is attempted), but if you
5732 want to use authentication all three fields must be set.
5734 =back
5736 =head2 Plugin C<write_http>
5738 This output plugin submits values to an http server by POST them using the
5739 PUTVAL plain-text protocol. Each destination you want to post data to needs to
5740 have one B<URL> block, within which the destination can be configured further,
5741 for example by specifying authentication data.
5743 Synopsis:
5745  <Plugin "write_http">
5746    <URL "http://example.com/post-collectd">
5747      User "collectd"
5748      Password "weCh3ik0"
5749    </URL>
5750  </Plugin>
5752 B<URL> blocks need one string argument which is used as the URL to which data
5753 is posted. The following options are understood within B<URL> blocks.
5755 =over 4
5757 =item B<User> I<Username>
5759 Optional user name needed for authentication.
5761 =item B<Password> I<Password>
5763 Optional password needed for authentication.
5765 =item B<VerifyPeer> B<true>|B<false>
5767 Enable or disable peer SSL certificate verification. See
5768 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
5770 =item B<VerifyHost> B<true|false>
5772 Enable or disable peer host name verification. If enabled, the plugin checks if
5773 the C<Common Name> or a C<Subject Alternate Name> field of the SSL certificate
5774 matches the host name provided by the B<URL> option. If this identity check
5775 fails, the connection is aborted. Obviously, only works when connecting to a
5776 SSL enabled server. Enabled by default.
5778 =item B<CACert> I<File>
5780 File that holds one or more SSL certificates. If you want to use HTTPS you will
5781 possibly need this option. What CA certificates come bundled with C<libcurl>
5782 and are checked by default depends on the distribution you use.
5784 =item B<Format> B<Command>|B<JSON>
5786 Format of the output to generate. If set to B<Command>, will create output that
5787 is understood by the I<Exec> and I<UnixSock> plugins. When set to B<JSON>, will
5788 create output in the I<JavaScript Object Notation> (JSON).
5790 Defaults to B<Command>.
5792 =item B<StoreRates> B<true|false>
5794 If set to B<true>, convert counter values to rates. If set to B<false> (the
5795 default) counter values are stored as is, i.E<nbsp>e. as an increasing integer
5796 number.
5798 =back
5800 =head2 Plugin C<write_riemann>
5802 The I<write_riemann plugin> will send values to I<Riemann>, a powerfull stream
5803 aggregation and monitoring system. The plugin sends I<Protobuf> encoded data to
5804 I<Riemann> using UDP packets.
5806 Synopsis:
5808  <Plugin "write_riemann">
5809    <Node "example">
5810      Host "localhost"
5811      Port "5555"
5812      Protocol UDP
5813      StoreRates true
5814      AlwaysAppendDS false
5815      Delay 10
5816    </Node>
5817    Tag "foobar"
5818  </Plugin>
5820 The following options are understood by the I<write_riemann plugin>:
5822 =over 4
5824 =item E<lt>B<Node> I<Name>E<gt>
5826 The plugin's configuration consists of one or more B<Node> blocks. Each block
5827 is given a unique I<Name> and specifies one connection to an instance of
5828 I<Riemann>. Indise the B<Node> block, the following per-connection options are
5829 understood:
5831 =over 4
5833 =item B<Host> I<Address>
5835 Hostname or address to connect to. Defaults to C<localhost>.
5837 =item B<Port> I<Service>
5839 Service name or port number to connect to. Defaults to C<5555>.
5841 =item B<Protocol> B<UDP>|B<TCP>
5843 Specify the protocol to use when communicating with I<Riemann>. Defaults to
5844 B<UDP>.
5846 =item B<StoreRates> B<true>|B<false>
5848 If set to B<true> (the default), convert counter values to rates. If set to
5849 B<false> counter values are stored as is, i.e. as an increasing integer number.
5851 This will be reflected in the C<ds_type> tag: If B<StoreRates> is enabled,
5852 converted values will have "rate" appended to the data source type, e.g.
5853 C<ds_type:derive:rate>.
5855 =item B<AlwaysAppendDS> B<false>|B<true>
5857 If set the B<true>, append the name of the I<Data Source> (DS) to the
5858 "service", i.e. the field that, together with the "host" field, uniquely
5859 identifies a metric in I<Riemann>. If set to B<false> (the default), this is
5860 only done when there is more than one DS.
5862 =back
5864 =item B<Tag> I<String>
5866 Add the given string as an additional tag to the metric being sent to
5867 I<Riemann>.
5869 =back
5871 =head1 THRESHOLD CONFIGURATION
5873 Starting with version C<4.3.0> collectd has support for B<monitoring>. By that
5874 we mean that the values are not only stored or sent somewhere, but that they
5875 are judged and, if a problem is recognized, acted upon. The only action
5876 collectd takes itself is to generate and dispatch a "notification". Plugins can
5877 register to receive notifications and perform appropriate further actions.
5879 Since systems and what you expect them to do differ a lot, you can configure
5880 B<thresholds> for your values freely. This gives you a lot of flexibility but
5881 also a lot of responsibility.
5883 Every time a value is out of range a notification is dispatched. This means
5884 that the idle percentage of your CPU needs to be less then the configured
5885 threshold only once for a notification to be generated. There's no such thing
5886 as a moving average or similar - at least not now.
5888 Also, all values that match a threshold are considered to be relevant or
5889 "interesting". As a consequence collectd will issue a notification if they are
5890 not received for B<Timeout> iterations. The B<Timeout> configuration option is
5891 explained in section L<"GLOBAL OPTIONS">. If, for example, B<Timeout> is set to
5892 "2" (the default) and some hosts sends it's CPU statistics to the server every
5893 60 seconds, a notification will be dispatched after about 120 seconds. It may
5894 take a little longer because the timeout is checked only once each B<Interval>
5895 on the server.
5897 When a value comes within range again or is received after it was missing, an
5898 "OKAY-notification" is dispatched.
5900 Here is a configuration example to get you started. Read below for more
5901 information.
5903  <Threshold>
5904    <Type "foo">
5905      WarningMin    0.00
5906      WarningMax 1000.00
5907      FailureMin    0.00
5908      FailureMax 1200.00
5909      Invert false
5910      Instance "bar"
5911    </Type>
5913    <Plugin "interface">
5914      Instance "eth0"
5915      <Type "if_octets">
5916        FailureMax 10000000
5917        DataSource "rx"
5918      </Type>
5919    </Plugin>
5921    <Host "hostname">
5922      <Type "cpu">
5923        Instance "idle"
5924        FailureMin 10
5925      </Type>
5927      <Plugin "memory">
5928        <Type "memory">
5929          Instance "cached"
5930          WarningMin 100000000
5931        </Type>
5932      </Plugin>
5933    </Host>
5934  </Threshold>
5936 There are basically two types of configuration statements: The C<Host>,
5937 C<Plugin>, and C<Type> blocks select the value for which a threshold should be
5938 configured. The C<Plugin> and C<Type> blocks may be specified further using the
5939 C<Instance> option. You can combine the block by nesting the blocks, though
5940 they must be nested in the above order, i.E<nbsp>e. C<Host> may contain either
5941 C<Plugin> and C<Type> blocks, C<Plugin> may only contain C<Type> blocks and
5942 C<Type> may not contain other blocks. If multiple blocks apply to the same
5943 value the most specific block is used.
5945 The other statements specify the threshold to configure. They B<must> be
5946 included in a C<Type> block. Currently the following statements are recognized:
5948 =over 4
5950 =item B<FailureMax> I<Value>
5952 =item B<WarningMax> I<Value>
5954 Sets the upper bound of acceptable values. If unset defaults to positive
5955 infinity. If a value is greater than B<FailureMax> a B<FAILURE> notification
5956 will be created. If the value is greater than B<WarningMax> but less than (or
5957 equal to) B<FailureMax> a B<WARNING> notification will be created.
5959 =item B<FailureMin> I<Value>
5961 =item B<WarningMin> I<Value>
5963 Sets the lower bound of acceptable values. If unset defaults to negative
5964 infinity. If a value is less than B<FailureMin> a B<FAILURE> notification will
5965 be created. If the value is less than B<WarningMin> but greater than (or equal
5966 to) B<FailureMin> a B<WARNING> notification will be created.
5968 =item B<DataSource> I<DSName>
5970 Some data sets have more than one "data source". Interesting examples are the
5971 C<if_octets> data set, which has received (C<rx>) and sent (C<tx>) bytes and
5972 the C<disk_ops> data set, which holds C<read> and C<write> operations. The
5973 system load data set, C<load>, even has three data sources: C<shortterm>,
5974 C<midterm>, and C<longterm>.
5976 Normally, all data sources are checked against a configured threshold. If this
5977 is undesirable, or if you want to specify different limits for each data
5978 source, you can use the B<DataSource> option to have a threshold apply only to
5979 one data source.
5981 =item B<Invert> B<true>|B<false>
5983 If set to B<true> the range of acceptable values is inverted, i.E<nbsp>e.
5984 values between B<FailureMin> and B<FailureMax> (B<WarningMin> and
5985 B<WarningMax>) are not okay. Defaults to B<false>.
5987 =item B<Persist> B<true>|B<false>
5989 Sets how often notifications are generated. If set to B<true> one notification
5990 will be generated for each value that is out of the acceptable range. If set to
5991 B<false> (the default) then a notification is only generated if a value is out
5992 of range but the previous value was okay.
5994 This applies to missing values, too: If set to B<true> a notification about a
5995 missing value is generated once every B<Interval> seconds. If set to B<false>
5996 only one such notification is generated until the value appears again.
5998 =item B<Percentage> B<true>|B<false>
6000 If set to B<true>, the minimum and maximum values given are interpreted as
6001 percentage value, relative to the other data sources. This is helpful for
6002 example for the "df" type, where you may want to issue a warning when less than
6003 5E<nbsp>% of the total space is available. Defaults to B<false>.
6005 =item B<Hits> I<Number>
6007 Delay creating the notification until the threshold has been passed I<Number>
6008 times. When a notification has been generated, or when a subsequent value is
6009 inside the threshold, the counter is reset. If, for example, a value is
6010 collected once every 10E<nbsp>seconds and B<Hits> is set to 3, a notification
6011 will be dispatched at most once every 30E<nbsp>seconds.
6013 This is useful when short bursts are not a problem. If, for example, 100% CPU
6014 usage for up to a minute is normal (and data is collected every
6015 10E<nbsp>seconds), you could set B<Hits> to B<6> to account for this.
6017 =item B<Hysteresis> I<Number>
6019 When set to non-zero, a hysteresis value is applied when checking minimum and
6020 maximum bounds. This is useful for values that increase slowly and fluctuate a
6021 bit while doing so. When these values come close to the threshold, they may
6022 "flap", i.e. switch between failure / warning case and okay case repeatedly.
6024 If, for example, the threshold is configures as
6026   WarningMax 100.0
6027   Hysteresis 1.0
6029 then a I<Warning> notification is created when the value exceeds I<101> and the
6030 corresponding I<Okay> notification is only created once the value falls below
6031 I<99>, thus avoiding the "flapping".
6033 =back
6035 =head1 FILTER CONFIGURATION
6037 Starting with collectd 4.6 there is a powerful filtering infrastructure
6038 implemented in the daemon. The concept has mostly been copied from
6039 I<ip_tables>, the packet filter infrastructure for Linux. We'll use a similar
6040 terminology, so that users that are familiar with iptables feel right at home.
6042 =head2 Terminology
6044 The following are the terms used in the remainder of the filter configuration
6045 documentation. For an ASCII-art schema of the mechanism, see
6046 L<"General structure"> below.
6048 =over 4
6050 =item B<Match>
6052 A I<match> is a criteria to select specific values. Examples are, of course, the
6053 name of the value or it's current value.
6055 Matches are implemented in plugins which you have to load prior to using the
6056 match. The name of such plugins starts with the "match_" prefix.
6058 =item B<Target>
6060 A I<target> is some action that is to be performed with data. Such actions
6061 could, for example, be to change part of the value's identifier or to ignore
6062 the value completely.
6064 Some of these targets are built into the daemon, see L<"Built-in targets">
6065 below. Other targets are implemented in plugins which you have to load prior to
6066 using the target. The name of such plugins starts with the "target_" prefix.
6068 =item B<Rule>
6070 The combination of any number of matches and at least one target is called a
6071 I<rule>. The target actions will be performed for all values for which B<all>
6072 matches apply. If the rule does not have any matches associated with it, the
6073 target action will be performed for all values.
6075 =item B<Chain>
6077 A I<chain> is a list of rules and possibly default targets. The rules are tried
6078 in order and if one matches, the associated target will be called. If a value
6079 is handled by a rule, it depends on the target whether or not any subsequent
6080 rules are considered or if traversal of the chain is aborted, see
6081 L<"Flow control"> below. After all rules have been checked, the default targets
6082 will be executed.
6084 =back
6086 =head2 General structure
6088 The following shows the resulting structure:
6090  +---------+
6091  ! Chain   !
6092  +---------+
6093       !
6094       V
6095  +---------+  +---------+  +---------+  +---------+
6096  ! Rule    !->! Match   !->! Match   !->! Target  !
6097  +---------+  +---------+  +---------+  +---------+
6098       !
6099       V
6100  +---------+  +---------+  +---------+
6101  ! Rule    !->! Target  !->! Target  !
6102  +---------+  +---------+  +---------+
6103       !
6104       V
6105       :
6106       :
6107       !
6108       V
6109  +---------+  +---------+  +---------+
6110  ! Rule    !->! Match   !->! Target  !
6111  +---------+  +---------+  +---------+
6112       !
6113       V
6114  +---------+
6115  ! Default !
6116  ! Target  !
6117  +---------+
6119 =head2 Flow control
6121 There are four ways to control which way a value takes through the filter
6122 mechanism:
6124 =over 4
6126 =item B<jump>
6128 The built-in B<jump> target can be used to "call" another chain, i.E<nbsp>e.
6129 process the value with another chain. When the called chain finishes, usually
6130 the next target or rule after the jump is executed.
6132 =item B<stop>
6134 The stop condition, signaled for example by the built-in target B<stop>, causes
6135 all processing of the value to be stopped immediately.
6137 =item B<return>
6139 Causes processing in the current chain to be aborted, but processing of the
6140 value generally will continue. This means that if the chain was called via
6141 B<Jump>, the next target or rule after the jump will be executed. If the chain
6142 was not called by another chain, control will be returned to the daemon and it
6143 may pass the value to another chain.
6145 =item B<continue>
6147 Most targets will signal the B<continue> condition, meaning that processing
6148 should continue normally. There is no special built-in target for this
6149 condition.
6151 =back
6153 =head2 Synopsis
6155 The configuration reflects this structure directly:
6157  PostCacheChain "PostCache"
6158  <Chain "PostCache">
6159    <Rule "ignore_mysql_show">
6160      <Match "regex">
6161        Plugin "^mysql$"
6162        Type "^mysql_command$"
6163        TypeInstance "^show_"
6164      </Match>
6165      <Target "stop">
6166      </Target>
6167    </Rule>
6168    <Target "write">
6169      Plugin "rrdtool"
6170    </Target>
6171  </Chain>
6173 The above configuration example will ignore all values where the plugin field
6174 is "mysql", the type is "mysql_command" and the type instance begins with
6175 "show_". All other values will be sent to the C<rrdtool> write plugin via the
6176 default target of the chain. Since this chain is run after the value has been
6177 added to the cache, the MySQL C<show_*> command statistics will be available
6178 via the C<unixsock> plugin.
6180 =head2 List of configuration options
6182 =over 4
6184 =item B<PreCacheChain> I<ChainName>
6186 =item B<PostCacheChain> I<ChainName>
6188 Configure the name of the "pre-cache chain" and the "post-cache chain". The
6189 argument is the name of a I<chain> that should be executed before and/or after
6190 the values have been added to the cache.
6192 To understand the implications, it's important you know what is going on inside
6193 I<collectd>. The following diagram shows how values are passed from the
6194 read-plugins to the write-plugins:
6196    +---------------+
6197    !  Read-Plugin  !
6198    +-------+-------+
6199            !
6200  + - - - - V - - - - +
6201  : +---------------+ :
6202  : !   Pre-Cache   ! :
6203  : !     Chain     ! :
6204  : +-------+-------+ :
6205  :         !         :
6206  :         V         :
6207  : +-------+-------+ :  +---------------+
6208  : !     Cache     !--->!  Value Cache  !
6209  : !     insert    ! :  +---+---+-------+
6210  : +-------+-------+ :      !   !
6211  :         !   ,------------'   !
6212  :         V   V     :          V
6213  : +-------+---+---+ :  +-------+-------+
6214  : !  Post-Cache   +--->! Write-Plugins !
6215  : !     Chain     ! :  +---------------+
6216  : +---------------+ :
6217  :                   :
6218  :  dispatch values  :
6219  + - - - - - - - - - +
6221 After the values are passed from the "read" plugins to the dispatch functions,
6222 the pre-cache chain is run first. The values are added to the internal cache
6223 afterwards. The post-cache chain is run after the values have been added to the
6224 cache. So why is it such a huge deal if chains are run before or after the
6225 values have been added to this cache?
6227 Targets that change the identifier of a value list should be executed before
6228 the values are added to the cache, so that the name in the cache matches the
6229 name that is used in the "write" plugins. The C<unixsock> plugin, too, uses
6230 this cache to receive a list of all available values. If you change the
6231 identifier after the value list has been added to the cache, this may easily
6232 lead to confusion, but it's not forbidden of course.
6234 The cache is also used to convert counter values to rates. These rates are, for
6235 example, used by the C<value> match (see below). If you use the rate stored in
6236 the cache B<before> the new value is added, you will use the old, B<previous>
6237 rate. Write plugins may use this rate, too, see the C<csv> plugin, for example.
6238 The C<unixsock> plugin uses these rates too, to implement the C<GETVAL>
6239 command.
6241 Last but not last, the B<stop> target makes a difference: If the pre-cache
6242 chain returns the stop condition, the value will not be added to the cache and
6243 the post-cache chain will not be run.
6245 =item B<Chain> I<Name>
6247 Adds a new chain with a certain name. This name can be used to refer to a
6248 specific chain, for example to jump to it.
6250 Within the B<Chain> block, there can be B<Rule> blocks and B<Target> blocks.
6252 =item B<Rule> [I<Name>]
6254 Adds a new rule to the current chain. The name of the rule is optional and
6255 currently has no meaning for the daemon.
6257 Within the B<Rule> block, there may be any number of B<Match> blocks and there
6258 must be at least one B<Target> block.
6260 =item B<Match> I<Name>
6262 Adds a match to a B<Rule> block. The name specifies what kind of match should
6263 be performed. Available matches depend on the plugins that have been loaded.
6265 The arguments inside the B<Match> block are passed to the plugin implementing
6266 the match, so which arguments are valid here depends on the plugin being used.
6267 If you do not need any to pass any arguments to a match, you can use the
6268 shorter syntax:
6270  Match "foobar"
6272 Which is equivalent to:
6274  <Match "foobar">
6275  </Match>
6277 =item B<Target> I<Name>
6279 Add a target to a rule or a default target to a chain. The name specifies what
6280 kind of target is to be added. Which targets are available depends on the
6281 plugins being loaded.
6283 The arguments inside the B<Target> block are passed to the plugin implementing
6284 the target, so which arguments are valid here depends on the plugin being used.
6285 If you do not need any to pass any arguments to a target, you can use the
6286 shorter syntax:
6288  Target "stop"
6290 This is the same as writing:
6292  <Target "stop">
6293  </Target>
6295 =back
6297 =head2 Built-in targets
6299 The following targets are built into the core daemon and therefore need no
6300 plugins to be loaded:
6302 =over 4
6304 =item B<return>
6306 Signals the "return" condition, see the L<"Flow control"> section above. This
6307 causes the current chain to stop processing the value and returns control to
6308 the calling chain. The calling chain will continue processing targets and rules
6309 just after the B<jump> target (see below). This is very similar to the
6310 B<RETURN> target of iptables, see L<iptables(8)>.
6312 This target does not have any options.
6314 Example:
6316  Target "return"
6318 =item B<stop>
6320 Signals the "stop" condition, see the L<"Flow control"> section above. This
6321 causes processing of the value to be aborted immediately. This is similar to
6322 the B<DROP> target of iptables, see L<iptables(8)>.
6324 This target does not have any options.
6326 Example:
6328  Target "stop"
6330 =item B<write>
6332 Sends the value to "write" plugins.
6334 Available options:
6336 =over 4
6338 =item B<Plugin> I<Name>
6340 Name of the write plugin to which the data should be sent. This option may be
6341 given multiple times to send the data to more than one write plugin.
6343 =back
6345 If no plugin is explicitly specified, the values will be sent to all available
6346 write plugins.
6348 Example:
6350  <Target "write">
6351    Plugin "rrdtool"
6352  </Target>
6354 =item B<jump>
6356 Starts processing the rules of another chain, see L<"Flow control"> above. If
6357 the end of that chain is reached, or a stop condition is encountered,
6358 processing will continue right after the B<jump> target, i.E<nbsp>e. with the
6359 next target or the next rule. This is similar to the B<-j> command line option
6360 of iptables, see L<iptables(8)>.
6362 Available options:
6364 =over 4
6366 =item B<Chain> I<Name>
6368 Jumps to the chain I<Name>. This argument is required and may appear only once.
6370 =back
6372 Example:
6374  <Target "jump">
6375    Chain "foobar"
6376  </Target>
6378 =back
6380 =head2 Available matches
6382 =over 4
6384 =item B<regex>
6386 Matches a value using regular expressions.
6388 Available options:
6390 =over 4
6392 =item B<Host> I<Regex>
6394 =item B<Plugin> I<Regex>
6396 =item B<PluginInstance> I<Regex>
6398 =item B<Type> I<Regex>
6400 =item B<TypeInstance> I<Regex>
6402 Match values where the given regular expressions match the various fields of
6403 the identifier of a value. If multiple regular expressions are given, B<all>
6404 regexen must match for a value to match.
6406 =item B<Invert> B<false>|B<true>
6408 When set to B<true>, the result of the match is inverted, i.e. all value lists
6409 where all regular expressions apply are not matched, all other value lists are
6410 matched. Defaults to B<false>.
6412 =back
6414 Example:
6416  <Match "regex">
6417    Host "customer[0-9]+"
6418    Plugin "^foobar$"
6419  </Match>
6421 =item B<timediff>
6423 Matches values that have a time which differs from the time on the server.
6425 This match is mainly intended for servers that receive values over the
6426 C<network> plugin and write them to disk using the C<rrdtool> plugin. RRDtool
6427 is very sensitive to the timestamp used when updating the RRD files. In
6428 particular, the time must be ever increasing. If a misbehaving client sends one
6429 packet with a timestamp far in the future, all further packets with a correct
6430 time will be ignored because of that one packet. What's worse, such corrupted
6431 RRD files are hard to fix.
6433 This match lets one match all values B<outside> a specified time range
6434 (relative to the server's time), so you can use the B<stop> target (see below)
6435 to ignore the value, for example.
6437 Available options:
6439 =over 4
6441 =item B<Future> I<Seconds>
6443 Matches all values that are I<ahead> of the server's time by I<Seconds> or more
6444 seconds. Set to zero for no limit. Either B<Future> or B<Past> must be
6445 non-zero.
6447 =item B<Past> I<Seconds>
6449 Matches all values that are I<behind> of the server's time by I<Seconds> or
6450 more seconds. Set to zero for no limit. Either B<Future> or B<Past> must be
6451 non-zero.
6453 =back
6455 Example:
6457  <Match "timediff">
6458    Future  300
6459    Past   3600
6460  </Match>
6462 This example matches all values that are five minutes or more ahead of the
6463 server or one hour (or more) lagging behind.
6465 =item B<value>
6467 Matches the actual value of data sources against given minimumE<nbsp>/ maximum
6468 values. If a data-set consists of more than one data-source, all data-sources
6469 must match the specified ranges for a positive match.
6471 Available options:
6473 =over 4
6475 =item B<Min> I<Value>
6477 Sets the smallest value which still results in a match. If unset, behaves like
6478 negative infinity.
6480 =item B<Max> I<Value>
6482 Sets the largest value which still results in a match. If unset, behaves like
6483 positive infinity.
6485 =item B<Invert> B<true>|B<false>
6487 Inverts the selection. If the B<Min> and B<Max> settings result in a match,
6488 no-match is returned and vice versa. Please note that the B<Invert> setting
6489 only effects how B<Min> and B<Max> are applied to a specific value. Especially
6490 the B<DataSource> and B<Satisfy> settings (see below) are not inverted.
6492 =item B<DataSource> I<DSName> [I<DSName> ...]
6494 Select one or more of the data sources. If no data source is configured, all
6495 data sources will be checked. If the type handled by the match does not have a
6496 data source of the specified name(s), this will always result in no match
6497 (independent of the B<Invert> setting).
6499 =item B<Satisfy> B<Any>|B<All>
6501 Specifies how checking with several data sources is performed. If set to
6502 B<Any>, the match succeeds if one of the data sources is in the configured
6503 range. If set to B<All> the match only succeeds if all data sources are within
6504 the configured range. Default is B<All>.
6506 Usually B<All> is used for positive matches, B<Any> is used for negative
6507 matches. This means that with B<All> you usually check that all values are in a
6508 "good" range, while with B<Any> you check if any value is within a "bad" range
6509 (or outside the "good" range).
6511 =back
6513 Either B<Min> or B<Max>, but not both, may be unset.
6515 Example:
6517  # Match all values smaller than or equal to 100. Matches only if all data
6518  # sources are below 100.
6519  <Match "value">
6520    Max 100
6521    Satisfy "All"
6522  </Match>
6523  
6524  # Match if the value of any data source is outside the range of 0 - 100.
6525  <Match "value">
6526    Min   0
6527    Max 100
6528    Invert true
6529    Satisfy "Any"
6530  </Match>
6532 =item B<empty_counter>
6534 Matches all values with one or more data sources of type B<COUNTER> and where
6535 all counter values are zero. These counters usually I<never> increased since
6536 they started existing (and are therefore uninteresting), or got reset recently
6537 or overflowed and you had really, I<really> bad luck.
6539 Please keep in mind that ignoring such counters can result in confusing
6540 behavior: Counters which hardly ever increase will be zero for long periods of
6541 time. If the counter is reset for some reason (machine or service restarted,
6542 usually), the graph will be empty (NAN) for a long time. People may not
6543 understand why.
6545 =item B<hashed>
6547 Calculates a hash value of the host name and matches values according to that
6548 hash value. This makes it possible to divide all hosts into groups and match
6549 only values that are in a specific group. The intended use is in load
6550 balancing, where you want to handle only part of all data and leave the rest
6551 for other servers.
6553 The hashing function used tries to distribute the hosts evenly. First, it
6554 calculates a 32E<nbsp>bit hash value using the characters of the hostname:
6556   hash_value = 0;
6557   for (i = 0; host[i] != 0; i++)
6558     hash_value = (hash_value * 251) + host[i];
6560 The constant 251 is a prime number which is supposed to make this hash value
6561 more random. The code then checks the group for this host according to the
6562 I<Total> and I<Match> arguments:
6564   if ((hash_value % Total) == Match)
6565     matches;
6566   else
6567     does not match;
6569 Please note that when you set I<Total> to two (i.E<nbsp>e. you have only two
6570 groups), then the least significant bit of the hash value will be the XOR of
6571 all least significant bits in the host name. One consequence is that when you
6572 have two hosts, "server0.example.com" and "server1.example.com", where the host
6573 name differs in one digit only and the digits differ by one, those hosts will
6574 never end up in the same group.
6576 Available options:
6578 =over 4
6580 =item B<Match> I<Match> I<Total>
6582 Divide the data into I<Total> groups and match all hosts in group I<Match> as
6583 described above. The groups are numbered from zero, i.E<nbsp>e. I<Match> must
6584 be smaller than I<Total>. I<Total> must be at least one, although only values
6585 greater than one really do make any sense.
6587 You can repeat this option to match multiple groups, for example:
6589   Match 3 7
6590   Match 5 7
6592 The above config will divide the data into seven groups and match groups three
6593 and five. One use would be to keep every value on two hosts so that if one
6594 fails the missing data can later be reconstructed from the second host.
6596 =back
6598 Example:
6600  # Operate on the pre-cache chain, so that ignored values are not even in the
6601  # global cache.
6602  <Chain "PreCache">
6603    <Rule>
6604      <Match "hashed">
6605        # Divide all received hosts in seven groups and accept all hosts in
6606        # group three.
6607        Match 3 7
6608      </Match>
6609      # If matched: Return and continue.
6610      Target "return"
6611    </Rule>
6612    # If not matched: Return and stop.
6613    Target "stop"
6614  </Chain>
6616 =back
6618 =head2 Available targets
6620 =over 4
6622 =item B<notification>
6624 Creates and dispatches a notification.
6626 Available options:
6628 =over 4
6630 =item B<Message> I<String>
6632 This required option sets the message of the notification. The following
6633 placeholders will be replaced by an appropriate value:
6635 =over 4
6637 =item B<%{host}>
6639 =item B<%{plugin}>
6641 =item B<%{plugin_instance}>
6643 =item B<%{type}>
6645 =item B<%{type_instance}>
6647 These placeholders are replaced by the identifier field of the same name.
6649 =item B<%{ds:>I<name>B<}>
6651 These placeholders are replaced by a (hopefully) human readable representation
6652 of the current rate of this data source. If you changed the instance name
6653 (using the B<set> or B<replace> targets, see below), it may not be possible to
6654 convert counter values to rates.
6656 =back
6658 Please note that these placeholders are B<case sensitive>!
6660 =item B<Severity> B<"FAILURE">|B<"WARNING">|B<"OKAY">
6662 Sets the severity of the message. If omitted, the severity B<"WARNING"> is
6663 used.
6665 =back
6667 Example:
6669   <Target "notification">
6670     Message "Oops, the %{type_instance} temperature is currently %{ds:value}!"
6671     Severity "WARNING"
6672   </Target>
6674 =item B<replace>
6676 Replaces parts of the identifier using regular expressions.
6678 Available options:
6680 =over 4
6682 =item B<Host> I<Regex> I<Replacement>
6684 =item B<Plugin> I<Regex> I<Replacement>
6686 =item B<PluginInstance> I<Regex> I<Replacement>
6688 =item B<TypeInstance> I<Regex> I<Replacement>
6690 Match the appropriate field with the given regular expression I<Regex>. If the
6691 regular expression matches, that part that matches is replaced with
6692 I<Replacement>. If multiple places of the input buffer match a given regular
6693 expression, only the first occurrence will be replaced.
6695 You can specify each option multiple times to use multiple regular expressions
6696 one after another.
6698 =back
6700 Example:
6702  <Target "replace">
6703    # Replace "example.net" with "example.com"
6704    Host "\\<example.net\\>" "example.com"
6705  
6706    # Strip "www." from hostnames
6707    Host "\\<www\\." ""
6708  </Target>
6710 =item B<set>
6712 Sets part of the identifier of a value to a given string.
6714 Available options:
6716 =over 4
6718 =item B<Host> I<String>
6720 =item B<Plugin> I<String>
6722 =item B<PluginInstance> I<String>
6724 =item B<TypeInstance> I<String>
6726 Set the appropriate field to the given string. The strings for plugin instance
6727 and type instance may be empty, the strings for host and plugin may not be
6728 empty. It's currently not possible to set the type of a value this way.
6730 =back
6732 Example:
6734  <Target "set">
6735    PluginInstance "coretemp"
6736    TypeInstance "core3"
6737  </Target>
6739 =back
6741 =head2 Backwards compatibility
6743 If you use collectd with an old configuration, i.E<nbsp>e. one without a
6744 B<Chain> block, it will behave as it used to. This is equivalent to the
6745 following configuration:
6747  <Chain "PostCache">
6748    Target "write"
6749  </Chain>
6751 If you specify a B<PostCacheChain>, the B<write> target will not be added
6752 anywhere and you will have to make sure that it is called where appropriate. We
6753 suggest to add the above snippet as default target to your "PostCache" chain.
6755 =head2 Examples
6757 Ignore all values, where the hostname does not contain a dot, i.E<nbsp>e. can't
6758 be an FQDN.
6760  <Chain "PreCache">
6761    <Rule "no_fqdn">
6762      <Match "regex">
6763        Host "^[^\.]*$"
6764      </Match>
6765      Target "stop"
6766    </Rule>
6767    Target "write"
6768  </Chain>
6770 =head1 SEE ALSO
6772 L<collectd(1)>,
6773 L<collectd-exec(5)>,
6774 L<collectd-perl(5)>,
6775 L<collectd-unixsock(5)>,
6776 L<types.db(5)>,
6777 L<hddtemp(8)>,
6778 L<iptables(8)>,
6779 L<kstat(3KSTAT)>,
6780 L<mbmon(1)>,
6781 L<psql(1)>,
6782 L<regex(7)>,
6783 L<rrdtool(1)>,
6784 L<sensors(1)>
6786 =head1 AUTHOR
6788 Florian Forster E<lt>octo@verplant.orgE<gt>
6790 =cut