Code

ddf3ac60e12da8699fdcc238674cee63aff75621
[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>. This is required to load plugins, unless the
74 B<AutoLoadPlugin> option is enabled (see below). Without any loaded plugins,
75 I<collectd> will be mostly useless.
77 Only the first B<LoadPlugin> statement or block for a given plugin name has any
78 effect. This is useful when you want to split up the configuration into smaller
79 files and want each file to be "self contained", i.e. it contains a B<Plugin>
80 block I<and> then appropriate B<LoadPlugin> statement. The downside is that if
81 you have multiple conflicting B<LoadPlugin> blocks, e.g. when they specify
82 different intervals, only one of them (the first one encountered) will take
83 effect and all others will be silently ignored.
85 B<LoadPlugin> may either be a simple configuration I<statement> or a I<block>
86 with additional options, affecting the behavior of B<LoadPlugin>. A simple
87 statement looks like this:
89  LoadPlugin "cpu"
91 Options inside a B<LoadPlugin> block can override default settings and
92 influence the way plugins are loaded, e.g.:
94  <LoadPlugin perl>
95    Globals true
96    Interval 60
97  </LoadPlugin>
99 The following options are valid inside B<LoadPlugin> blocks:
101 =over 4
103 =item B<Globals> B<true|false>
105 If enabled, collectd will export all global symbols of the plugin (and of all
106 libraries loaded as dependencies of the plugin) and, thus, makes those symbols
107 available for resolving unresolved symbols in subsequently loaded plugins if
108 that is supported by your system.
110 This is useful (or possibly even required), e.g., when loading a plugin that
111 embeds some scripting language into the daemon (e.g. the I<Perl> and
112 I<Python plugins>). Scripting languages usually provide means to load
113 extensions written in C. Those extensions require symbols provided by the
114 interpreter, which is loaded as a dependency of the respective collectd plugin.
115 See the documentation of those plugins (e.g., L<collectd-perl(5)> or
116 L<collectd-python(5)>) for details.
118 By default, this is disabled. As a special exception, if the plugin name is
119 either C<perl> or C<python>, the default is changed to enabled in order to keep
120 the average user from ever having to deal with this low level linking stuff.
122 =item B<Interval> I<Seconds>
124 Sets a plugin-specific interval for collecting metrics. This overrides the
125 global B<Interval> setting. If a plugin provides own support for specifying an
126 interval, that setting will take precedence.
128 =back
130 =item B<AutoLoadPlugin> B<false>|B<true>
132 When set to B<false> (the default), each plugin needs to be loaded explicitly,
133 using the B<LoadPlugin> statement documented above. If a
134 B<E<lt>PluginE<nbsp>...E<gt>> block is encountered and no configuration
135 handling callback for this plugin has been registered, a warning is logged and
136 the block is ignored.
138 When set to B<true>, explicit B<LoadPlugin> statements are not required. Each
139 B<E<lt>PluginE<nbsp>...E<gt>> block acts as if it was immediately preceded by a
140 B<LoadPlugin> statement. B<LoadPlugin> statements are still required for
141 plugins that don't provide any configuration, e.g. the I<Load plugin>.
143 =item B<Include> I<Path> [I<pattern>]
145 If I<Path> points to a file, includes that file. If I<Path> points to a
146 directory, recursively includes all files within that directory and its
147 subdirectories. If the C<wordexp> function is available on your system,
148 shell-like wildcards are expanded before files are included. This means you can
149 use statements like the following:
151   Include "/etc/collectd.d/*.conf"
153 Starting with version 5.3, this may also be a block in which further options
154 affecting the behavior of B<Include> may be specified. The following option is
155 currently allowed:
157   <Include "/etc/collectd.d">
158     Filter "*.conf"
159   </Include>
161 =over 4
163 =item B<Filter> I<pattern>
165 If the C<fnmatch> function is available on your system, a shell-like wildcard
166 I<pattern> may be specified to filter which files to include. This may be used
167 in combination with recursively including a directory to easily be able to
168 arbitrarily mix configuration files and other documents (e.g. README files).
169 The given example is similar to the first example above but includes all files
170 matching C<*.conf> in any subdirectory of C</etc/collectd.d>:
172   Include "/etc/collectd.d" "*.conf"
174 =back
176 If more than one files are included by a single B<Include> option, the files
177 will be included in lexicographical order (as defined by the C<strcmp>
178 function). Thus, you can e.E<nbsp>g. use numbered prefixes to specify the
179 order in which the files are loaded.
181 To prevent loops and shooting yourself in the foot in interesting ways the
182 nesting is limited to a depth of 8E<nbsp>levels, which should be sufficient for
183 most uses. Since symlinks are followed it is still possible to crash the daemon
184 by looping symlinks. In our opinion significant stupidity should result in an
185 appropriate amount of pain.
187 It is no problem to have a block like C<E<lt>Plugin fooE<gt>> in more than one
188 file, but you cannot include files from within blocks.
190 =item B<PIDFile> I<File>
192 Sets where to write the PID file to. This file is overwritten when it exists
193 and deleted when the program is stopped. Some init-scripts might override this
194 setting using the B<-P> command-line option.
196 =item B<PluginDir> I<Directory>
198 Path to the plugins (shared objects) of collectd.
200 =item B<TypesDB> I<File> [I<File> ...]
202 Set one or more files that contain the data-set descriptions. See
203 L<types.db(5)> for a description of the format of this file.
205 =item B<Interval> I<Seconds>
207 Configures the interval in which to query the read plugins. Obviously smaller
208 values lead to a higher system load produced by collectd, while higher values
209 lead to more coarse statistics.
211 B<Warning:> You should set this once and then never touch it again. If you do,
212 I<you will have to delete all your RRD files> or know some serious RRDtool
213 magic! (Assuming you're using the I<RRDtool> or I<RRDCacheD> plugin.)
215 =item B<Timeout> I<Iterations>
217 Consider a value list "missing" when no update has been read or received for
218 I<Iterations> iterations. By default, I<collectd> considers a value list
219 missing when no update has been received for twice the update interval. Since
220 this setting uses iterations, the maximum allowed time without update depends
221 on the I<Interval> information contained in each value list. This is used in
222 the I<Threshold> configuration to dispatch notifications about missing values,
223 see L<collectd-threshold(5)> for details.
225 =item B<ReadThreads> I<Num>
227 Number of threads to start for reading plugins. The default value is B<5>, but
228 you may want to increase this if you have more than five plugins that take a
229 long time to read. Mostly those are plugins that do network-IO. Setting this to
230 a value higher than the number of registered read callbacks is not recommended.
232 =item B<WriteThreads> I<Num>
234 Number of threads to start for dispatching value lists to write plugins. The
235 default value is B<5>, but you may want to increase this if you have more than
236 five plugins that may take relatively long to write to.
238 =item B<Hostname> I<Name>
240 Sets the hostname that identifies a host. If you omit this setting, the
241 hostname will be determined using the L<gethostname(2)> system call.
243 =item B<FQDNLookup> B<true|false>
245 If B<Hostname> is determined automatically this setting controls whether or not
246 the daemon should try to figure out the "fully qualified domain name", FQDN.
247 This is done using a lookup of the name returned by C<gethostname>. This option
248 is enabled by default.
250 =item B<PreCacheChain> I<ChainName>
252 =item B<PostCacheChain> I<ChainName>
254 Configure the name of the "pre-cache chain" and the "post-cache chain". Please
255 see L<FILTER CONFIGURATION> below on information on chains and how these
256 setting change the daemon's behavior.
258 =back
260 =head1 PLUGIN OPTIONS
262 Some plugins may register own options. These options must be enclosed in a
263 C<Plugin>-Section. Which options exist depends on the plugin used. Some plugins
264 require external configuration, too. The C<apache plugin>, for example,
265 required C<mod_status> to be configured in the webserver you're going to
266 collect data from. These plugins are listed below as well, even if they don't
267 require any configuration within collectd's configuration file.
269 A list of all plugins and a short summary for each plugin can be found in the
270 F<README> file shipped with the sourcecode and hopefully binary packets as
271 well.
273 =head2 Plugin C<aggregation>
275 The I<Aggregation plugin> makes it possible to aggregate several values into
276 one using aggregation functions such as I<sum>, I<average>, I<min> and I<max>.
277 This can be put to a wide variety of uses, e.g. average and total CPU
278 statistics for your entire fleet.
280 The grouping is powerful but, as with many powerful tools, may be a bit
281 difficult to wrap your head around. The grouping will therefore be
282 demonstrated using an example: The average and sum of the CPU usage across
283 all CPUs of each host is to be calculated.
285 To select all the affected values for our example, set C<Plugin cpu> and
286 C<Type cpu>. The other values are left unspecified, meaning "all values". The
287 I<Host>, I<Plugin>, I<PluginInstance>, I<Type> and I<TypeInstance> options
288 work as if they were specified in the C<WHERE> clause of an C<SELECT> SQL
289 statement.
291   Plugin "cpu"
292   Type "cpu"
294 Although the I<Host>, I<PluginInstance> (CPU number, i.e. 0, 1, 2, ...)  and
295 I<TypeInstance> (idle, user, system, ...) fields are left unspecified in the
296 example, the intention is to have a new value for each host / type instance
297 pair. This is achieved by "grouping" the values using the C<GroupBy> option.
298 It can be specified multiple times to group by more than one field.
300   GroupBy "Host"
301   GroupBy "TypeInstance"
303 We do neither specify nor group by I<plugin instance> (the CPU number), so all
304 metrics that differ in the CPU number only will be aggregated. Each
305 aggregation needs I<at least one> such field, otherwise no aggregation would
306 take place.
308 The full example configuration looks like this:
310  <Plugin "aggregation">
311    <Aggregation>
312      Plugin "cpu"
313      Type "cpu"
314      
315      GroupBy "Host"
316      GroupBy "TypeInstance"
317      
318      CalculateSum true
319      CalculateAverage true
320    </Aggregation>
321  </Plugin>
323 There are a couple of limitations you should be aware of:
325 =over 4
327 =item
329 The I<Type> cannot be left unspecified, because it is not reasonable to add
330 apples to oranges. Also, the internal lookup structure won't work if you try
331 to group by type.
333 =item
335 There must be at least one unspecified, ungrouped field. Otherwise nothing
336 will be aggregated.
338 =back
340 As you can see in the example above, each aggregation has its own
341 B<Aggregation> block. You can have multiple aggregation blocks and aggregation
342 blocks may match the same values, i.e. one value list can update multiple
343 aggregations. The following options are valid inside B<Aggregation> blocks:
345 =over 4
347 =item B<Host> I<Host>
349 =item B<Plugin> I<Plugin>
351 =item B<PluginInstance> I<PluginInstance>
353 =item B<Type> I<Type>
355 =item B<TypeInstance> I<TypeInstance>
357 Selects the value lists to be added to this aggregation. B<Type> must be a
358 valid data set name, see L<types.db(5)> for details.
360 If the string starts with and ends with a slash (C</>), the string is
361 interpreted as a I<regular expression>. The regex flavor used are POSIX
362 extended regular expressions as described in L<regex(7)>. Example usage:
364  Host "/^db[0-9]\\.example\\.com$/"
366 =item B<GroupBy> B<Host>|B<Plugin>|B<PluginInstance>|B<TypeInstance>
368 Group valued by the specified field. The B<GroupBy> option may be repeated to
369 group by multiple fields.
371 =item B<SetHost> I<Host>
373 =item B<SetPlugin> I<Plugin>
375 =item B<SetPluginInstance> I<PluginInstance>
377 =item B<SetTypeInstance> I<TypeInstance>
379 Sets the appropriate part of the identifier to the provided string.
381 The I<PluginInstance> should include the placeholder C<%{aggregation}> which
382 will be replaced with the aggregation function, e.g. "average". Not including
383 the placeholder will result in duplication warnings and/or messed up values if
384 more than one aggregation function are enabled.
386 The following example calculates the average usage of all "even" CPUs:
388  <Plugin "aggregation">
389    <Aggregation>
390      Plugin "cpu"
391      PluginInstance "/[0,2,4,6,8]$/"
392      Type "cpu"
393      
394      SetPlugin "cpu"
395      SetPluginInstance "even-%{aggregation}"
396      
397      GroupBy "Host"
398      GroupBy "TypeInstance"
399      
400      CalculateAverage true
401    </Aggregation>
402  </Plugin>
404 This will create the files:
406 =over 4
408 =item
410 foo.example.com/cpu-even-average/cpu-idle
412 =item
414 foo.example.com/cpu-even-average/cpu-system
416 =item
418 foo.example.com/cpu-even-average/cpu-user
420 =item
422 ...
424 =back
426 =item B<CalculateNum> B<true>|B<false>
428 =item B<CalculateSum> B<true>|B<false>
430 =item B<CalculateAverage> B<true>|B<false>
432 =item B<CalculateMinimum> B<true>|B<false>
434 =item B<CalculateMaximum> B<true>|B<false>
436 =item B<CalculateStddev> B<true>|B<false>
438 Boolean options for enabling calculation of the number of value lists, their
439 sum, average, minimum, maximum andE<nbsp>/ or standard deviation. All options
440 are disabled by default.
442 =back
444 =head2 Plugin C<amqp>
446 The I<AMQMP plugin> can be used to communicate with other instances of
447 I<collectd> or third party applications using an AMQP message broker. Values
448 are sent to or received from the broker, which handles routing, queueing and
449 possibly filtering or messages.
451  <Plugin "amqp">
452    # Send values to an AMQP broker
453    <Publish "some_name">
454      Host "localhost"
455      Port "5672"
456      VHost "/"
457      User "guest"
458      Password "guest"
459      Exchange "amq.fanout"
460  #   ExchangeType "fanout"
461  #   RoutingKey "collectd"
462  #   Persistent false
463  #   Format "command"
464  #   StoreRates false
465  #   GraphitePrefix "collectd."
466  #   GraphiteEscapeChar "_"
467    </Publish>
468    
469    # Receive values from an AMQP broker
470    <Subscribe "some_name">
471      Host "localhost"
472      Port "5672"
473      VHost "/"
474      User "guest"
475      Password "guest"
476      Exchange "amq.fanout"
477  #   ExchangeType "fanout"
478  #   Queue "queue_name"
479  #   RoutingKey "collectd.#"
480    </Subscribe>
481  </Plugin>
483 The plugin's configuration consists of a number of I<Publish> and I<Subscribe>
484 blocks, which configure sending and receiving of values respectively. The two
485 blocks are very similar, so unless otherwise noted, an option can be used in
486 either block. The name given in the blocks starting tag is only used for
487 reporting messages, but may be used to support I<flushing> of certain
488 I<Publish> blocks in the future.
490 =over 4
492 =item B<Host> I<Host>
494 Hostname or IP-address of the AMQP broker. Defaults to the default behavior of
495 the underlying communications library, I<rabbitmq-c>, which is "localhost".
497 =item B<Port> I<Port>
499 Service name or port number on which the AMQP broker accepts connections. This
500 argument must be a string, even if the numeric form is used. Defaults to
501 "5672".
503 =item B<VHost> I<VHost>
505 Name of the I<virtual host> on the AMQP broker to use. Defaults to "/".
507 =item B<User> I<User>
509 =item B<Password> I<Password>
511 Credentials used to authenticate to the AMQP broker. By default "guest"/"guest"
512 is used.
514 =item B<Exchange> I<Exchange>
516 In I<Publish> blocks, this option specifies the I<exchange> to send values to.
517 By default, "amq.fanout" will be used.
519 In I<Subscribe> blocks this option is optional. If given, a I<binding> between
520 the given exchange and the I<queue> is created, using the I<routing key> if
521 configured. See the B<Queue> and B<RoutingKey> options below.
523 =item B<ExchangeType> I<Type>
525 If given, the plugin will try to create the configured I<exchange> with this
526 I<type> after connecting. When in a I<Subscribe> block, the I<queue> will then
527 be bound to this exchange.
529 =item B<Queue> I<Queue> (Subscribe only)
531 Configures the I<queue> name to subscribe to. If no queue name was configures
532 explicitly, a unique queue name will be created by the broker.
534 =item B<RoutingKey> I<Key>
536 In I<Publish> blocks, this configures the routing key to set on all outgoing
537 messages. If not given, the routing key will be computed from the I<identifier>
538 of the value. The host, plugin, type and the two instances are concatenated
539 together using dots as the separator and all containing dots replaced with
540 slashes. For example "collectd.host/example/com.cpu.0.cpu.user". This makes it
541 possible to receive only specific values using a "topic" exchange.
543 In I<Subscribe> blocks, configures the I<routing key> used when creating a
544 I<binding> between an I<exchange> and the I<queue>. The usual wildcards can be
545 used to filter messages when using a "topic" exchange. If you're only
546 interested in CPU statistics, you could use the routing key "collectd.*.cpu.#"
547 for example.
549 =item B<Persistent> B<true>|B<false> (Publish only)
551 Selects the I<delivery method> to use. If set to B<true>, the I<persistent>
552 mode will be used, i.e. delivery is guaranteed. If set to B<false> (the
553 default), the I<transient> delivery mode will be used, i.e. messages may be
554 lost due to high load, overflowing queues or similar issues.
556 =item B<Format> B<Command>|B<JSON>|B<Graphite> (Publish only)
558 Selects the format in which messages are sent to the broker. If set to
559 B<Command> (the default), values are sent as C<PUTVAL> commands which are
560 identical to the syntax used by the I<Exec> and I<UnixSock plugins>. In this
561 case, the C<Content-Type> header field will be set to C<text/collectd>.
563 If set to B<JSON>, the values are encoded in the I<JavaScript Object Notation>,
564 an easy and straight forward exchange format. The C<Content-Type> header field
565 will be set to C<application/json>.
567 If set to B<Graphite>, values are encoded in the I<Graphite> format, which is
568 "<metric> <value> <timestamp>\n". The C<Content-Type> header field will be set to
569 C<text/graphite>.
571 A subscribing client I<should> use the C<Content-Type> header field to
572 determine how to decode the values. Currently, the I<AMQP plugin> itself can
573 only decode the B<Command> format.
575 =item B<StoreRates> B<true>|B<false> (Publish only)
577 Determines whether or not C<COUNTER>, C<DERIVE> and C<ABSOLUTE> data sources
578 are converted to a I<rate> (i.e. a C<GAUGE> value). If set to B<false> (the
579 default), no conversion is performed. Otherwise the conversion is performed
580 using the internal value cache.
582 Please note that currently this option is only used if the B<Format> option has
583 been set to B<JSON>.
585 =item B<GraphitePrefix> (Publish and B<Format>=I<Graphite> only)
587 A prefix can be added in the metric name when outputting in the I<Graphite> format.
588 It's added before the I<Host> name.
589 Metric name will be "<prefix><host><postfix><plugin><type><name>"
591 =item B<GraphitePostfix> (Publish and B<Format>=I<Graphite> only)
593 A postfix can be added in the metric name when outputting in the I<Graphite> format.
594 It's added after the I<Host> name.
595 Metric name will be "<prefix><host><postfix><plugin><type><name>"
597 =item B<GraphiteEscapeChar> (Publish and B<Format>=I<Graphite> only)
599 Specify a character to replace dots (.) in the host part of the metric name.
600 In I<Graphite> metric name, dots are used as separators between different
601 metric parts (host, plugin, type).
602 Default is "_" (I<Underscore>).
604 =back
606 =head2 Plugin C<apache>
608 To configure the C<apache>-plugin you first need to configure the Apache
609 webserver correctly. The Apache-plugin C<mod_status> needs to be loaded and
610 working and the C<ExtendedStatus> directive needs to be B<enabled>. You can use
611 the following snipped to base your Apache config upon:
613   ExtendedStatus on
614   <IfModule mod_status.c>
615     <Location /mod_status>
616       SetHandler server-status
617     </Location>
618   </IfModule>
620 Since its C<mod_status> module is very similar to Apache's, B<lighttpd> is
621 also supported. It introduces a new field, called C<BusyServers>, to count the
622 number of currently connected clients. This field is also supported.
624 The configuration of the I<Apache> plugin consists of one or more
625 C<E<lt>InstanceE<nbsp>/E<gt>> blocks. Each block requires one string argument
626 as the instance name. For example:
628  <Plugin "apache">
629    <Instance "www1">
630      URL "http://www1.example.com/mod_status?auto"
631    </Instance>
632    <Instance "www2">
633      URL "http://www2.example.com/mod_status?auto"
634    </Instance>
635  </Plugin>
637 The instance name will be used as the I<plugin instance>. To emulate the old
638 (versionE<nbsp>4) behavior, you can use an empty string (""). In order for the
639 plugin to work correctly, each instance name must be unique. This is not
640 enforced by the plugin and it is your responsibility to ensure it.
642 The following options are accepted within each I<Instance> block:
644 =over 4
646 =item B<URL> I<http://host/mod_status?auto>
648 Sets the URL of the C<mod_status> output. This needs to be the output generated
649 by C<ExtendedStatus on> and it needs to be the machine readable output
650 generated by appending the C<?auto> argument. This option is I<mandatory>.
652 =item B<User> I<Username>
654 Optional user name needed for authentication.
656 =item B<Password> I<Password>
658 Optional password needed for authentication.
660 =item B<VerifyPeer> B<true|false>
662 Enable or disable peer SSL certificate verification. See
663 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
665 =item B<VerifyHost> B<true|false>
667 Enable or disable peer host name verification. If enabled, the plugin checks
668 if the C<Common Name> or a C<Subject Alternate Name> field of the SSL
669 certificate matches the host name provided by the B<URL> option. If this
670 identity check fails, the connection is aborted. Obviously, only works when
671 connecting to a SSL enabled server. Enabled by default.
673 =item B<CACert> I<File>
675 File that holds one or more SSL certificates. If you want to use HTTPS you will
676 possibly need this option. What CA certificates come bundled with C<libcurl>
677 and are checked by default depends on the distribution you use.
679 =back
681 =head2 Plugin C<apcups>
683 =over 4
685 =item B<Host> I<Hostname>
687 Hostname of the host running B<apcupsd>. Defaults to B<localhost>. Please note
688 that IPv6 support has been disabled unless someone can confirm or decline that
689 B<apcupsd> can handle it.
691 =item B<Port> I<Port>
693 TCP-Port to connect to. Defaults to B<3551>.
695 =item B<ReportSeconds> B<true|false>
697 If set to B<true>, the time reported in the C<timeleft> metric will be
698 converted to seconds. This is the recommended setting. If set to B<false>, the
699 default for backwards compatibility, the time will be reported in minutes.
701 =back
703 =head2 Plugin C<ascent>
705 This plugin collects information about an Ascent server, a free server for the
706 "World of Warcraft" game. This plugin gathers the information by fetching the
707 XML status page using C<libcurl> and parses it using C<libxml2>.
709 The configuration options are the same as for the C<apache> plugin above:
711 =over 4
713 =item B<URL> I<http://localhost/ascent/status/>
715 Sets the URL of the XML status output.
717 =item B<User> I<Username>
719 Optional user name needed for authentication.
721 =item B<Password> I<Password>
723 Optional password needed for authentication.
725 =item B<VerifyPeer> B<true|false>
727 Enable or disable peer SSL certificate verification. See
728 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
730 =item B<VerifyHost> B<true|false>
732 Enable or disable peer host name verification. If enabled, the plugin checks
733 if the C<Common Name> or a C<Subject Alternate Name> field of the SSL
734 certificate matches the host name provided by the B<URL> option. If this
735 identity check fails, the connection is aborted. Obviously, only works when
736 connecting to a SSL enabled server. Enabled by default.
738 =item B<CACert> I<File>
740 File that holds one or more SSL certificates. If you want to use HTTPS you will
741 possibly need this option. What CA certificates come bundled with C<libcurl>
742 and are checked by default depends on the distribution you use.
744 =back
746 =head2 Plugin C<bind>
748 Starting with BIND 9.5.0, the most widely used DNS server software provides
749 extensive statistics about queries, responses and lots of other information.
750 The bind plugin retrieves this information that's encoded in XML and provided
751 via HTTP and submits the values to collectd.
753 To use this plugin, you first need to tell BIND to make this information
754 available. This is done with the C<statistics-channels> configuration option:
756  statistics-channels {
757    inet localhost port 8053;
758  };
760 The configuration follows the grouping that can be seen when looking at the
761 data with an XSLT compatible viewer, such as a modern web browser. It's
762 probably a good idea to make yourself familiar with the provided values, so you
763 can understand what the collected statistics actually mean.
765 Synopsis:
767  <Plugin "bind">
768    URL "http://localhost:8053/"
769    ParseTime       false
770    OpCodes         true
771    QTypes          true
772  
773    ServerStats     true
774    ZoneMaintStats  true
775    ResolverStats   false
776    MemoryStats     true
777  
778    <View "_default">
779      QTypes        true
780      ResolverStats true
781      CacheRRSets   true
782  
783      Zone "127.in-addr.arpa/IN"
784    </View>
785  </Plugin>
787 The bind plugin accepts the following configuration options:
789 =over 4
791 =item B<URL> I<URL>
793 URL from which to retrieve the XML data. If not specified,
794 C<http://localhost:8053/> will be used.
796 =item B<ParseTime> B<true>|B<false>
798 When set to B<true>, the time provided by BIND will be parsed and used to
799 dispatch the values. When set to B<false>, the local time source is queried.
801 This setting is set to B<true> by default for backwards compatibility; setting
802 this to B<false> is I<recommended> to avoid problems with timezones and
803 localization.
805 =item B<OpCodes> B<true>|B<false>
807 When enabled, statistics about the I<"OpCodes">, for example the number of
808 C<QUERY> packets, are collected.
810 Default: Enabled.
812 =item B<QTypes> B<true>|B<false>
814 When enabled, the number of I<incoming> queries by query types (for example
815 C<A>, C<MX>, C<AAAA>) is collected.
817 Default: Enabled.
819 =item B<ServerStats> B<true>|B<false>
821 Collect global server statistics, such as requests received over IPv4 and IPv6,
822 successful queries, and failed updates.
824 Default: Enabled.
826 =item B<ZoneMaintStats> B<true>|B<false>
828 Collect zone maintenance statistics, mostly information about notifications
829 (zone updates) and zone transfers.
831 Default: Enabled.
833 =item B<ResolverStats> B<true>|B<false>
835 Collect resolver statistics, i.E<nbsp>e. statistics about outgoing requests
836 (e.E<nbsp>g. queries over IPv4, lame servers). Since the global resolver
837 counters apparently were removed in BIND 9.5.1 and 9.6.0, this is disabled by
838 default. Use the B<ResolverStats> option within a B<View "_default"> block
839 instead for the same functionality.
841 Default: Disabled.
843 =item B<MemoryStats>
845 Collect global memory statistics.
847 Default: Enabled.
849 =item B<View> I<Name>
851 Collect statistics about a specific I<"view">. BIND can behave different,
852 mostly depending on the source IP-address of the request. These different
853 configurations are called "views". If you don't use this feature, you most
854 likely are only interested in the C<_default> view.
856 Within a E<lt>B<View>E<nbsp>I<name>E<gt> block, you can specify which
857 information you want to collect about a view. If no B<View> block is
858 configured, no detailed view statistics will be collected.
860 =over 4
862 =item B<QTypes> B<true>|B<false>
864 If enabled, the number of I<outgoing> queries by query type (e.E<nbsp>g. C<A>,
865 C<MX>) is collected.
867 Default: Enabled.
869 =item B<ResolverStats> B<true>|B<false>
871 Collect resolver statistics, i.E<nbsp>e. statistics about outgoing requests
872 (e.E<nbsp>g. queries over IPv4, lame servers).
874 Default: Enabled.
876 =item B<CacheRRSets> B<true>|B<false>
878 If enabled, the number of entries (I<"RR sets">) in the view's cache by query
879 type is collected. Negative entries (queries which resulted in an error, for
880 example names that do not exist) are reported with a leading exclamation mark,
881 e.E<nbsp>g. "!A".
883 Default: Enabled.
885 =item B<Zone> I<Name>
887 When given, collect detailed information about the given zone in the view. The
888 information collected if very similar to the global B<ServerStats> information
889 (see above).
891 You can repeat this option to collect detailed information about multiple
892 zones.
894 By default no detailed zone information is collected.
896 =back
898 =back
900 =head2 Plugin C<cgroups>
902 This plugin collects the CPU user/system time for each I<cgroup> by reading the
903 F<cpuacct.stat> files in the first cpuacct-mountpoint (typically
904 F</sys/fs/cgroup/cpu.cpuacct> on machines using systemd).
906 =over 4
908 =item B<CGroup> I<Directory>
910 Select I<cgroup> based on the name. Whether only matching I<cgroups> are
911 collected or if they are ignored is controlled by the B<IgnoreSelected> option;
912 see below.
914 =item B<IgnoreSelected> B<true>|B<false>
916 Invert the selection: If set to true, all cgroups I<except> the ones that
917 match any one of the criteria are collected. By default only selected
918 cgroups are collected if a selection is made. If no selection is configured
919 at all, B<all> cgroups are selected.
921 =back
923 =head2 Plugin C<cpufreq>
925 This plugin doesn't have any options. It reads
926 F</sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq> (for the first CPU
927 installed) to get the current CPU frequency. If this file does not exist make
928 sure B<cpufreqd> (L<http://cpufreqd.sourceforge.net/>) or a similar tool is
929 installed and an "cpu governor" (that's a kernel module) is loaded.
931 =head2 Plugin C<csv>
933 =over 4
935 =item B<DataDir> I<Directory>
937 Set the directory to store CSV-files under. Per default CSV-files are generated
938 beneath the daemon's working directory, i.E<nbsp>e. the B<BaseDir>.
939 The special strings B<stdout> and B<stderr> can be used to write to the standard
940 output and standard error channels, respectively. This, of course, only makes
941 much sense when collectd is running in foreground- or non-daemon-mode.
943 =item B<StoreRates> B<true|false>
945 If set to B<true>, convert counter values to rates. If set to B<false> (the
946 default) counter values are stored as is, i.E<nbsp>e. as an increasing integer
947 number.
949 =back
951 =head2 Plugin C<curl>
953 The curl plugin uses the B<libcurl> (L<http://curl.haxx.se/>) to read web pages
954 and the match infrastructure (the same code used by the tail plugin) to use
955 regular expressions with the received data.
957 The following example will read the current value of AMD stock from Google's
958 finance page and dispatch the value to collectd.
960   <Plugin curl>
961     <Page "stock_quotes">
962       URL "http://finance.google.com/finance?q=NYSE%3AAMD"
963       User "foo"
964       Password "bar"
965       <Match>
966         Regex "<span +class=\"pr\"[^>]*> *([0-9]*\\.[0-9]+) *</span>"
967         DSType "GaugeAverage"
968         # Note: `stock_value' is not a standard type.
969         Type "stock_value"
970         Instance "AMD"
971       </Match>
972     </Page>
973   </Plugin>
975 In the B<Plugin> block, there may be one or more B<Page> blocks, each defining
976 a web page and one or more "matches" to be performed on the returned data. The
977 string argument to the B<Page> block is used as plugin instance.
979 The following options are valid within B<Page> blocks:
981 =over 4
983 =item B<URL> I<URL>
985 URL of the web site to retrieve. Since a regular expression will be used to
986 extract information from this data, non-binary data is a big plus here ;)
988 =item B<User> I<Name>
990 Username to use if authorization is required to read the page.
992 =item B<Password> I<Password>
994 Password to use if authorization is required to read the page.
996 =item B<VerifyPeer> B<true>|B<false>
998 Enable or disable peer SSL certificate verification. See
999 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
1001 =item B<VerifyHost> B<true>|B<false>
1003 Enable or disable peer host name verification. If enabled, the plugin checks if
1004 the C<Common Name> or a C<Subject Alternate Name> field of the SSL certificate
1005 matches the host name provided by the B<URL> option. If this identity check
1006 fails, the connection is aborted. Obviously, only works when connecting to a
1007 SSL enabled server. Enabled by default.
1009 =item B<CACert> I<file>
1011 File that holds one or more SSL certificates. If you want to use HTTPS you will
1012 possibly need this option. What CA certificates come bundled with C<libcurl>
1013 and are checked by default depends on the distribution you use.
1015 =item B<Header> I<Header>
1017 A HTTP header to add to the request. Multiple headers are added if this option
1018 is specified more than once.
1020 =item B<Post> I<Body>
1022 Specifies that the HTTP operation should be a POST instead of a GET. The
1023 complete data to be posted is given as the argument.  This option will usually
1024 need to be accompanied by a B<Header> option to set an appropriate
1025 C<Content-Type> for the post body (e.g. to
1026 C<application/x-www-form-urlencoded>).
1028 =item B<MeasureResponseTime> B<true>|B<false>
1030 Measure response time for the request. If this setting is enabled, B<Match>
1031 blocks (see below) are optional. Disabled by default.
1033 =item B<E<lt>MatchE<gt>>
1035 One or more B<Match> blocks that define how to match information in the data
1036 returned by C<libcurl>. The C<curl> plugin uses the same infrastructure that's
1037 used by the C<tail> plugin, so please see the documentation of the C<tail>
1038 plugin below on how matches are defined. If the B<MeasureResponseTime> option
1039 is set to B<true>, B<Match> blocks are optional.
1041 =back
1043 =head2 Plugin C<curl_json>
1045 The B<curl_json plugin> uses B<libcurl> (L<http://curl.haxx.se/>) and
1046 B<libyajl> (L<http://www.lloydforge.org/projects/yajl/>) to retrieve JSON data
1047 via cURL. This can be used to collect values from CouchDB documents (which are
1048 stored JSON notation), for example.
1050 The following example will collect several values from the built-in `_stats'
1051 runtime statistics module of CouchDB
1052 (L<http://wiki.apache.org/couchdb/Runtime_Statistics>).
1054   <Plugin curl_json>
1055     <URL "http://localhost:5984/_stats">
1056       Instance "httpd"
1057       <Key "httpd/requests/count">
1058         Type "http_requests"
1059       </Key>
1061       <Key "httpd_request_methods/*/count">
1062         Type "http_request_methods"
1063       </Key>
1065       <Key "httpd_status_codes/*/count">
1066         Type "http_response_codes"
1067       </Key>
1068     </URL>
1069   </Plugin>
1071 In the B<Plugin> block, there may be one or more B<URL> blocks, each defining
1072 a URL to be fetched via HTTP (using libcurl) and one or more B<Key> blocks.
1073 The B<Key> string argument must be in a path format, which is used to collect a
1074 value from a JSON map object. If a path element of B<Key> is the
1075 I<*>E<nbsp>wildcard, the values for all keys will be collectd.
1077 The following options are valid within B<URL> blocks:
1079 =over 4
1081 =item B<Instance> I<Instance>
1083 Sets the plugin instance to I<Instance>.
1085 =item B<User> I<Name>
1086 =item B<Password> I<Password>
1087 =item B<VerifyPeer> B<true>|B<false>
1088 =item B<VerifyHost> B<true>|B<false>
1089 =item B<CACert> I<file>
1090 =item B<Header> I<Header>
1091 =item B<Post> I<Body>
1093 These options behave exactly equivalent to the appropriate options of the
1094 I<cURL> plugin. Please see there for a detailed description.
1096 =back
1098 The following options are valid within B<Key> blocks:
1100 =over 4
1102 =item B<Type> I<Type>
1104 Sets the type used to dispatch the values to the daemon. Detailed information
1105 about types and their configuration can be found in L<types.db(5)>. This
1106 option is mandatory.
1108 =item B<Instance> I<Instance>
1110 Type-instance to use. Defaults to the current map key or current string array element value.
1112 =back
1114 =head2 Plugin C<curl_xml>
1116 The B<curl_xml plugin> uses B<libcurl> (L<http://curl.haxx.se/>) and B<libxml2>
1117 (L<http://xmlsoft.org/>) to retrieve XML data via cURL.
1119  <Plugin "curl_xml">
1120    <URL "http://localhost/stats.xml">
1121      Host "my_host"
1122      Instance "some_instance"
1123      User "collectd"
1124      Password "thaiNg0I"
1125      VerifyPeer true
1126      VerifyHost true
1127      CACert "/path/to/ca.crt"
1129      <XPath "table[@id=\"magic_level\"]/tr">
1130        Type "magic_level"
1131        #InstancePrefix "prefix-"
1132        InstanceFrom "td[1]"
1133        ValuesFrom "td[2]/span[@class=\"level\"]"
1134      </XPath>
1135    </URL>
1136  </Plugin>
1138 In the B<Plugin> block, there may be one or more B<URL> blocks, each defining a
1139 URL to be fetched using libcurl. Within each B<URL> block there are
1140 options which specify the connection parameters, for example authentication
1141 information, and one or more B<XPath> blocks.
1143 Each B<XPath> block specifies how to get one type of information. The
1144 string argument must be a valid XPath expression which returns a list
1145 of "base elements". One value is dispatched for each "base element". The
1146 I<type instance> and values are looked up using further I<XPath> expressions
1147 that should be relative to the base element.
1149 Within the B<URL> block the following options are accepted:
1151 =over 4
1153 =item B<Host> I<Name>
1155 Use I<Name> as the host name when submitting values. Defaults to the global
1156 host name setting.
1158 =item B<Instance> I<Instance>
1160 Use I<Instance> as the plugin instance when submitting values. Defaults to an
1161 empty string (no plugin instance).
1163 =item B<Namespace> I<Prefix> I<URL>
1165 If an XPath expression references namespaces, they must be specified
1166 with this option. I<Prefix> is the "namespace prefix" used in the XML document.
1167 I<URL> is the "namespace name", an URI reference uniquely identifying the
1168 namespace. The option can be repeated to register multiple namespaces.
1170 Examples:
1172   Namespace "s" "http://schemas.xmlsoap.org/soap/envelope/"
1173   Namespace "m" "http://www.w3.org/1998/Math/MathML"
1175 =item B<User> I<User>
1177 =item B<Password> I<Password>
1179 =item B<VerifyPeer> B<true>|B<false>
1181 =item B<VerifyHost> B<true>|B<false>
1183 =item B<CACert> I<CA Cert File>
1185 =item B<Header> I<Header>
1187 =item B<Post> I<Body>
1189 These options behave exactly equivalent to the appropriate options of the
1190 I<cURL plugin>. Please see there for a detailed description.
1192 =item E<lt>B<XPath> I<XPath-expression>E<gt>
1194 Within each B<URL> block, there must be one or more B<XPath> blocks. Each
1195 B<XPath> block specifies how to get one type of information. The string
1196 argument must be a valid XPath expression which returns a list of "base
1197 elements". One value is dispatched for each "base element".
1199 Within the B<XPath> block the following options are accepted:
1201 =over 4
1203 =item B<Type> I<Type>
1205 Specifies the I<Type> used for submitting patches. This determines the number
1206 of values that are required / expected and whether the strings are parsed as
1207 signed or unsigned integer or as double values. See L<types.db(5)> for details.
1208 This option is required.
1210 =item B<InstancePrefix> I<InstancePrefix>
1212 Prefix the I<type instance> with I<InstancePrefix>. The values are simply
1213 concatenated together without any separator.
1214 This option is optional.
1216 =item B<InstanceFrom> I<InstanceFrom>
1218 Specifies a XPath expression to use for determining the I<type instance>. The
1219 XPath expression must return exactly one element. The element's value is then
1220 used as I<type instance>, possibly prefixed with I<InstancePrefix> (see above).
1222 This value is required. As a special exception, if the "base XPath expression"
1223 (the argument to the B<XPath> block) returns exactly one argument, then this
1224 option may be omitted.
1226 =item B<ValuesFrom> I<ValuesFrom> [I<ValuesFrom> ...]
1228 Specifies one or more XPath expression to use for reading the values. The
1229 number of XPath expressions must match the number of data sources in the
1230 I<type> specified with B<Type> (see above). Each XPath expression must return
1231 exactly one element. The element's value is then parsed as a number and used as
1232 value for the appropriate value in the value list dispatched to the daemon.
1234 =back
1236 =back
1238 =head2 Plugin C<dbi>
1240 This plugin uses the B<dbi> library (L<http://libdbi.sourceforge.net/>) to
1241 connect to various databases, execute I<SQL> statements and read back the
1242 results. I<dbi> is an acronym for "database interface" in case you were
1243 wondering about the name. You can configure how each column is to be
1244 interpreted and the plugin will generate one or more data sets from each row
1245 returned according to these rules.
1247 Because the plugin is very generic, the configuration is a little more complex
1248 than those of other plugins. It usually looks something like this:
1250   <Plugin dbi>
1251     <Query "out_of_stock">
1252       Statement "SELECT category, COUNT(*) AS value FROM products WHERE in_stock = 0 GROUP BY category"
1253       # Use with MySQL 5.0.0 or later
1254       MinVersion 50000
1255       <Result>
1256         Type "gauge"
1257         InstancePrefix "out_of_stock"
1258         InstancesFrom "category"
1259         ValuesFrom "value"
1260       </Result>
1261     </Query>
1262     <Database "product_information">
1263       Driver "mysql"
1264       DriverOption "host" "localhost"
1265       DriverOption "username" "collectd"
1266       DriverOption "password" "aZo6daiw"
1267       DriverOption "dbname" "prod_info"
1268       SelectDB "prod_info"
1269       Query "out_of_stock"
1270     </Database>
1271   </Plugin>
1273 The configuration above defines one query with one result and one database. The
1274 query is then linked to the database with the B<Query> option I<within> the
1275 B<E<lt>DatabaseE<gt>> block. You can have any number of queries and databases
1276 and you can also use the B<Include> statement to split up the configuration
1277 file in multiple, smaller files. However, the B<E<lt>QueryE<gt>> block I<must>
1278 precede the B<E<lt>DatabaseE<gt>> blocks, because the file is interpreted from
1279 top to bottom!
1281 The following is a complete list of options:
1283 =head3 B<Query> blocks
1285 Query blocks define I<SQL> statements and how the returned data should be
1286 interpreted. They are identified by the name that is given in the opening line
1287 of the block. Thus the name needs to be unique. Other than that, the name is
1288 not used in collectd.
1290 In each B<Query> block, there is one or more B<Result> blocks. B<Result> blocks
1291 define which column holds which value or instance information. You can use
1292 multiple B<Result> blocks to create multiple values from one returned row. This
1293 is especially useful, when queries take a long time and sending almost the same
1294 query again and again is not desirable.
1296 Example:
1298   <Query "environment">
1299     Statement "select station, temperature, humidity from environment"
1300     <Result>
1301       Type "temperature"
1302       # InstancePrefix "foo"
1303       InstancesFrom "station"
1304       ValuesFrom "temperature"
1305     </Result>
1306     <Result>
1307       Type "humidity"
1308       InstancesFrom "station"
1309       ValuesFrom "humidity"
1310     </Result>
1311   </Query>
1313 The following options are accepted:
1315 =over 4
1317 =item B<Statement> I<SQL>
1319 Sets the statement that should be executed on the server. This is B<not>
1320 interpreted by collectd, but simply passed to the database server. Therefore,
1321 the SQL dialect that's used depends on the server collectd is connected to.
1323 The query has to return at least two columns, one for the instance and one
1324 value. You cannot omit the instance, even if the statement is guaranteed to
1325 always return exactly one line. In that case, you can usually specify something
1326 like this:
1328   Statement "SELECT \"instance\", COUNT(*) AS value FROM table"
1330 (That works with MySQL but may not be valid SQL according to the spec. If you
1331 use a more strict database server, you may have to select from a dummy table or
1332 something.)
1334 Please note that some databases, for example B<Oracle>, will fail if you
1335 include a semicolon at the end of the statement.
1337 =item B<MinVersion> I<Version>
1339 =item B<MaxVersion> I<Value>
1341 Only use this query for the specified database version. You can use these
1342 options to provide multiple queries with the same name but with a slightly
1343 different syntax. The plugin will use only those queries, where the specified
1344 minimum and maximum versions fit the version of the database in use.
1346 The database version is determined by C<dbi_conn_get_engine_version>, see the
1347 L<libdbi documentation|http://libdbi.sourceforge.net/docs/programmers-guide/reference-conn.html#DBI-CONN-GET-ENGINE-VERSION>
1348 for details. Basically, each part of the version is assumed to be in the range
1349 from B<00> to B<99> and all dots are removed. So version "4.1.2" becomes
1350 "40102", version "5.0.42" becomes "50042".
1352 B<Warning:> The plugin will use B<all> matching queries, so if you specify
1353 multiple queries with the same name and B<overlapping> ranges, weird stuff will
1354 happen. Don't to it! A valid example would be something along these lines:
1356   MinVersion 40000
1357   MaxVersion 49999
1358   ...
1359   MinVersion 50000
1360   MaxVersion 50099
1361   ...
1362   MinVersion 50100
1363   # No maximum
1365 In the above example, there are three ranges that don't overlap. The last one
1366 goes from version "5.1.0" to infinity, meaning "all later versions". Versions
1367 before "4.0.0" are not specified.
1369 =item B<Type> I<Type>
1371 The B<type> that's used for each line returned. See L<types.db(5)> for more
1372 details on how types are defined. In short: A type is a predefined layout of
1373 data and the number of values and type of values has to match the type
1374 definition.
1376 If you specify "temperature" here, you need exactly one gauge column. If you
1377 specify "if_octets", you will need two counter columns. See the B<ValuesFrom>
1378 setting below.
1380 There must be exactly one B<Type> option inside each B<Result> block.
1382 =item B<InstancePrefix> I<prefix>
1384 Prepends I<prefix> to the type instance. If B<InstancesFrom> (see below) is not
1385 given, the string is simply copied. If B<InstancesFrom> is given, I<prefix> and
1386 all strings returned in the appropriate columns are concatenated together,
1387 separated by dashes I<("-")>.
1389 =item B<InstancesFrom> I<column0> [I<column1> ...]
1391 Specifies the columns whose values will be used to create the "type-instance"
1392 for each row. If you specify more than one column, the value of all columns
1393 will be joined together with dashes I<("-")> as separation characters.
1395 The plugin itself does not check whether or not all built instances are
1396 different. It's your responsibility to assure that each is unique. This is
1397 especially true, if you do not specify B<InstancesFrom>: B<You> have to make
1398 sure that only one row is returned in this case.
1400 If neither B<InstancePrefix> nor B<InstancesFrom> is given, the type-instance
1401 will be empty.
1403 =item B<ValuesFrom> I<column0> [I<column1> ...]
1405 Names the columns whose content is used as the actual data for the data sets
1406 that are dispatched to the daemon. How many such columns you need is determined
1407 by the B<Type> setting above. If you specify too many or not enough columns,
1408 the plugin will complain about that and no data will be submitted to the
1409 daemon.
1411 The actual data type in the columns is not that important. The plugin will
1412 automatically cast the values to the right type if it know how to do that. So
1413 it should be able to handle integer an floating point types, as well as strings
1414 (if they include a number at the beginning).
1416 There must be at least one B<ValuesFrom> option inside each B<Result> block.
1418 =back
1420 =head3 B<Database> blocks
1422 Database blocks define a connection to a database and which queries should be
1423 sent to that database. Since the used "dbi" library can handle a wide variety
1424 of databases, the configuration is very generic. If in doubt, refer to libdbi's
1425 documentationE<nbsp>- we stick as close to the terminology used there.
1427 Each database needs a "name" as string argument in the starting tag of the
1428 block. This name will be used as "PluginInstance" in the values submitted to
1429 the daemon. Other than that, that name is not used.
1431 =over 4
1433 =item B<Driver> I<Driver>
1435 Specifies the driver to use to connect to the database. In many cases those
1436 drivers are named after the database they can connect to, but this is not a
1437 technical necessity. These drivers are sometimes referred to as "DBD",
1438 B<D>ataB<B>ase B<D>river, and some distributions ship them in separate
1439 packages. Drivers for the "dbi" library are developed by the B<libdbi-drivers>
1440 project at L<http://libdbi-drivers.sourceforge.net/>.
1442 You need to give the driver name as expected by the "dbi" library here. You
1443 should be able to find that in the documentation for each driver. If you
1444 mistype the driver name, the plugin will dump a list of all known driver names
1445 to the log.
1447 =item B<DriverOption> I<Key> I<Value>
1449 Sets driver-specific options. What option a driver supports can be found in the
1450 documentation for each driver, somewhere at
1451 L<http://libdbi-drivers.sourceforge.net/>. However, the options "host",
1452 "username", "password", and "dbname" seem to be deE<nbsp>facto standards.
1454 DBDs can register two types of options: String options and numeric options. The
1455 plugin will use the C<dbi_conn_set_option> function when the configuration
1456 provides a string and the C<dbi_conn_require_option_numeric> function when the
1457 configuration provides a number. So these two lines will actually result in
1458 different calls being used:
1460   DriverOption "Port" 1234      # numeric
1461   DriverOption "Port" "1234"    # string
1463 Unfortunately, drivers are not too keen to report errors when an unknown option
1464 is passed to them, so invalid settings here may go unnoticed. This is not the
1465 plugin's fault, it will report errors if it gets them from the libraryE<nbsp>/
1466 the driver. If a driver complains about an option, the plugin will dump a
1467 complete list of all options understood by that driver to the log. There is no
1468 way to programatically find out if an option expects a string or a numeric
1469 argument, so you will have to refer to the appropriate DBD's documentation to
1470 find this out. Sorry.
1472 =item B<SelectDB> I<Database>
1474 In some cases, the database name you connect with is not the database name you
1475 want to use for querying data. If this option is set, the plugin will "select"
1476 (switch to) that database after the connection is established.
1478 =item B<Query> I<QueryName>
1480 Associates the query named I<QueryName> with this database connection. The
1481 query needs to be defined I<before> this statement, i.E<nbsp>e. all query
1482 blocks you want to refer to must be placed above the database block you want to
1483 refer to them from.
1485 =item B<Host> I<Hostname>
1487 Sets the B<host> field of I<value lists> to I<Hostname> when dispatching
1488 values. Defaults to the global hostname setting.
1490 =back
1492 =head2 Plugin C<df>
1494 =over 4
1496 =item B<Device> I<Device>
1498 Select partitions based on the devicename.
1500 =item B<MountPoint> I<Directory>
1502 Select partitions based on the mountpoint.
1504 =item B<FSType> I<FSType>
1506 Select partitions based on the filesystem type.
1508 =item B<IgnoreSelected> B<true>|B<false>
1510 Invert the selection: If set to true, all partitions B<except> the ones that
1511 match any one of the criteria are collected. By default only selected
1512 partitions are collected if a selection is made. If no selection is configured
1513 at all, B<all> partitions are selected.
1515 =item B<ReportByDevice> B<true>|B<false>
1517 Report using the device name rather than the mountpoint. i.e. with this I<false>,
1518 (the default), it will report a disk as "root", but with it I<true>, it will be
1519 "sda1" (or whichever).
1521 =item B<ReportInodes> B<true>|B<false>
1523 Enables or disables reporting of free, reserved and used inodes. Defaults to
1524 inode collection being disabled.
1526 Enable this option if inodes are a scarce resource for you, usually because
1527 many small files are stored on the disk. This is a usual scenario for mail
1528 transfer agents and web caches.
1530 =item B<ValuesAbsolute> B<true>|B<false>
1532 Enables or disables reporting of free, used and used disk space in 1K-blocks. 
1533 Defaults to true.
1535 =item B<ValuesPercentage> B<true>|B<false>
1537 Enables or disables reporting of free, used and used disk space in percentage.
1538 Defaults to false.
1540 This is useful for deploying collectd on the cloud, where machines with
1541 different disk size may exist. Then it is more practical to configure thresholds
1542 based on relative disk size.
1544 =back
1546 =head2 Plugin C<disk>
1548 The C<disk> plugin collects information about the usage of physical disks and
1549 logical disks (partitions). Values collected are the number of octets written
1550 to and read from a disk or partition, the number of read/write operations
1551 issued to the disk and a rather complex "time" it took for these commands to be
1552 issued.
1554 Using the following two options you can ignore some disks or configure the
1555 collection only of specific disks.
1557 =over 4
1559 =item B<Disk> I<Name>
1561 Select the disk I<Name>. Whether it is collected or ignored depends on the
1562 B<IgnoreSelected> setting, see below. As with other plugins that use the
1563 daemon's ignorelist functionality, a string that starts and ends with a slash
1564 is interpreted as a regular expression. Examples:
1566   Disk "sdd"
1567   Disk "/hda[34]/"
1569 =item B<IgnoreSelected> B<true>|B<false>
1571 Sets whether selected disks, i.E<nbsp>e. the ones matches by any of the B<Disk>
1572 statements, are ignored or if all other disks are ignored. The behavior
1573 (hopefully) is intuitive: If no B<Disk> option is configured, all disks are
1574 collected. If at least one B<Disk> option is given and no B<IgnoreSelected> or
1575 set to B<false>, B<only> matching disks will be collected. If B<IgnoreSelected>
1576 is set to B<true>, all disks are collected B<except> the ones matched.
1578 =back
1580 =head2 Plugin C<dns>
1582 =over 4
1584 =item B<Interface> I<Interface>
1586 The dns plugin uses B<libpcap> to capture dns traffic and analyzes it. This
1587 option sets the interface that should be used. If this option is not set, or
1588 set to "any", the plugin will try to get packets from B<all> interfaces. This
1589 may not work on certain platforms, such as MacE<nbsp>OSE<nbsp>X.
1591 =item B<IgnoreSource> I<IP-address>
1593 Ignore packets that originate from this address.
1595 =item B<SelectNumericQueryTypes> B<true>|B<false>
1597 Enabled by default, collects unknown (and thus presented as numeric only) query types.
1599 =back
1601 =head2 Plugin C<email>
1603 =over 4
1605 =item B<SocketFile> I<Path>
1607 Sets the socket-file which is to be created.
1609 =item B<SocketGroup> I<Group>
1611 If running as root change the group of the UNIX-socket after it has been
1612 created. Defaults to B<collectd>.
1614 =item B<SocketPerms> I<Permissions>
1616 Change the file permissions of the UNIX-socket after it has been created. The
1617 permissions must be given as a numeric, octal value as you would pass to
1618 L<chmod(1)>. Defaults to B<0770>.
1620 =item B<MaxConns> I<Number>
1622 Sets the maximum number of connections that can be handled in parallel. Since
1623 this many threads will be started immediately setting this to a very high
1624 value will waste valuable resources. Defaults to B<5> and will be forced to be
1625 at most B<16384> to prevent typos and dumb mistakes.
1627 =back
1629 =head2 Plugin C<ethstat>
1631 The I<ethstat plugin> collects information about network interface cards (NICs)
1632 by talking directly with the underlying kernel driver using L<ioctl(2)>.
1634 B<Synopsis:>
1636  <Plugin "ethstat">
1637    Interface "eth0"
1638    Map "rx_csum_offload_errors" "if_rx_errors" "checksum_offload"
1639    Map "multicast" "if_multicast"
1640  </Plugin>
1642 B<Options:>
1644 =over 4
1646 =item B<Interface> I<Name>
1648 Collect statistical information about interface I<Name>.
1650 =item B<Map> I<Name> I<Type> [I<TypeInstance>]
1652 By default, the plugin will submit values as type C<derive> and I<type
1653 instance> set to I<Name>, the name of the metric as reported by the driver. If
1654 an appropriate B<Map> option exists, the given I<Type> and, optionally,
1655 I<TypeInstance> will be used.
1657 =item B<MappedOnly> B<true>|B<false>
1659 When set to B<true>, only metrics that can be mapped to to a I<type> will be
1660 collected, all other metrics will be ignored. Defaults to B<false>.
1662 =back
1664 =head2 Plugin C<exec>
1666 Please make sure to read L<collectd-exec(5)> before using this plugin. It
1667 contains valuable information on when the executable is executed and the
1668 output that is expected from it.
1670 =over 4
1672 =item B<Exec> I<User>[:[I<Group>]] I<Executable> [I<E<lt>argE<gt>> [I<E<lt>argE<gt>> ...]]
1674 =item B<NotificationExec> I<User>[:[I<Group>]] I<Executable> [I<E<lt>argE<gt>> [I<E<lt>argE<gt>> ...]]
1676 Execute the executable I<Executable> as user I<User>. If the user name is
1677 followed by a colon and a group name, the effective group is set to that group.
1678 The real group and saved-set group will be set to the default group of that
1679 user. If no group is given the effective group ID will be the same as the real
1680 group ID.
1682 Please note that in order to change the user and/or group the daemon needs
1683 superuser privileges. If the daemon is run as an unprivileged user you must
1684 specify the same user/group here. If the daemon is run with superuser
1685 privileges, you must supply a non-root user here.
1687 The executable may be followed by optional arguments that are passed to the
1688 program. Please note that due to the configuration parsing numbers and boolean
1689 values may be changed. If you want to be absolutely sure that something is
1690 passed as-is please enclose it in quotes.
1692 The B<Exec> and B<NotificationExec> statements change the semantics of the
1693 programs executed, i.E<nbsp>e. the data passed to them and the response
1694 expected from them. This is documented in great detail in L<collectd-exec(5)>.
1696 =back
1698 =head2 Plugin C<filecount>
1700 The C<filecount> plugin counts the number of files in a certain directory (and
1701 its subdirectories) and their combined size. The configuration is very straight
1702 forward:
1704   <Plugin "filecount">
1705     <Directory "/var/qmail/queue/mess">
1706       Instance "qmail-message"
1707     </Directory>
1708     <Directory "/var/qmail/queue/todo">
1709       Instance "qmail-todo"
1710     </Directory>
1711     <Directory "/var/lib/php5">
1712       Instance "php5-sessions"
1713       Name "sess_*"
1714     </Directory>
1715   </Plugin>
1717 The example above counts the number of files in QMail's queue directories and
1718 the number of PHP5 sessions. Jfiy: The "todo" queue holds the messages that
1719 QMail has not yet looked at, the "message" queue holds the messages that were
1720 classified into "local" and "remote".
1722 As you can see, the configuration consists of one or more C<Directory> blocks,
1723 each of which specifies a directory in which to count the files. Within those
1724 blocks, the following options are recognized:
1726 =over 4
1728 =item B<Instance> I<Instance>
1730 Sets the plugin instance to I<Instance>. That instance name must be unique, but
1731 it's your responsibility, the plugin doesn't check for that. If not given, the
1732 instance is set to the directory name with all slashes replaced by underscores
1733 and all leading underscores removed.
1735 =item B<Name> I<Pattern>
1737 Only count files that match I<Pattern>, where I<Pattern> is a shell-like
1738 wildcard as understood by L<fnmatch(3)>. Only the B<filename> is checked
1739 against the pattern, not the entire path. In case this makes it easier for you:
1740 This option has been named after the B<-name> parameter to L<find(1)>.
1742 =item B<MTime> I<Age>
1744 Count only files of a specific age: If I<Age> is greater than zero, only files
1745 that haven't been touched in the last I<Age> seconds are counted. If I<Age> is
1746 a negative number, this is inversed. For example, if B<-60> is specified, only
1747 files that have been modified in the last minute will be counted.
1749 The number can also be followed by a "multiplier" to easily specify a larger
1750 timespan. When given in this notation, the argument must in quoted, i.E<nbsp>e.
1751 must be passed as string. So the B<-60> could also be written as B<"-1m"> (one
1752 minute). Valid multipliers are C<s> (second), C<m> (minute), C<h> (hour), C<d>
1753 (day), C<w> (week), and C<y> (year). There is no "month" multiplier. You can
1754 also specify fractional numbers, e.E<nbsp>g. B<"0.5d"> is identical to
1755 B<"12h">.
1757 =item B<Size> I<Size>
1759 Count only files of a specific size. When I<Size> is a positive number, only
1760 files that are at least this big are counted. If I<Size> is a negative number,
1761 this is inversed, i.E<nbsp>e. only files smaller than the absolute value of
1762 I<Size> are counted.
1764 As with the B<MTime> option, a "multiplier" may be added. For a detailed
1765 description see above. Valid multipliers here are C<b> (byte), C<k> (kilobyte),
1766 C<m> (megabyte), C<g> (gigabyte), C<t> (terabyte), and C<p> (petabyte). Please
1767 note that there are 1000 bytes in a kilobyte, not 1024.
1769 =item B<Recursive> I<true>|I<false>
1771 Controls whether or not to recurse into subdirectories. Enabled by default.
1773 =item B<IncludeHidden> I<true>|I<false>
1775 Controls whether or not to include "hidden" files and directories in the count.
1776 "Hidden" files and directories are those, whose name begins with a dot.
1777 Defaults to I<false>, i.e. by default hidden files and directories are ignored.
1779 =back
1781 =head2 Plugin C<GenericJMX>
1783 The I<GenericJMX plugin> is written in I<Java> and therefore documented in
1784 L<collectd-java(5)>.
1786 =head2 Plugin C<gmond>
1788 The I<gmond> plugin received the multicast traffic sent by B<gmond>, the
1789 statistics collection daemon of Ganglia. Mappings for the standard "metrics"
1790 are built-in, custom mappings may be added via B<Metric> blocks, see below.
1792 Synopsis:
1794  <Plugin "gmond">
1795    MCReceiveFrom "239.2.11.71" "8649"
1796    <Metric "swap_total">
1797      Type "swap"
1798      TypeInstance "total"
1799      DataSource "value"
1800    </Metric>
1801    <Metric "swap_free">
1802      Type "swap"
1803      TypeInstance "free"
1804      DataSource "value"
1805    </Metric>
1806  </Plugin>
1808 The following metrics are built-in:
1810 =over 4
1812 =item *
1814 load_one, load_five, load_fifteen
1816 =item *
1818 cpu_user, cpu_system, cpu_idle, cpu_nice, cpu_wio
1820 =item *
1822 mem_free, mem_shared, mem_buffers, mem_cached, mem_total
1824 =item *
1826 bytes_in, bytes_out
1828 =item *
1830 pkts_in, pkts_out
1832 =back
1834 Available configuration options:
1836 =over 4
1838 =item B<MCReceiveFrom> I<MCGroup> [I<Port>]
1840 Sets sets the multicast group and UDP port to which to subscribe.
1842 Default: B<239.2.11.71>E<nbsp>/E<nbsp>B<8649>
1844 =item E<lt>B<Metric> I<Name>E<gt>
1846 These blocks add a new metric conversion to the internal table. I<Name>, the
1847 string argument to the B<Metric> block, is the metric name as used by Ganglia.
1849 =over 4
1851 =item B<Type> I<Type>
1853 Type to map this metric to. Required.
1855 =item B<TypeInstance> I<Instance>
1857 Type-instance to use. Optional.
1859 =item B<DataSource> I<Name>
1861 Data source to map this metric to. If the configured type has exactly one data
1862 source, this is optional. Otherwise the option is required.
1864 =back
1866 =back
1868 =head2 Plugin C<hddtemp>
1870 To get values from B<hddtemp> collectd connects to B<localhost> (127.0.0.1),
1871 port B<7634/tcp>. The B<Host> and B<Port> options can be used to change these
1872 default values, see below. C<hddtemp> has to be running to work correctly. If
1873 C<hddtemp> is not running timeouts may appear which may interfere with other
1874 statistics..
1876 The B<hddtemp> homepage can be found at
1877 L<http://www.guzu.net/linux/hddtemp.php>.
1879 =over 4
1881 =item B<Host> I<Hostname>
1883 Hostname to connect to. Defaults to B<127.0.0.1>.
1885 =item B<Port> I<Port>
1887 TCP-Port to connect to. Defaults to B<7634>.
1889 =back
1891 =head2 Plugin C<interface>
1893 =over 4
1895 =item B<Interface> I<Interface>
1897 Select this interface. By default these interfaces will then be collected. For
1898 a more detailed description see B<IgnoreSelected> below.
1900 =item B<IgnoreSelected> I<true>|I<false>
1902 If no configuration if given, the B<traffic>-plugin will collect data from
1903 all interfaces. This may not be practical, especially for loopback- and
1904 similar interfaces. Thus, you can use the B<Interface>-option to pick the
1905 interfaces you're interested in. Sometimes, however, it's easier/preferred
1906 to collect all interfaces I<except> a few ones. This option enables you to
1907 do that: By setting B<IgnoreSelected> to I<true> the effect of
1908 B<Interface> is inverted: All selected interfaces are ignored and all
1909 other interfaces are collected.
1911 =back
1913 =head2 Plugin C<ipmi>
1915 =over 4
1917 =item B<Sensor> I<Sensor>
1919 Selects sensors to collect or to ignore, depending on B<IgnoreSelected>.
1921 =item B<IgnoreSelected> I<true>|I<false>
1923 If no configuration if given, the B<ipmi> plugin will collect data from all
1924 sensors found of type "temperature", "voltage", "current" and "fanspeed".
1925 This option enables you to do that: By setting B<IgnoreSelected> to I<true>
1926 the effect of B<Sensor> is inverted: All selected sensors are ignored and
1927 all other sensors are collected.
1929 =item B<NotifySensorAdd> I<true>|I<false>
1931 If a sensor appears after initialization time of a minute a notification
1932 is sent.
1934 =item B<NotifySensorRemove> I<true>|I<false>
1936 If a sensor disappears a notification is sent.
1938 =item B<NotifySensorNotPresent> I<true>|I<false>
1940 If you have for example dual power supply and one of them is (un)plugged then
1941 a notification is sent.
1943 =back
1945 =head2 Plugin C<iptables>
1947 =over 4
1949 =item B<Chain> I<Table> I<Chain> [I<Comment|Number> [I<Name>]]
1951 Select the rules to count. If only I<Table> and I<Chain> are given, this plugin
1952 will collect the counters of all rules which have a comment-match. The comment
1953 is then used as type-instance.
1955 If I<Comment> or I<Number> is given, only the rule with the matching comment or
1956 the I<n>th rule will be collected. Again, the comment (or the number) will be
1957 used as the type-instance.
1959 If I<Name> is supplied, it will be used as the type-instance instead of the
1960 comment or the number.
1962 =back
1964 =head2 Plugin C<irq>
1966 =over 4
1968 =item B<Irq> I<Irq>
1970 Select this irq. By default these irqs will then be collected. For a more
1971 detailed description see B<IgnoreSelected> below.
1973 =item B<IgnoreSelected> I<true>|I<false>
1975 If no configuration if given, the B<irq>-plugin will collect data from all
1976 irqs. This may not be practical, especially if no interrupts happen. Thus, you
1977 can use the B<Irq>-option to pick the interrupt you're interested in.
1978 Sometimes, however, it's easier/preferred to collect all interrupts I<except> a
1979 few ones. This option enables you to do that: By setting B<IgnoreSelected> to
1980 I<true> the effect of B<Irq> is inverted: All selected interrupts are ignored
1981 and all other interrupts are collected.
1983 =back
1985 =head2 Plugin C<java>
1987 The I<Java> plugin makes it possible to write extensions for collectd in Java.
1988 This section only discusses the syntax and semantic of the configuration
1989 options. For more in-depth information on the I<Java> plugin, please read
1990 L<collectd-java(5)>.
1992 Synopsis:
1994  <Plugin "java">
1995    JVMArg "-verbose:jni"
1996    JVMArg "-Djava.class.path=/opt/collectd/lib/collectd/bindings/java"
1997    LoadPlugin "org.collectd.java.Foobar"
1998    <Plugin "org.collectd.java.Foobar">
1999      # To be parsed by the plugin
2000    </Plugin>
2001  </Plugin>
2003 Available configuration options:
2005 =over 4
2007 =item B<JVMArg> I<Argument>
2009 Argument that is to be passed to the I<Java Virtual Machine> (JVM). This works
2010 exactly the way the arguments to the I<java> binary on the command line work.
2011 Execute C<javaE<nbsp>--help> for details.
2013 Please note that B<all> these options must appear B<before> (i.E<nbsp>e. above)
2014 any other options! When another option is found, the JVM will be started and
2015 later options will have to be ignored!
2017 =item B<LoadPlugin> I<JavaClass>
2019 Instantiates a new I<JavaClass> object. The constructor of this object very
2020 likely then registers one or more callback methods with the server.
2022 See L<collectd-java(5)> for details.
2024 When the first such option is found, the virtual machine (JVM) is created. This
2025 means that all B<JVMArg> options must appear before (i.E<nbsp>e. above) all
2026 B<LoadPlugin> options!
2028 =item B<Plugin> I<Name>
2030 The entire block is passed to the Java plugin as an
2031 I<org.collectd.api.OConfigItem> object.
2033 For this to work, the plugin has to register a configuration callback first,
2034 see L<collectd-java(5)/"config callback">. This means, that the B<Plugin> block
2035 must appear after the appropriate B<LoadPlugin> block. Also note, that I<Name>
2036 depends on the (Java) plugin registering the callback and is completely
2037 independent from the I<JavaClass> argument passed to B<LoadPlugin>.
2039 =back
2041 =head2 Plugin C<libvirt>
2043 This plugin allows CPU, disk and network load to be collected for virtualized
2044 guests on the machine. This means that these characteristics can be collected
2045 for guest systems without installing any software on them - collectd only runs
2046 on the hosting system. The statistics are collected through libvirt
2047 (L<http://libvirt.org/>).
2049 Only I<Connection> is required.
2051 =over 4
2053 =item B<Connection> I<uri>
2055 Connect to the hypervisor given by I<uri>. For example if using Xen use:
2057  Connection "xen:///"
2059 Details which URIs allowed are given at L<http://libvirt.org/uri.html>.
2061 =item B<RefreshInterval> I<seconds>
2063 Refresh the list of domains and devices every I<seconds>. The default is 60
2064 seconds. Setting this to be the same or smaller than the I<Interval> will cause
2065 the list of domains and devices to be refreshed on every iteration.
2067 Refreshing the devices in particular is quite a costly operation, so if your
2068 virtualization setup is static you might consider increasing this. If this
2069 option is set to 0, refreshing is disabled completely.
2071 =item B<Domain> I<name>
2073 =item B<BlockDevice> I<name:dev>
2075 =item B<InterfaceDevice> I<name:dev>
2077 =item B<IgnoreSelected> I<true>|I<false>
2079 Select which domains and devices are collected.
2081 If I<IgnoreSelected> is not given or I<false> then only the listed domains and
2082 disk/network devices are collected.
2084 If I<IgnoreSelected> is I<true> then the test is reversed and the listed
2085 domains and disk/network devices are ignored, while the rest are collected.
2087 The domain name and device names may use a regular expression, if the name is
2088 surrounded by I</.../> and collectd was compiled with support for regexps.
2090 The default is to collect statistics for all domains and all their devices.
2092 Example:
2094  BlockDevice "/:hdb/"
2095  IgnoreSelected "true"
2097 Ignore all I<hdb> devices on any domain, but other block devices (eg. I<hda>)
2098 will be collected.
2100 =item B<HostnameFormat> B<name|uuid|hostname|...>
2102 When the libvirt plugin logs data, it sets the hostname of the collected data
2103 according to this setting. The default is to use the guest name as provided by
2104 the hypervisor, which is equal to setting B<name>.
2106 B<uuid> means use the guest's UUID. This is useful if you want to track the
2107 same guest across migrations.
2109 B<hostname> means to use the global B<Hostname> setting, which is probably not
2110 useful on its own because all guests will appear to have the same name.
2112 You can also specify combinations of these fields. For example B<name uuid>
2113 means to concatenate the guest name and UUID (with a literal colon character
2114 between, thus I<"foo:1234-1234-1234-1234">).
2116 =item B<InterfaceFormat> B<name>|B<address>
2118 When the libvirt plugin logs interface data, it sets the name of the collected
2119 data according to this setting. The default is to use the path as provided by
2120 the hypervisor (the "dev" property of the target node), which is equal to
2121 setting B<name>.
2123 B<address> means use the interface's mac address. This is useful since the
2124 interface path might change between reboots of a guest or across migrations.
2126 =back
2128 =head2 Plugin C<logfile>
2130 =over 4
2132 =item B<LogLevel> B<debug|info|notice|warning|err>
2134 Sets the log-level. If, for example, set to B<notice>, then all events with
2135 severity B<notice>, B<warning>, or B<err> will be written to the logfile.
2137 Please note that B<debug> is only available if collectd has been compiled with
2138 debugging support.
2140 =item B<File> I<File>
2142 Sets the file to write log messages to. The special strings B<stdout> and
2143 B<stderr> can be used to write to the standard output and standard error
2144 channels, respectively. This, of course, only makes much sense when I<collectd>
2145 is running in foreground- or non-daemon-mode.
2147 =item B<Timestamp> B<true>|B<false>
2149 Prefix all lines printed by the current time. Defaults to B<true>.
2151 =item B<PrintSeverity> B<true>|B<false>
2153 When enabled, all lines are prefixed by the severity of the log message, for
2154 example "warning". Defaults to B<false>.
2156 =back
2158 B<Note>: There is no need to notify the daemon after moving or removing the
2159 log file (e.E<nbsp>g. when rotating the logs). The plugin reopens the file
2160 for each line it writes.
2162 =head2 Plugin C<lpar>
2164 The I<LPAR plugin> reads CPU statistics of I<Logical Partitions>, a
2165 virtualization technique for IBM POWER processors. It takes into account CPU
2166 time stolen from or donated to a partition, in addition to the usual user,
2167 system, I/O statistics.
2169 The following configuration options are available:
2171 =over 4
2173 =item B<CpuPoolStats> B<false>|B<true>
2175 When enabled, statistics about the processor pool are read, too. The partition
2176 needs to have pool authority in order to be able to acquire this information.
2177 Defaults to false.
2179 =item B<ReportBySerial> B<false>|B<true>
2181 If enabled, the serial of the physical machine the partition is currently
2182 running on is reported as I<hostname> and the logical hostname of the machine
2183 is reported in the I<plugin instance>. Otherwise, the logical hostname will be
2184 used (just like other plugins) and the I<plugin instance> will be empty.
2185 Defaults to false.
2187 =back
2189 =head2 Plugin C<mbmon>
2191 The C<mbmon plugin> uses mbmon to retrieve temperature, voltage, etc.
2193 Be default collectd connects to B<localhost> (127.0.0.1), port B<411/tcp>. The
2194 B<Host> and B<Port> options can be used to change these values, see below.
2195 C<mbmon> has to be running to work correctly. If C<mbmon> is not running
2196 timeouts may appear which may interfere with other statistics..
2198 C<mbmon> must be run with the -r option ("print TAG and Value format");
2199 Debian's F</etc/init.d/mbmon> script already does this, other people
2200 will need to ensure that this is the case.
2202 =over 4
2204 =item B<Host> I<Hostname>
2206 Hostname to connect to. Defaults to B<127.0.0.1>.
2208 =item B<Port> I<Port>
2210 TCP-Port to connect to. Defaults to B<411>.
2212 =back
2214 =head2 Plugin C<md>
2216 The C<md plugin> collects information from Linux Software-RAID devices (md).
2218 All reported values are of the type C<md_disks>. Reported type instances are
2219 I<active>, I<failed> (present but not operational), I<spare> (hot stand-by) and
2220 I<missing> (physically absent) disks.
2222 =over 4
2224 =item B<Device> I<Device>
2226 Select md devices based on device name. The I<device name> is the basename of
2227 the device, i.e. the name of the block device without the leading C</dev/>.
2228 See B<IgnoreSelected> for more details.
2230 =item B<IgnoreSelected> B<true>|B<false>
2232 Invert device selection: If set to B<true>, all md devices B<except> those
2233 listed using B<Device> are collected. If B<false> (the default), only those
2234 listed are collected. If no configuration is given, the B<md> plugin will
2235 collect data from all md devices.
2237 =back
2239 =head2 Plugin C<memcachec>
2241 The C<memcachec plugin> connects to a memcached server, queries one or more
2242 given I<pages> and parses the returned data according to user specification.
2243 The I<matches> used are the same as the matches used in the C<curl> and C<tail>
2244 plugins.
2246 In order to talk to the memcached server, this plugin uses the I<libmemcached>
2247 library. Please note that there is another library with a very similar name,
2248 libmemcache (notice the missing `d'), which is not applicable.
2250 Synopsis of the configuration:
2252  <Plugin "memcachec">
2253    <Page "plugin_instance">
2254      Server "localhost"
2255      Key "page_key"
2256      <Match>
2257        Regex "(\\d+) bytes sent"
2258        DSType CounterAdd
2259        Type "ipt_octets"
2260        Instance "type_instance"
2261      </Match>
2262    </Page>
2263  </Plugin>
2265 The configuration options are:
2267 =over 4
2269 =item E<lt>B<Page> I<Name>E<gt>
2271 Each B<Page> block defines one I<page> to be queried from the memcached server.
2272 The block requires one string argument which is used as I<plugin instance>.
2274 =item B<Server> I<Address>
2276 Sets the server address to connect to when querying the page. Must be inside a
2277 B<Page> block.
2279 =item B<Key> I<Key>
2281 When connected to the memcached server, asks for the page I<Key>.
2283 =item E<lt>B<Match>E<gt>
2285 Match blocks define which strings to look for and how matches substrings are
2286 interpreted. For a description of match blocks, please see L<"Plugin tail">.
2288 =back
2290 =head2 Plugin C<memcached>
2292 The B<memcached plugin> connects to a memcached server and queries statistics
2293 about cache utilization, memory and bandwidth used.
2294 L<http://www.danga.com/memcached/>
2296  <Plugin "memcached">
2297    <Instance "name">
2298      Host "memcache.example.com"
2299      Port 11211
2300    </Instance>
2301  </Plugin>
2303 The plugin configuration consists of one or more B<Instance> blocks which
2304 specify one I<memcached> connection each. Within the B<Instance> blocks, the
2305 following options are allowed:
2307 =over 4
2309 =item B<Host> I<Hostname>
2311 Hostname to connect to. Defaults to B<127.0.0.1>.
2313 =item B<Port> I<Port>
2315 TCP-Port to connect to. Defaults to B<11211>.
2317 =item B<Socket> I<Path>
2319 Connect to I<memcached> using the UNIX domain socket at I<Path>. If this
2320 setting is given, the B<Host> and B<Port> settings are ignored.
2322 =back
2324 =head2 Plugin C<mic>
2326 The B<mic plugin> gathers CPU statistics, memory usage and temperatures from
2327 Intel's Many Integrated Core (MIC) systems.
2329 B<Synopsis:>
2331  <Plugin mic>
2332    ShowCPU true
2333    ShowCPUCores true
2334    ShowMemory true
2335    
2336    ShowTemperatures true
2337    Temperature vddg
2338    Temperature vddq
2339    IgnoreSelectedTemperature true
2341    ShowPower true
2342    Power total0
2343    Power total1
2344    IgnoreSelectedPower true   
2345  </Plugin>
2347 The following options are valid inside the B<PluginE<nbsp>mic> block:
2349 =over 4
2351 =item B<ShowCPU> B<true>|B<false>
2353 If enabled (the default) a sum of the CPU usage accross all cores is reported.
2355 =item B<ShowCPUCores> B<true>|B<false>
2357 If enabled (the default) per-core CPU usage is reported.
2359 =item B<ShowMemory> B<true>|B<false>
2361 If enabled (the default) the physical memory usage of the MIC system is
2362 reported.
2364 =item B<ShowTemperatures> B<true>|B<false>
2366 If enabled (the default) various temperatures of the MIC system are reported.
2368 =item B<Temperature> I<Name>
2370 This option controls which temperatures are being reported. Whether matching
2371 temperatures are being ignored or I<only> matching temperatures are reported
2372 depends on the B<IgnoreSelectedTemperature> setting below. By default I<all>
2373 temperatures are reported.
2375 =item B<IgnoreSelectedTemperature> B<false>|B<true>
2377 Controls the behavior of the B<Temperature> setting above. If set to B<false>
2378 (the default) only temperatures matching a B<Temperature> option are reported
2379 or, if no B<Temperature> option is specified, all temperatures are reported. If
2380 set to B<true>, matching temperatures are I<ignored> and all other temperatures
2381 are reported.
2383 Known temperature names are:
2385 =over 4
2387 =item die
2389 Die of the CPU
2391 =item devmem
2393 Device Memory
2395 =item fin
2397 Fan In
2399 =item fout
2401 Fan Out 
2403 =item vccp
2405 Voltage ccp
2407 =item vddg
2409 Voltage ddg
2411 =item vddq
2413 Voltage ddq
2415 =back
2417 =item B<ShowPower> B<true>|B<false>
2419 If enabled (the default) various temperatures of the MIC system are reported.
2421 =item B<Power> I<Name>
2423 This option controls which power readings are being reported. Whether matching
2424 power readings are being ignored or I<only> matching power readings are reported
2425 depends on the B<IgnoreSelectedPower> setting below. By default I<all>
2426 power readings are reported.
2428 =item B<IgnoreSelectedPower> B<false>|B<true>
2430 Controls the behavior of the B<Power> setting above. If set to B<false>
2431 (the default) only power readings matching a B<Power> option are reported
2432 or, if no B<Power> option is specified, all power readings are reported. If
2433 set to B<true>, matching power readings are I<ignored> and all other power readings
2434 are reported.
2436 Known power names are:
2438 =over 4
2440 =item total0
2442 Total power utilization averaged over Time Window 0 (uWatts). 
2444 =item total1
2446 Total power utilization averaged over Time Window 0 (uWatts). 
2448 =item inst
2450 Instantaneous power (uWatts).
2452 =item imax
2454 Max instantaneous power (uWatts). 
2456 =item pcie
2458 PCI-E connector power (uWatts). 
2460 =item c2x3
2462 2x3 connector power (uWatts). 
2464 =item c2x4
2466 2x4 connector power (uWatts). 
2468 =item vccp
2470 Core rail (uVolts). 
2472 =item vddg
2474 Uncore rail (uVolts). 
2476 =item vddq
2478 Memory subsystem rail (uVolts). 
2480 =back
2482 =back
2484 =head2 Plugin C<modbus>
2486 The B<modbus plugin> connects to a Modbus "slave" via Modbus/TCP and reads
2487 register values. It supports reading single registers (unsigned 16E<nbsp>bit
2488 values), large integer values (unsigned 32E<nbsp>bit values) and floating point
2489 values (two registers interpreted as IEEE floats in big endian notation).
2491 B<Synopsis:>
2493  <Data "voltage-input-1">
2494    RegisterBase 0
2495    RegisterType float
2496    Type voltage
2497    Instance "input-1"
2498  </Data>
2499  
2500  <Data "voltage-input-2">
2501    RegisterBase 2
2502    RegisterType float
2503    Type voltage
2504    Instance "input-2"
2505  </Data>
2506  
2507  <Host "modbus.example.com">
2508    Address "192.168.0.42"
2509    Port    "502"
2510    Interval 60
2511    
2512    <Slave 1>
2513      Instance "power-supply"
2514      Collect  "voltage-input-1"
2515      Collect  "voltage-input-2"
2516    </Slave>
2517  </Host>
2519 =over 4
2521 =item E<lt>B<Data> I<Name>E<gt> blocks
2523 Data blocks define a mapping between register numbers and the "types" used by
2524 I<collectd>.
2526 Within E<lt>DataE<nbsp>/E<gt> blocks, the following options are allowed:
2528 =over 4
2530 =item B<RegisterBase> I<Number>
2532 Configures the base register to read from the device. If the option
2533 B<RegisterType> has been set to B<Uint32> or B<Float>, this and the next
2534 register will be read (the register number is increased by one).
2536 =item B<RegisterType> B<Int16>|B<Int32>|B<Uint16>|B<Uint32>|B<Float>
2538 Specifies what kind of data is returned by the device. If the type is B<Int32>,
2539 B<Uint32> or B<Float>, two 16E<nbsp>bit registers will be read and the data is
2540 combined into one value. Defaults to B<Uint16>.
2542 =item B<Type> I<Type>
2544 Specifies the "type" (data set) to use when dispatching the value to
2545 I<collectd>. Currently, only data sets with exactly one data source are
2546 supported.
2548 =item B<Instance> I<Instance>
2550 Sets the type instance to use when dispatching the value to I<collectd>. If
2551 unset, an empty string (no type instance) is used.
2553 =back
2555 =item E<lt>B<Host> I<Name>E<gt> blocks
2557 Host blocks are used to specify to which hosts to connect and what data to read
2558 from their "slaves". The string argument I<Name> is used as hostname when
2559 dispatching the values to I<collectd>.
2561 Within E<lt>HostE<nbsp>/E<gt> blocks, the following options are allowed:
2563 =over 4
2565 =item B<Address> I<Hostname>
2567 Specifies the node name (the actual network address) used to connect to the
2568 host. This may be an IP address or a hostname. Please note that the used
2569 I<libmodbus> library only supports IPv4 at the moment.
2571 =item B<Port> I<Service>
2573 Specifies the port used to connect to the host. The port can either be given as
2574 a number or as a service name. Please note that the I<Service> argument must be
2575 a string, even if ports are given in their numerical form. Defaults to "502".
2577 =item B<Interval> I<Interval>
2579 Sets the interval (in seconds) in which the values will be collected from this
2580 host. By default the global B<Interval> setting will be used.
2582 =item E<lt>B<Slave> I<ID>E<gt>
2584 Over each TCP connection, multiple Modbus devices may be reached. The slave ID
2585 is used to specify which device should be addressed. For each device you want
2586 to query, one B<Slave> block must be given.
2588 Within E<lt>SlaveE<nbsp>/E<gt> blocks, the following options are allowed:
2590 =over 4
2592 =item B<Instance> I<Instance>
2594 Specify the plugin instance to use when dispatching the values to I<collectd>.
2595 By default "slave_I<ID>" is used.
2597 =item B<Collect> I<DataName>
2599 Specifies which data to retrieve from the device. I<DataName> must be the same
2600 string as the I<Name> argument passed to a B<Data> block. You can specify this
2601 option multiple times to collect more than one value from a slave. At least one
2602 B<Collect> option is mandatory.
2604 =back
2606 =back
2608 =back
2610 =head2 Plugin C<mysql>
2612 The C<mysql plugin> requires B<mysqlclient> to be installed. It connects to
2613 one or more databases when started and keeps the connection up as long as
2614 possible. When the connection is interrupted for whatever reason it will try
2615 to re-connect. The plugin will complain loudly in case anything goes wrong.
2617 This plugin issues the MySQL C<SHOW STATUS> / C<SHOW GLOBAL STATUS> command
2618 and collects information about MySQL network traffic, executed statements,
2619 requests, the query cache and threads by evaluating the
2620 C<Bytes_{received,sent}>, C<Com_*>, C<Handler_*>, C<Qcache_*> and C<Threads_*>
2621 return values. Please refer to the B<MySQL reference manual>, I<5.1.6. Server
2622 Status Variables> for an explanation of these values.
2624 Optionally, master and slave statistics may be collected in a MySQL
2625 replication setup. In that case, information about the synchronization state
2626 of the nodes are collected by evaluating the C<Position> return value of the
2627 C<SHOW MASTER STATUS> command and the C<Seconds_Behind_Master>,
2628 C<Read_Master_Log_Pos> and C<Exec_Master_Log_Pos> return values of the
2629 C<SHOW SLAVE STATUS> command. See the B<MySQL reference manual>,
2630 I<12.5.5.21 SHOW MASTER STATUS Syntax> and
2631 I<12.5.5.31 SHOW SLAVE STATUS Syntax> for details.
2633 Synopsis:
2635   <Plugin mysql>
2636     <Database foo>
2637       Host "hostname"
2638       User "username"
2639       Password "password"
2640       Port "3306"
2641       MasterStats true
2642     </Database>
2644     <Database bar>
2645       Host "localhost"
2646       Socket "/var/run/mysql/mysqld.sock"
2647       SlaveStats true
2648       SlaveNotifications true
2649     </Database>
2650   </Plugin>
2652 A B<Database> block defines one connection to a MySQL database. It accepts a
2653 single argument which specifies the name of the database. None of the other
2654 options are required. MySQL will use default values as documented in the
2655 section "mysql_real_connect()" in the B<MySQL reference manual>.
2657 =over 4
2659 =item B<Host> I<Hostname>
2661 Hostname of the database server. Defaults to B<localhost>.
2663 =item B<User> I<Username>
2665 Username to use when connecting to the database. The user does not have to be
2666 granted any privileges (which is synonym to granting the C<USAGE> privilege),
2667 unless you want to collectd replication statistics (see B<MasterStats> and
2668 B<SlaveStats> below). In this case, the user needs the C<REPLICATION CLIENT>
2669 (or C<SUPER>) privileges. Else, any existing MySQL user will do.
2671 =item B<Password> I<Password>
2673 Password needed to log into the database.
2675 =item B<Database> I<Database>
2677 Select this database. Defaults to I<no database> which is a perfectly reasonable
2678 option for what this plugin does.
2680 =item B<Port> I<Port>
2682 TCP-port to connect to. The port must be specified in its numeric form, but it
2683 must be passed as a string nonetheless. For example:
2685   Port "3306"
2687 If B<Host> is set to B<localhost> (the default), this setting has no effect.
2688 See the documentation for the C<mysql_real_connect> function for details.
2690 =item B<Socket> I<Socket>
2692 Specifies the path to the UNIX domain socket of the MySQL server. This option
2693 only has any effect, if B<Host> is set to B<localhost> (the default).
2694 Otherwise, use the B<Port> option above. See the documentation for the
2695 C<mysql_real_connect> function for details.
2697 =item B<MasterStats> I<true|false>
2699 =item B<SlaveStats> I<true|false>
2701 Enable the collection of master / slave statistics in a replication setup. In
2702 order to be able to get access to these statistics, the user needs special
2703 privileges. See the B<User> documentation above.
2705 =item B<SlaveNotifications> I<true|false>
2707 If enabled, the plugin sends a notification if the replication slave I/O and /
2708 or SQL threads are not running.
2710 =back
2712 =head2 Plugin C<netapp>
2714 The netapp plugin can collect various performance and capacity information
2715 from a NetApp filer using the NetApp API.
2717 Please note that NetApp has a wide line of products and a lot of different
2718 software versions for each of these products. This plugin was developed for a
2719 NetApp FAS3040 running OnTap 7.2.3P8 and tested on FAS2050 7.3.1.1L1,
2720 FAS3140 7.2.5.1 and FAS3020 7.2.4P9. It I<should> work for most combinations of
2721 model and software version but it is very hard to test this.
2722 If you have used this plugin with other models and/or software version, feel
2723 free to send us a mail to tell us about the results, even if it's just a short
2724 "It works".
2726 To collect these data collectd will log in to the NetApp via HTTP(S) and HTTP
2727 basic authentication.
2729 B<Do not use a regular user for this!> Create a special collectd user with just
2730 the minimum of capabilities needed. The user only needs the "login-http-admin"
2731 capability as well as a few more depending on which data will be collected.
2732 Required capabilities are documented below.
2734 =head3 Synopsis
2736  <Plugin "netapp">
2737    <Host "netapp1.example.com">
2738     Protocol      "https"
2739     Address       "10.0.0.1"
2740     Port          443
2741     User          "username"
2742     Password      "aef4Aebe"
2743     Interval      30
2744     
2745     <WAFL>
2746       Interval 30
2747       GetNameCache   true
2748       GetDirCache    true
2749       GetBufferCache true
2750       GetInodeCache  true
2751     </WAFL>
2752     
2753     <Disks>
2754       Interval 30
2755       GetBusy true
2756     </Disks>
2757     
2758     <VolumePerf>
2759       Interval 30
2760       GetIO      "volume0"
2761       IgnoreSelectedIO      false
2762       GetOps     "volume0"
2763       IgnoreSelectedOps     false
2764       GetLatency "volume0"
2765       IgnoreSelectedLatency false
2766     </VolumePerf>
2767     
2768     <VolumeUsage>
2769       Interval 30
2770       GetCapacity "vol0"
2771       GetCapacity "vol1"
2772       IgnoreSelectedCapacity false
2773       GetSnapshot "vol1"
2774       GetSnapshot "vol3"
2775       IgnoreSelectedSnapshot false
2776     </VolumeUsage>
2777     
2778     <Quota>
2779       Interval 60
2780     </Quota>
2781     
2782     <Snapvault>
2783       Interval 30
2784     </Snapvault>
2785     
2786     <System>
2787       Interval 30
2788       GetCPULoad     true
2789       GetInterfaces  true
2790       GetDiskOps     true
2791       GetDiskIO      true
2792     </System>
2794     <VFiler vfilerA>
2795       Interval 60
2797       SnapVault true
2798       # ...
2799     </VFiler>
2800    </Host>
2801  </Plugin>
2803 The netapp plugin accepts the following configuration options:
2805 =over 4
2807 =item B<Host> I<Name>
2809 A host block defines one NetApp filer. It will appear in collectd with the name
2810 you specify here which does not have to be its real name nor its hostname (see
2811 the B<Address> option below).
2813 =item B<VFiler> I<Name>
2815 A B<VFiler> block may only be used inside a host block. It accepts all the
2816 same options as the B<Host> block (except for cascaded B<VFiler> blocks) and
2817 will execute all NetApp API commands in the context of the specified
2818 VFiler(R). It will appear in collectd with the name you specify here which
2819 does not have to be its real name. The VFiler name may be specified using the
2820 B<VFilerName> option. If this is not specified, it will default to the name
2821 you specify here.
2823 The VFiler block inherits all connection related settings from the surrounding
2824 B<Host> block (which appear before the B<VFiler> block) but they may be
2825 overwritten inside the B<VFiler> block.
2827 This feature is useful, for example, when using a VFiler as SnapVault target
2828 (supported since OnTap 8.1). In that case, the SnapVault statistics are not
2829 available in the host filer (vfiler0) but only in the respective VFiler
2830 context.
2832 =item B<Protocol> B<httpd>|B<http>
2834 The protocol collectd will use to query this host.
2836 Optional
2838 Type: string
2840 Default: https
2842 Valid options: http, https
2844 =item B<Address> I<Address>
2846 The hostname or IP address of the host.
2848 Optional
2850 Type: string
2852 Default: The "host" block's name.
2854 =item B<Port> I<Port>
2856 The TCP port to connect to on the host.
2858 Optional
2860 Type: integer
2862 Default: 80 for protocol "http", 443 for protocol "https"
2864 =item B<User> I<User>
2866 =item B<Password> I<Password>
2868 The username and password to use to login to the NetApp.
2870 Mandatory
2872 Type: string
2874 =item B<VFilerName> I<Name>
2876 The name of the VFiler in which context to execute API commands. If not
2877 specified, the name provided to the B<VFiler> block will be used instead.
2879 Optional
2881 Type: string
2883 Default: name of the B<VFiler> block
2885 B<Note:> This option may only be used inside B<VFiler> blocks.
2887 =item B<Interval> I<Interval>
2889 B<TODO>
2891 =back
2893 The following options decide what kind of data will be collected. You can
2894 either use them as a block and fine tune various parameters inside this block,
2895 use them as a single statement to just accept all default values, or omit it to
2896 not collect any data.
2898 The following options are valid inside all blocks:
2900 =over 4
2902 =item B<Interval> I<Seconds>
2904 Collect the respective statistics every I<Seconds> seconds. Defaults to the
2905 host specific setting.
2907 =back
2909 =head3 The System block
2911 This will collect various performance data about the whole system.
2913 B<Note:> To get this data the collectd user needs the
2914 "api-perf-object-get-instances" capability.
2916 =over 4
2918 =item B<Interval> I<Seconds>
2920 Collect disk statistics every I<Seconds> seconds.
2922 =item B<GetCPULoad> B<true>|B<false>
2924 If you set this option to true the current CPU usage will be read. This will be
2925 the average usage between all CPUs in your NetApp without any information about
2926 individual CPUs.
2928 B<Note:> These are the same values that the NetApp CLI command "sysstat"
2929 returns in the "CPU" field.
2931 Optional
2933 Type: boolean
2935 Default: true
2937 Result: Two value lists of type "cpu", and type instances "idle" and "system".
2939 =item B<GetInterfaces> B<true>|B<false>
2941 If you set this option to true the current traffic of the network interfaces
2942 will be read. This will be the total traffic over all interfaces of your NetApp
2943 without any information about individual interfaces.
2945 B<Note:> This is the same values that the NetApp CLI command "sysstat" returns
2946 in the "Net kB/s" field.
2948 B<Or is it?>
2950 Optional
2952 Type: boolean
2954 Default: true
2956 Result: One value list of type "if_octects".
2958 =item B<GetDiskIO> B<true>|B<false>
2960 If you set this option to true the current IO throughput will be read. This
2961 will be the total IO of your NetApp without any information about individual
2962 disks, volumes or aggregates.
2964 B<Note:> This is the same values that the NetApp CLI command "sysstat" returns
2965 in the "DiskE<nbsp>kB/s" field.
2967 Optional
2969 Type: boolean
2971 Default: true
2973 Result: One value list of type "disk_octets".
2975 =item B<GetDiskOps> B<true>|B<false>
2977 If you set this option to true the current number of HTTP, NFS, CIFS, FCP,
2978 iSCSI, etc. operations will be read. This will be the total number of
2979 operations on your NetApp without any information about individual volumes or
2980 aggregates.
2982 B<Note:> These are the same values that the NetApp CLI command "sysstat"
2983 returns in the "NFS", "CIFS", "HTTP", "FCP" and "iSCSI" fields.
2985 Optional
2987 Type: boolean
2989 Default: true
2991 Result: A variable number of value lists of type "disk_ops_complex". Each type
2992 of operation will result in one value list with the name of the operation as
2993 type instance.
2995 =back
2997 =head3 The WAFL block
2999 This will collect various performance data about the WAFL file system. At the
3000 moment this just means cache performance.
3002 B<Note:> To get this data the collectd user needs the
3003 "api-perf-object-get-instances" capability.
3005 B<Note:> The interface to get these values is classified as "Diagnostics" by
3006 NetApp. This means that it is not guaranteed to be stable even between minor
3007 releases.
3009 =over 4
3011 =item B<Interval> I<Seconds>
3013 Collect disk statistics every I<Seconds> seconds.
3015 =item B<GetNameCache> B<true>|B<false>
3017 Optional
3019 Type: boolean
3021 Default: true
3023 Result: One value list of type "cache_ratio" and type instance
3024 "name_cache_hit".
3026 =item B<GetDirCache> B<true>|B<false>
3028 Optional
3030 Type: boolean
3032 Default: true
3034 Result: One value list of type "cache_ratio" and type instance "find_dir_hit".
3036 =item B<GetInodeCache> B<true>|B<false>
3038 Optional
3040 Type: boolean
3042 Default: true
3044 Result: One value list of type "cache_ratio" and type instance
3045 "inode_cache_hit".
3047 =item B<GetBufferCache> B<true>|B<false>
3049 B<Note:> This is the same value that the NetApp CLI command "sysstat" returns
3050 in the "Cache hit" field.
3052 Optional
3054 Type: boolean
3056 Default: true
3058 Result: One value list of type "cache_ratio" and type instance "buf_hash_hit".
3060 =back
3062 =head3 The Disks block
3064 This will collect performance data about the individual disks in the NetApp.
3066 B<Note:> To get this data the collectd user needs the
3067 "api-perf-object-get-instances" capability.
3069 =over 4
3071 =item B<Interval> I<Seconds>
3073 Collect disk statistics every I<Seconds> seconds.
3075 =item B<GetBusy> B<true>|B<false>
3077 If you set this option to true the busy time of all disks will be calculated
3078 and the value of the busiest disk in the system will be written.
3080 B<Note:> This is the same values that the NetApp CLI command "sysstat" returns
3081 in the "Disk util" field. Probably.
3083 Optional
3085 Type: boolean
3087 Default: true
3089 Result: One value list of type "percent" and type instance "disk_busy".
3091 =back
3093 =head3 The VolumePerf block
3095 This will collect various performance data about the individual volumes.
3097 You can select which data to collect about which volume using the following
3098 options. They follow the standard ignorelist semantic.
3100 B<Note:> To get this data the collectd user needs the
3101 I<api-perf-object-get-instances> capability.
3103 =over 4
3105 =item B<Interval> I<Seconds>
3107 Collect volume performance data every I<Seconds> seconds.
3109 =item B<GetIO> I<Volume>
3111 =item B<GetOps> I<Volume>
3113 =item B<GetLatency> I<Volume>
3115 Select the given volume for IO, operations or latency statistics collection.
3116 The argument is the name of the volume without the C</vol/> prefix.
3118 Since the standard ignorelist functionality is used here, you can use a string
3119 starting and ending with a slash to specify regular expression matching: To
3120 match the volumes "vol0", "vol2" and "vol7", you can use this regular
3121 expression:
3123   GetIO "/^vol[027]$/"
3125 If no regular expression is specified, an exact match is required. Both,
3126 regular and exact matching are case sensitive.
3128 If no volume was specified at all for either of the three options, that data
3129 will be collected for all available volumes.
3131 =item B<IgnoreSelectedIO> B<true>|B<false>
3133 =item B<IgnoreSelectedOps> B<true>|B<false>
3135 =item B<IgnoreSelectedLatency> B<true>|B<false>
3137 When set to B<true>, the volumes selected for IO, operations or latency
3138 statistics collection will be ignored and the data will be collected for all
3139 other volumes.
3141 When set to B<false>, data will only be collected for the specified volumes and
3142 all other volumes will be ignored.
3144 If no volumes have been specified with the above B<Get*> options, all volumes
3145 will be collected regardless of the B<IgnoreSelected*> option.
3147 Defaults to B<false>
3149 =back
3151 =head3 The VolumeUsage block
3153 This will collect capacity data about the individual volumes.
3155 B<Note:> To get this data the collectd user needs the I<api-volume-list-info>
3156 capability.
3158 =over 4
3160 =item B<Interval> I<Seconds>
3162 Collect volume usage statistics every I<Seconds> seconds.
3164 =item B<GetCapacity> I<VolumeName>
3166 The current capacity of the volume will be collected. This will result in two
3167 to four value lists, depending on the configuration of the volume. All data
3168 sources are of type "df_complex" with the name of the volume as
3169 plugin_instance.
3171 There will be type_instances "used" and "free" for the number of used and
3172 available bytes on the volume.  If the volume has some space reserved for
3173 snapshots, a type_instance "snap_reserved" will be available.  If the volume
3174 has SIS enabled, a type_instance "sis_saved" will be available. This is the
3175 number of bytes saved by the SIS feature.
3177 B<Note:> The current NetApp API has a bug that results in this value being
3178 reported as a 32E<nbsp>bit number. This plugin tries to guess the correct
3179 number which works most of the time.  If you see strange values here, bug
3180 NetApp support to fix this.
3182 Repeat this option to specify multiple volumes.
3184 =item B<IgnoreSelectedCapacity> B<true>|B<false>
3186 Specify whether to collect only the volumes selected by the B<GetCapacity>
3187 option or to ignore those volumes. B<IgnoreSelectedCapacity> defaults to
3188 B<false>. However, if no B<GetCapacity> option is specified at all, all
3189 capacities will be selected anyway.
3191 =item B<GetSnapshot> I<VolumeName>
3193 Select volumes from which to collect snapshot information.
3195 Usually, the space used for snapshots is included in the space reported as
3196 "used". If snapshot information is collected as well, the space used for
3197 snapshots is subtracted from the used space.
3199 To make things even more interesting, it is possible to reserve space to be
3200 used for snapshots. If the space required for snapshots is less than that
3201 reserved space, there is "reserved free" and "reserved used" space in addition
3202 to "free" and "used". If the space required for snapshots exceeds the reserved
3203 space, that part allocated in the normal space is subtracted from the "used"
3204 space again.
3206 Repeat this option to specify multiple volumes.
3208 =item B<IgnoreSelectedSnapshot>
3210 Specify whether to collect only the volumes selected by the B<GetSnapshot>
3211 option or to ignore those volumes. B<IgnoreSelectedSnapshot> defaults to
3212 B<false>. However, if no B<GetSnapshot> option is specified at all, all
3213 capacities will be selected anyway.
3215 =back
3217 =head3 The Quota block
3219 This will collect (tree) quota statistics (used disk space and number of used
3220 files). This mechanism is useful to get usage information for single qtrees.
3221 In case the quotas are not used for any other purpose, an entry similar to the
3222 following in C</etc/quotas> would be sufficient:
3224   /vol/volA/some_qtree tree - - - - -
3226 After adding the entry, issue C<quota on -w volA> on the NetApp filer.
3228 =over 4
3230 =item B<Interval> I<Seconds>
3232 Collect SnapVault(R) statistics every I<Seconds> seconds.
3234 =back
3236 =head3 The SnapVault block
3238 This will collect statistics about the time and traffic of SnapVault(R)
3239 transfers.
3241 =over 4
3243 =item B<Interval> I<Seconds>
3245 Collect SnapVault(R) statistics every I<Seconds> seconds.
3247 =back
3249 =head2 Plugin C<netlink>
3251 The C<netlink> plugin uses a netlink socket to query the Linux kernel about
3252 statistics of various interface and routing aspects.
3254 =over 4
3256 =item B<Interface> I<Interface>
3258 =item B<VerboseInterface> I<Interface>
3260 Instruct the plugin to collect interface statistics. This is basically the same
3261 as the statistics provided by the C<interface> plugin (see above) but
3262 potentially much more detailed.
3264 When configuring with B<Interface> only the basic statistics will be collected,
3265 namely octets, packets, and errors. These statistics are collected by
3266 the C<interface> plugin, too, so using both at the same time is no benefit.
3268 When configured with B<VerboseInterface> all counters B<except> the basic ones,
3269 so that no data needs to be collected twice if you use the C<interface> plugin.
3270 This includes dropped packets, received multicast packets, collisions and a
3271 whole zoo of differentiated RX and TX errors. You can try the following command
3272 to get an idea of what awaits you:
3274   ip -s -s link list
3276 If I<Interface> is B<All>, all interfaces will be selected.
3278 =item B<QDisc> I<Interface> [I<QDisc>]
3280 =item B<Class> I<Interface> [I<Class>]
3282 =item B<Filter> I<Interface> [I<Filter>]
3284 Collect the octets and packets that pass a certain qdisc, class or filter.
3286 QDiscs and classes are identified by their type and handle (or classid).
3287 Filters don't necessarily have a handle, therefore the parent's handle is used.
3288 The notation used in collectd differs from that used in tc(1) in that it
3289 doesn't skip the major or minor number if it's zero and doesn't print special
3290 ids by their name. So, for example, a qdisc may be identified by
3291 C<pfifo_fast-1:0> even though the minor number of B<all> qdiscs is zero and
3292 thus not displayed by tc(1).
3294 If B<QDisc>, B<Class>, or B<Filter> is given without the second argument,
3295 i.E<nbsp>.e. without an identifier, all qdiscs, classes, or filters that are
3296 associated with that interface will be collected.
3298 Since a filter itself doesn't necessarily have a handle, the parent's handle is
3299 used. This may lead to problems when more than one filter is attached to a
3300 qdisc or class. This isn't nice, but we don't know how this could be done any
3301 better. If you have a idea, please don't hesitate to tell us.
3303 As with the B<Interface> option you can specify B<All> as the interface,
3304 meaning all interfaces.
3306 Here are some examples to help you understand the above text more easily:
3308   <Plugin netlink>
3309     VerboseInterface "All"
3310     QDisc "eth0" "pfifo_fast-1:0"
3311     QDisc "ppp0"
3312     Class "ppp0" "htb-1:10"
3313     Filter "ppp0" "u32-1:0"
3314   </Plugin>
3316 =item B<IgnoreSelected>
3318 The behavior is the same as with all other similar plugins: If nothing is
3319 selected at all, everything is collected. If some things are selected using the
3320 options described above, only these statistics are collected. If you set
3321 B<IgnoreSelected> to B<true>, this behavior is inverted, i.E<nbsp>e. the
3322 specified statistics will not be collected.
3324 =back
3326 =head2 Plugin C<network>
3328 The Network plugin sends data to a remote instance of collectd, receives data
3329 from a remote instance, or both at the same time. Data which has been received
3330 from the network is usually not transmitted again, but this can be activated, see
3331 the B<Forward> option below.
3333 The default IPv6 multicast group is C<ff18::efc0:4a42>. The default IPv4
3334 multicast group is C<239.192.74.66>. The default I<UDP> port is B<25826>.
3336 Both, B<Server> and B<Listen> can be used as single option or as block. When
3337 used as block, given options are valid for this socket only. The following
3338 example will export the metrics twice: Once to an "internal" server (without
3339 encryption and signing) and one to an external server (with cryptographic
3340 signature):
3342  <Plugin "network">
3343    # Export to an internal server
3344    # (demonstrates usage without additional options)
3345    Server "collectd.internal.tld"
3346    
3347    # Export to an external server
3348    # (demonstrates usage with signature options)
3349    <Server "collectd.external.tld">
3350      SecurityLevel "sign"
3351      Username "myhostname"
3352      Password "ohl0eQue"
3353    </Server>
3354  </Plugin>
3356 =over 4
3358 =item B<E<lt>Server> I<Host> [I<Port>]B<E<gt>>
3360 The B<Server> statement/block sets the server to send datagrams to. The
3361 statement may occur multiple times to send each datagram to multiple
3362 destinations.
3364 The argument I<Host> may be a hostname, an IPv4 address or an IPv6 address. The
3365 optional second argument specifies a port number or a service name. If not
3366 given, the default, B<25826>, is used.
3368 The following options are recognized within B<Server> blocks:
3370 =over 4
3372 =item B<SecurityLevel> B<Encrypt>|B<Sign>|B<None>
3374 Set the security you require for network communication. When the security level
3375 has been set to B<Encrypt>, data sent over the network will be encrypted using
3376 I<AES-256>. The integrity of encrypted packets is ensured using I<SHA-1>. When
3377 set to B<Sign>, transmitted data is signed using the I<HMAC-SHA-256> message
3378 authentication code. When set to B<None>, data is sent without any security.
3380 This feature is only available if the I<network> plugin was linked with
3381 I<libgcrypt>.
3383 =item B<Username> I<Username>
3385 Sets the username to transmit. This is used by the server to lookup the
3386 password. See B<AuthFile> below. All security levels except B<None> require
3387 this setting.
3389 This feature is only available if the I<network> plugin was linked with
3390 I<libgcrypt>.
3392 =item B<Password> I<Password>
3394 Sets a password (shared secret) for this socket. All security levels except
3395 B<None> require this setting.
3397 This feature is only available if the I<network> plugin was linked with
3398 I<libgcrypt>.
3400 =item B<Interface> I<Interface name>
3402 Set the outgoing interface for IP packets. This applies at least
3403 to IPv6 packets and if possible to IPv4. If this option is not applicable,
3404 undefined or a non-existent interface name is specified, the default
3405 behavior is to let the kernel choose the appropriate interface. Be warned
3406 that the manual selection of an interface for unicast traffic is only
3407 necessary in rare cases.
3409 =back
3411 =item B<E<lt>Listen> I<Host> [I<Port>]B<E<gt>>
3413 The B<Listen> statement sets the interfaces to bind to. When multiple
3414 statements are found the daemon will bind to multiple interfaces.
3416 The argument I<Host> may be a hostname, an IPv4 address or an IPv6 address. If
3417 the argument is a multicast address the daemon will join that multicast group.
3418 The optional second argument specifies a port number or a service name. If not
3419 given, the default, B<25826>, is used.
3421 The following options are recognized within C<E<lt>ListenE<gt>> blocks:
3423 =over 4
3425 =item B<SecurityLevel> B<Encrypt>|B<Sign>|B<None>
3427 Set the security you require for network communication. When the security level
3428 has been set to B<Encrypt>, only encrypted data will be accepted. The integrity
3429 of encrypted packets is ensured using I<SHA-1>. When set to B<Sign>, only
3430 signed and encrypted data is accepted. When set to B<None>, all data will be
3431 accepted. If an B<AuthFile> option was given (see below), encrypted data is
3432 decrypted if possible.
3434 This feature is only available if the I<network> plugin was linked with
3435 I<libgcrypt>.
3437 =item B<AuthFile> I<Filename>
3439 Sets a file in which usernames are mapped to passwords. These passwords are
3440 used to verify signatures and to decrypt encrypted network packets. If
3441 B<SecurityLevel> is set to B<None>, this is optional. If given, signed data is
3442 verified and encrypted packets are decrypted. Otherwise, signed data is
3443 accepted without checking the signature and encrypted data cannot be decrypted.
3444 For the other security levels this option is mandatory.
3446 The file format is very simple: Each line consists of a username followed by a
3447 colon and any number of spaces followed by the password. To demonstrate, an
3448 example file could look like this:
3450   user0: foo
3451   user1: bar
3453 Each time a packet is received, the modification time of the file is checked
3454 using L<stat(2)>. If the file has been changed, the contents is re-read. While
3455 the file is being read, it is locked using L<fcntl(2)>.
3457 =item B<Interface> I<Interface name>
3459 Set the incoming interface for IP packets explicitly. This applies at least
3460 to IPv6 packets and if possible to IPv4. If this option is not applicable,
3461 undefined or a non-existent interface name is specified, the default
3462 behavior is, to let the kernel choose the appropriate interface. Thus incoming
3463 traffic gets only accepted, if it arrives on the given interface.
3465 =back
3467 =item B<TimeToLive> I<1-255>
3469 Set the time-to-live of sent packets. This applies to all, unicast and
3470 multicast, and IPv4 and IPv6 packets. The default is to not change this value.
3471 That means that multicast packets will be sent with a TTL of C<1> (one) on most
3472 operating systems.
3474 =item B<MaxPacketSize> I<1024-65535>
3476 Set the maximum size for datagrams received over the network. Packets larger
3477 than this will be truncated. Defaults to 1452E<nbsp>bytes, which is the maximum
3478 payload size that can be transmitted in one Ethernet frame using IPv6E<nbsp>/
3479 UDP.
3481 On the server side, this limit should be set to the largest value used on
3482 I<any> client. Likewise, the value on the client must not be larger than the
3483 value on the server, or data will be lost.
3485 B<Compatibility:> Versions prior to I<versionE<nbsp>4.8> used a fixed sized
3486 buffer of 1024E<nbsp>bytes. Versions I<4.8>, I<4.9> and I<4.10> used a default
3487 value of 1024E<nbsp>bytes to avoid problems when sending data to an older
3488 server.
3490 =item B<Forward> I<true|false>
3492 If set to I<true>, write packets that were received via the network plugin to
3493 the sending sockets. This should only be activated when the B<Listen>- and
3494 B<Server>-statements differ. Otherwise packets may be send multiple times to
3495 the same multicast group. While this results in more network traffic than
3496 necessary it's not a huge problem since the plugin has a duplicate detection,
3497 so the values will not loop.
3499 =item B<ReportStats> B<true>|B<false>
3501 The network plugin cannot only receive and send statistics, it can also create
3502 statistics about itself. Collected data included the number of received and
3503 sent octets and packets, the length of the receive queue and the number of
3504 values handled. When set to B<true>, the I<Network plugin> will make these
3505 statistics available. Defaults to B<false>.
3507 =back
3509 =head2 Plugin C<nginx>
3511 This plugin collects the number of connections and requests handled by the
3512 C<nginx daemon> (speak: engineE<nbsp>X), a HTTP and mail server/proxy. It
3513 queries the page provided by the C<ngx_http_stub_status_module> module, which
3514 isn't compiled by default. Please refer to
3515 L<http://wiki.codemongers.com/NginxStubStatusModule> for more information on
3516 how to compile and configure nginx and this module.
3518 The following options are accepted by the C<nginx plugin>:
3520 =over 4
3522 =item B<URL> I<http://host/nginx_status>
3524 Sets the URL of the C<ngx_http_stub_status_module> output.
3526 =item B<User> I<Username>
3528 Optional user name needed for authentication.
3530 =item B<Password> I<Password>
3532 Optional password needed for authentication.
3534 =item B<VerifyPeer> B<true|false>
3536 Enable or disable peer SSL certificate verification. See
3537 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
3539 =item B<VerifyHost> B<true|false>
3541 Enable or disable peer host name verification. If enabled, the plugin checks
3542 if the C<Common Name> or a C<Subject Alternate Name> field of the SSL
3543 certificate matches the host name provided by the B<URL> option. If this
3544 identity check fails, the connection is aborted. Obviously, only works when
3545 connecting to a SSL enabled server. Enabled by default.
3547 =item B<CACert> I<File>
3549 File that holds one or more SSL certificates. If you want to use HTTPS you will
3550 possibly need this option. What CA certificates come bundled with C<libcurl>
3551 and are checked by default depends on the distribution you use.
3553 =back
3555 =head2 Plugin C<notify_desktop>
3557 This plugin sends a desktop notification to a notification daemon, as defined
3558 in the Desktop Notification Specification. To actually display the
3559 notifications, B<notification-daemon> is required and B<collectd> has to be
3560 able to access the X server (i.E<nbsp>e., the C<DISPLAY> and C<XAUTHORITY>
3561 environment variables have to be set correctly) and the D-Bus message bus.
3563 The Desktop Notification Specification can be found at
3564 L<http://www.galago-project.org/specs/notification/>.
3566 =over 4
3568 =item B<OkayTimeout> I<timeout>
3570 =item B<WarningTimeout> I<timeout>
3572 =item B<FailureTimeout> I<timeout>
3574 Set the I<timeout>, in milliseconds, after which to expire the notification
3575 for C<OKAY>, C<WARNING> and C<FAILURE> severities respectively. If zero has
3576 been specified, the displayed notification will not be closed at all - the
3577 user has to do so herself. These options default to 5000. If a negative number
3578 has been specified, the default is used as well.
3580 =back
3582 =head2 Plugin C<notify_email>
3584 The I<notify_email> plugin uses the I<ESMTP> library to send notifications to a
3585 configured email address.
3587 I<libESMTP> is available from L<http://www.stafford.uklinux.net/libesmtp/>.
3589 Available configuration options:
3591 =over 4
3593 =item B<From> I<Address>
3595 Email address from which the emails should appear to come from.
3597 Default: C<root@localhost>
3599 =item B<Recipient> I<Address>
3601 Configures the email address(es) to which the notifications should be mailed.
3602 May be repeated to send notifications to multiple addresses.
3604 At least one B<Recipient> must be present for the plugin to work correctly.
3606 =item B<SMTPServer> I<Hostname>
3608 Hostname of the SMTP server to connect to.
3610 Default: C<localhost>
3612 =item B<SMTPPort> I<Port>
3614 TCP port to connect to.
3616 Default: C<25>
3618 =item B<SMTPUser> I<Username>
3620 Username for ASMTP authentication. Optional.
3622 =item B<SMTPPassword> I<Password>
3624 Password for ASMTP authentication. Optional.
3626 =item B<Subject> I<Subject>
3628 Subject-template to use when sending emails. There must be exactly two
3629 string-placeholders in the subject, given in the standard I<printf(3)> syntax,
3630 i.E<nbsp>e. C<%s>. The first will be replaced with the severity, the second
3631 with the hostname.
3633 Default: C<Collectd notify: %s@%s>
3635 =back
3637 =head2 Plugin C<ntpd>
3639 =over 4
3641 =item B<Host> I<Hostname>
3643 Hostname of the host running B<ntpd>. Defaults to B<localhost>.
3645 =item B<Port> I<Port>
3647 UDP-Port to connect to. Defaults to B<123>.
3649 =item B<ReverseLookups> B<true>|B<false>
3651 Sets whether or not to perform reverse lookups on peers. Since the name or
3652 IP-address may be used in a filename it is recommended to disable reverse
3653 lookups. The default is to do reverse lookups to preserve backwards
3654 compatibility, though.
3656 =item B<IncludeUnitID> B<true>|B<false>
3658 When a peer is a refclock, include the unit ID in the I<type instance>.
3659 Defaults to B<false> for backward compatibility.
3661 If two refclock peers use the same driver and this is B<false>, the plugin will
3662 try to write simultaneous measurements from both to the same type instance.
3663 This will result in error messages in the log and only one set of measurements
3664 making it through.
3666 =back
3668 =head2 Plugin C<nut>
3670 =over 4
3672 =item B<UPS> I<upsname>B<@>I<hostname>[B<:>I<port>]
3674 Add a UPS to collect data from. The format is identical to the one accepted by
3675 L<upsc(8)>.
3677 =back
3679 =head2 Plugin C<olsrd>
3681 The I<olsrd> plugin connects to the TCP port opened by the I<txtinfo> plugin of
3682 the Optimized Link State Routing daemon and reads information about the current
3683 state of the meshed network.
3685 The following configuration options are understood:
3687 =over 4
3689 =item B<Host> I<Host>
3691 Connect to I<Host>. Defaults to B<"localhost">.
3693 =item B<Port> I<Port>
3695 Specifies the port to connect to. This must be a string, even if you give the
3696 port as a number rather than a service name. Defaults to B<"2006">.
3698 =item B<CollectLinks> B<No>|B<Summary>|B<Detail>
3700 Specifies what information to collect about links, i.E<nbsp>e. direct
3701 connections of the daemon queried. If set to B<No>, no information is
3702 collected. If set to B<Summary>, the number of links and the average of all
3703 I<link quality> (LQ) and I<neighbor link quality> (NLQ) values is calculated.
3704 If set to B<Detail> LQ and NLQ are collected per link.
3706 Defaults to B<Detail>.
3708 =item B<CollectRoutes> B<No>|B<Summary>|B<Detail>
3710 Specifies what information to collect about routes of the daemon queried. If
3711 set to B<No>, no information is collected. If set to B<Summary>, the number of
3712 routes and the average I<metric> and I<ETX> is calculated. If set to B<Detail>
3713 metric and ETX are collected per route.
3715 Defaults to B<Summary>.
3717 =item B<CollectTopology> B<No>|B<Summary>|B<Detail>
3719 Specifies what information to collect about the global topology. If set to
3720 B<No>, no information is collected. If set to B<Summary>, the number of links
3721 in the entire topology and the average I<link quality> (LQ) is calculated.
3722 If set to B<Detail> LQ and NLQ are collected for each link in the entire topology.
3724 Defaults to B<Summary>.
3726 =back
3728 =head2 Plugin C<onewire>
3730 B<EXPERIMENTAL!> See notes below.
3732 The C<onewire> plugin uses the B<owcapi> library from the B<owfs> project
3733 L<http://owfs.org/> to read sensors connected via the onewire bus.
3735 Currently only temperature sensors (sensors with the family code C<10>,
3736 e.E<nbsp>g. DS1820, DS18S20, DS1920) can be read. If you have other sensors you
3737 would like to have included, please send a sort request to the mailing list.
3739 Hubs (the DS2409 chips) are working, but read the note, why this plugin is
3740 experimental, below.
3742 =over 4
3744 =item B<Device> I<Device>
3746 Sets the device to read the values from. This can either be a "real" hardware
3747 device, such as a serial port or an USB port, or the address of the
3748 L<owserver(1)> socket, usually B<localhost:4304>.
3750 Though the documentation claims to automatically recognize the given address
3751 format, with versionE<nbsp>2.7p4 we had to specify the type explicitly. So
3752 with that version, the following configuration worked for us:
3754   <Plugin onewire>
3755     Device "-s localhost:4304"
3756   </Plugin>
3758 This directive is B<required> and does not have a default value.
3760 =item B<Sensor> I<Sensor>
3762 Selects sensors to collect or to ignore, depending on B<IgnoreSelected>, see
3763 below. Sensors are specified without the family byte at the beginning, to you'd
3764 use C<F10FCA000800>, and B<not> include the leading C<10.> family byte and
3765 point.
3767 =item B<IgnoreSelected> I<true>|I<false>
3769 If no configuration if given, the B<onewire> plugin will collect data from all
3770 sensors found. This may not be practical, especially if sensors are added and
3771 removed regularly. Sometimes, however, it's easier/preferred to collect only
3772 specific sensors or all sensors I<except> a few specified ones. This option
3773 enables you to do that: By setting B<IgnoreSelected> to I<true> the effect of
3774 B<Sensor> is inverted: All selected interfaces are ignored and all other
3775 interfaces are collected.
3777 =item B<Interval> I<Seconds>
3779 Sets the interval in which all sensors should be read. If not specified, the
3780 global B<Interval> setting is used.
3782 =back
3784 B<EXPERIMENTAL!> The C<onewire> plugin is experimental, because it doesn't yet
3785 work with big setups. It works with one sensor being attached to one
3786 controller, but as soon as you throw in a couple more senors and maybe a hub
3787 or two, reading all values will take more than ten seconds (the default
3788 interval). We will probably add some separate thread for reading the sensors
3789 and some cache or something like that, but it's not done yet. We will try to
3790 maintain backwards compatibility in the future, but we can't promise. So in
3791 short: If it works for you: Great! But keep in mind that the config I<might>
3792 change, though this is unlikely. Oh, and if you want to help improving this
3793 plugin, just send a short notice to the mailing list. ThanksE<nbsp>:)
3795 =head2 Plugin C<openvpn>
3797 The OpenVPN plugin reads a status file maintained by OpenVPN and gathers
3798 traffic statistics about connected clients.
3800 To set up OpenVPN to write to the status file periodically, use the
3801 B<--status> option of OpenVPN. Since OpenVPN can write two different formats,
3802 you need to set the required format, too. This is done by setting
3803 B<--status-version> to B<2>.
3805 So, in a nutshell you need:
3807   openvpn $OTHER_OPTIONS \
3808     --status "/var/run/openvpn-status" 10 \
3809     --status-version 2
3811 Available options:
3813 =over 4
3815 =item B<StatusFile> I<File>
3817 Specifies the location of the status file.
3819 =item B<ImprovedNamingSchema> B<true>|B<false>
3821 When enabled, the filename of the status file will be used as plugin instance
3822 and the client's "common name" will be used as type instance. This is required
3823 when reading multiple status files. Enabling this option is recommended, but to
3824 maintain backwards compatibility this option is disabled by default.
3826 =item B<CollectCompression> B<true>|B<false>
3828 Sets whether or not statistics about the compression used by OpenVPN should be
3829 collected. This information is only available in I<single> mode. Enabled by
3830 default.
3832 =item B<CollectIndividualUsers> B<true>|B<false>
3834 Sets whether or not traffic information is collected for each connected client
3835 individually. If set to false, currently no traffic data is collected at all
3836 because aggregating this data in a save manner is tricky. Defaults to B<true>.
3838 =item B<CollectUserCount> B<true>|B<false>
3840 When enabled, the number of currently connected clients or users is collected.
3841 This is especially interesting when B<CollectIndividualUsers> is disabled, but
3842 can be configured independently from that option. Defaults to B<false>.
3844 =back
3846 =head2 Plugin C<oracle>
3848 The "oracle" plugin uses the Oracle® Call Interface I<(OCI)> to connect to an
3849 Oracle® Database and lets you execute SQL statements there. It is very similar
3850 to the "dbi" plugin, because it was written around the same time. See the "dbi"
3851 plugin's documentation above for details.
3853   <Plugin oracle>
3854     <Query "out_of_stock">
3855       Statement "SELECT category, COUNT(*) AS value FROM products WHERE in_stock = 0 GROUP BY category"
3856       <Result>
3857         Type "gauge"
3858         # InstancePrefix "foo"
3859         InstancesFrom "category"
3860         ValuesFrom "value"
3861       </Result>
3862     </Query>
3863     <Database "product_information">
3864       ConnectID "db01"
3865       Username "oracle"
3866       Password "secret"
3867       Query "out_of_stock"
3868     </Database>
3869   </Plugin>
3871 =head3 B<Query> blocks
3873 The Query blocks are handled identically to the Query blocks of the "dbi"
3874 plugin. Please see its documentation above for details on how to specify
3875 queries.
3877 =head3 B<Database> blocks
3879 Database blocks define a connection to a database and which queries should be
3880 sent to that database. Each database needs a "name" as string argument in the
3881 starting tag of the block. This name will be used as "PluginInstance" in the
3882 values submitted to the daemon. Other than that, that name is not used.
3884 =over 4
3886 =item B<ConnectID> I<ID>
3888 Defines the "database alias" or "service name" to connect to. Usually, these
3889 names are defined in the file named C<$ORACLE_HOME/network/admin/tnsnames.ora>.
3891 =item B<Host> I<Host>
3893 Hostname to use when dispatching values for this database. Defaults to using
3894 the global hostname of the I<collectd> instance.
3896 =item B<Username> I<Username>
3898 Username used for authentication.
3900 =item B<Password> I<Password>
3902 Password used for authentication.
3904 =item B<Query> I<QueryName>
3906 Associates the query named I<QueryName> with this database connection. The
3907 query needs to be defined I<before> this statement, i.E<nbsp>e. all query
3908 blocks you want to refer to must be placed above the database block you want to
3909 refer to them from.
3911 =back
3913 =head2 Plugin C<perl>
3915 This plugin embeds a Perl-interpreter into collectd and provides an interface
3916 to collectd's plugin system. See L<collectd-perl(5)> for its documentation.
3918 =head2 Plugin C<pinba>
3920 The I<Pinba plugin> receives profiling information from I<Pinba>, an extension
3921 for the I<PHP> interpreter. At the end of executing a script, i.e. after a
3922 PHP-based webpage has been delivered, the extension will send a UDP packet
3923 containing timing information, peak memory usage and so on. The plugin will
3924 wait for such packets, parse them and account the provided information, which
3925 is then dispatched to the daemon once per interval.
3927 Synopsis:
3929  <Plugin pinba>
3930    Address "::0"
3931    Port "30002"
3932    # Overall statistics for the website.
3933    <View "www-total">
3934      Server "www.example.com"
3935    </View>
3936    # Statistics for www-a only
3937    <View "www-a">
3938      Host "www-a.example.com"
3939      Server "www.example.com"
3940    </View>
3941    # Statistics for www-b only
3942    <View "www-b">
3943      Host "www-b.example.com"
3944      Server "www.example.com"
3945    </View>
3946  </Plugin>
3948 The plugin provides the following configuration options:
3950 =over 4
3952 =item B<Address> I<Node>
3954 Configures the address used to open a listening socket. By default, plugin will
3955 bind to the I<any> address C<::0>.
3957 =item B<Port> I<Service>
3959 Configures the port (service) to bind to. By default the default Pinba port
3960 "30002" will be used. The option accepts service names in addition to port
3961 numbers and thus requires a I<string> argument.
3963 =item E<lt>B<View> I<Name>E<gt> block
3965 The packets sent by the Pinba extension include the hostname of the server, the
3966 server name (the name of the virtual host) and the script that was executed.
3967 Using B<View> blocks it is possible to separate the data into multiple groups
3968 to get more meaningful statistics. Each packet is added to all matching groups,
3969 so that a packet may be accounted for more than once.
3971 =over 4
3973 =item B<Host> I<Host>
3975 Matches the hostname of the system the webserver / script is running on. This
3976 will contain the result of the L<gethostname(2)> system call. If not
3977 configured, all hostnames will be accepted.
3979 =item B<Server> I<Server>
3981 Matches the name of the I<virtual host>, i.e. the contents of the
3982 C<$_SERVER["SERVER_NAME"]> variable when within PHP. If not configured, all
3983 server names will be accepted.
3985 =item B<Script> I<Script>
3987 Matches the name of the I<script name>, i.e. the contents of the
3988 C<$_SERVER["SCRIPT_NAME"]> variable when within PHP. If not configured, all
3989 script names will be accepted.
3991 =back
3993 =back
3995 =head2 Plugin C<ping>
3997 The I<Ping> plugin starts a new thread which sends ICMP "ping" packets to the
3998 configured hosts periodically and measures the network latency. Whenever the
3999 C<read> function of the plugin is called, it submits the average latency, the
4000 standard deviation and the drop rate for each host.
4002 Available configuration options:
4004 =over 4
4006 =item B<Host> I<IP-address>
4008 Host to ping periodically. This option may be repeated several times to ping
4009 multiple hosts.
4011 =item B<Interval> I<Seconds>
4013 Sets the interval in which to send ICMP echo packets to the configured hosts.
4014 This is B<not> the interval in which statistics are queries from the plugin but
4015 the interval in which the hosts are "pinged". Therefore, the setting here
4016 should be smaller than or equal to the global B<Interval> setting. Fractional
4017 times, such as "1.24" are allowed.
4019 Default: B<1.0>
4021 =item B<Timeout> I<Seconds>
4023 Time to wait for a response from the host to which an ICMP packet had been
4024 sent. If a reply was not received after I<Seconds> seconds, the host is assumed
4025 to be down or the packet to be dropped. This setting must be smaller than the
4026 B<Interval> setting above for the plugin to work correctly. Fractional
4027 arguments are accepted.
4029 Default: B<0.9>
4031 =item B<TTL> I<0-255>
4033 Sets the Time-To-Live of generated ICMP packets.
4035 =item B<SourceAddress> I<host>
4037 Sets the source address to use. I<host> may either be a numerical network
4038 address or a network hostname.
4040 =item B<Device> I<name>
4042 Sets the outgoing network device to be used. I<name> has to specify an
4043 interface name (e.E<nbsp>g. C<eth0>). This might not be supported by all
4044 operating systems.
4046 =item B<MaxMissed> I<Packets>
4048 Trigger a DNS resolve after the host has not replied to I<Packets> packets. This
4049 enables the use of dynamic DNS services (like dyndns.org) with the ping plugin.
4051 Default: B<-1> (disabled)
4053 =back
4055 =head2 Plugin C<postgresql>
4057 The C<postgresql> plugin queries statistics from PostgreSQL databases. It
4058 keeps a persistent connection to all configured databases and tries to
4059 reconnect if the connection has been interrupted. A database is configured by
4060 specifying a B<Database> block as described below. The default statistics are
4061 collected from PostgreSQL's B<statistics collector> which thus has to be
4062 enabled for this plugin to work correctly. This should usually be the case by
4063 default. See the section "The Statistics Collector" of the B<PostgreSQL
4064 Documentation> for details.
4066 By specifying custom database queries using a B<Query> block as described
4067 below, you may collect any data that is available from some PostgreSQL
4068 database. This way, you are able to access statistics of external daemons
4069 which are available in a PostgreSQL database or use future or special
4070 statistics provided by PostgreSQL without the need to upgrade your collectd
4071 installation.
4073 Starting with version 5.2, the C<postgresql> plugin supports writing data to
4074 PostgreSQL databases as well. This has been implemented in a generic way. You
4075 need to specify an SQL statement which will then be executed by collectd in
4076 order to write the data (see below for details). The benefit of that approach
4077 is that there is no fixed database layout. Rather, the layout may be optimized
4078 for the current setup.
4080 The B<PostgreSQL Documentation> manual can be found at
4081 L<http://www.postgresql.org/docs/manuals/>.
4083   <Plugin postgresql>
4084     <Query magic>
4085       Statement "SELECT magic FROM wizard WHERE host = $1;"
4086       Param hostname
4087       <Result>
4088         Type gauge
4089         InstancePrefix "magic"
4090         ValuesFrom magic
4091       </Result>
4092     </Query>
4094     <Query rt36_tickets>
4095       Statement "SELECT COUNT(type) AS count, type \
4096                         FROM (SELECT CASE \
4097                                      WHEN resolved = 'epoch' THEN 'open' \
4098                                      ELSE 'resolved' END AS type \
4099                                      FROM tickets) type \
4100                         GROUP BY type;"
4101       <Result>
4102         Type counter
4103         InstancePrefix "rt36_tickets"
4104         InstancesFrom "type"
4105         ValuesFrom "count"
4106       </Result>
4107     </Query>
4109     <Writer sqlstore>
4110       Statement "SELECT collectd_insert($1, $2, $3, $4, $5, $6, $7, $8, $9);"
4111       StoreRates true
4112     </Writer>
4114     <Database foo>
4115       Host "hostname"
4116       Port "5432"
4117       User "username"
4118       Password "secret"
4119       SSLMode "prefer"
4120       KRBSrvName "kerberos_service_name"
4121       Query magic
4122     </Database>
4124     <Database bar>
4125       Interval 300
4126       Service "service_name"
4127       Query backend # predefined
4128       Query rt36_tickets
4129     </Database>
4131     <Database qux>
4132       # ...
4133       Writer sqlstore
4134       CommitInterval 10
4135     </Database>
4136   </Plugin>
4138 The B<Query> block defines one database query which may later be used by a
4139 database definition. It accepts a single mandatory argument which specifies
4140 the name of the query. The names of all queries have to be unique (see the
4141 B<MinVersion> and B<MaxVersion> options below for an exception to this
4142 rule). The following configuration options are available to define the query:
4144 In each B<Query> block, there is one or more B<Result> blocks. B<Result>
4145 blocks define how to handle the values returned from the query. They define
4146 which column holds which value and how to dispatch that value to the daemon.
4147 Multiple B<Result> blocks may be used to extract multiple values from a single
4148 query.
4150 =over 4
4152 =item B<Statement> I<sql query statement>
4154 Specify the I<sql query statement> which the plugin should execute. The string
4155 may contain the tokens B<$1>, B<$2>, etc. which are used to reference the
4156 first, second, etc. parameter. The value of the parameters is specified by the
4157 B<Param> configuration option - see below for details. To include a literal
4158 B<$> character followed by a number, surround it with single quotes (B<'>).
4160 Any SQL command which may return data (such as C<SELECT> or C<SHOW>) is
4161 allowed. Note, however, that only a single command may be used. Semicolons are
4162 allowed as long as a single non-empty command has been specified only.
4164 The returned lines will be handled separately one after another.
4166 =item B<Param> I<hostname>|I<database>|I<username>|I<interval>
4168 Specify the parameters which should be passed to the SQL query. The parameters
4169 are referred to in the SQL query as B<$1>, B<$2>, etc. in the same order as
4170 they appear in the configuration file. The value of the parameter is
4171 determined depending on the value of the B<Param> option as follows:
4173 =over 4
4175 =item I<hostname>
4177 The configured hostname of the database connection. If a UNIX domain socket is
4178 used, the parameter expands to "localhost".
4180 =item I<database>
4182 The name of the database of the current connection.
4184 =item I<instance>
4186 The name of the database plugin instance. See the B<Instance> option of the
4187 database specification below for details.
4189 =item I<username>
4191 The username used to connect to the database.
4193 =item I<interval>
4195 The interval with which this database is queried (as specified by the database
4196 specific or global B<Interval> options).
4198 =back
4200 Please note that parameters are only supported by PostgreSQL's protocol
4201 version 3 and above which was introduced in version 7.4 of PostgreSQL.
4203 =item B<Type> I<type>
4205 The I<type> name to be used when dispatching the values. The type describes
4206 how to handle the data and where to store it. See L<types.db(5)> for more
4207 details on types and their configuration. The number and type of values (as
4208 selected by the B<ValuesFrom> option) has to match the type of the given name.
4210 This option is required inside a B<Result> block.
4212 =item B<InstancePrefix> I<prefix>
4214 =item B<InstancesFrom> I<column0> [I<column1> ...]
4216 Specify how to create the "TypeInstance" for each data set (i.E<nbsp>e. line).
4217 B<InstancePrefix> defines a static prefix that will be prepended to all type
4218 instances. B<InstancesFrom> defines the column names whose values will be used
4219 to create the type instance. Multiple values will be joined together using the
4220 hyphen (C<->) as separation character.
4222 The plugin itself does not check whether or not all built instances are
4223 different. It is your responsibility to assure that each is unique.
4225 Both options are optional. If none is specified, the type instance will be
4226 empty.
4228 =item B<ValuesFrom> I<column0> [I<column1> ...]
4230 Names the columns whose content is used as the actual data for the data sets
4231 that are dispatched to the daemon. How many such columns you need is
4232 determined by the B<Type> setting as explained above. If you specify too many
4233 or not enough columns, the plugin will complain about that and no data will be
4234 submitted to the daemon.
4236 The actual data type, as seen by PostgreSQL, is not that important as long as
4237 it represents numbers. The plugin will automatically cast the values to the
4238 right type if it know how to do that. For that, it uses the L<strtoll(3)> and
4239 L<strtod(3)> functions, so anything supported by those functions is supported
4240 by the plugin as well.
4242 This option is required inside a B<Result> block and may be specified multiple
4243 times. If multiple B<ValuesFrom> options are specified, the columns are read
4244 in the given order.
4246 =item B<MinVersion> I<version>
4248 =item B<MaxVersion> I<version>
4250 Specify the minimum or maximum version of PostgreSQL that this query should be
4251 used with. Some statistics might only be available with certain versions of
4252 PostgreSQL. This allows you to specify multiple queries with the same name but
4253 which apply to different versions, thus allowing you to use the same
4254 configuration in a heterogeneous environment.
4256 The I<version> has to be specified as the concatenation of the major, minor
4257 and patch-level versions, each represented as two-decimal-digit numbers. For
4258 example, version 8.2.3 will become 80203.
4260 =back
4262 The following predefined queries are available (the definitions can be found
4263 in the F<postgresql_default.conf> file which, by default, is available at
4264 C<I<prefix>/share/collectd/>):
4266 =over 4
4268 =item B<backends>
4270 This query collects the number of backends, i.E<nbsp>e. the number of
4271 connected clients.
4273 =item B<transactions>
4275 This query collects the numbers of committed and rolled-back transactions of
4276 the user tables.
4278 =item B<queries>
4280 This query collects the numbers of various table modifications (i.E<nbsp>e.
4281 insertions, updates, deletions) of the user tables.
4283 =item B<query_plans>
4285 This query collects the numbers of various table scans and returned tuples of
4286 the user tables.
4288 =item B<table_states>
4290 This query collects the numbers of live and dead rows in the user tables.
4292 =item B<disk_io>
4294 This query collects disk block access counts for user tables.
4296 =item B<disk_usage>
4298 This query collects the on-disk size of the database in bytes.
4300 =back
4302 In addition, the following detailed queries are available by default. Please
4303 note that each of those queries collects information B<by table>, thus,
4304 potentially producing B<a lot> of data. For details see the description of the
4305 non-by_table queries above.
4307 =over 4
4309 =item B<queries_by_table>
4311 =item B<query_plans_by_table>
4313 =item B<table_states_by_table>
4315 =item B<disk_io_by_table>
4317 =back
4319 The B<Writer> block defines a PostgreSQL writer backend. It accepts a single
4320 mandatory argument specifying the name of the writer. This will then be used
4321 in the B<Database> specification in order to activate the writer instance. The
4322 names of all writers have to be unique. The following options may be
4323 specified:
4325 =over 4
4327 =item B<Statement> I<sql statement>
4329 This mandatory option specifies the SQL statement that will be executed for
4330 each submitted value. A single SQL statement is allowed only. Anything after
4331 the first semicolon will be ignored.
4333 Nine parameters will be passed to the statement and should be specified as
4334 tokens B<$1>, B<$2>, through B<$9> in the statement string. The following
4335 values are made available through those parameters:
4337 =over 4
4339 =item B<$1>
4341 The timestamp of the queried value as a floating point number.
4343 =item B<$2>
4345 The hostname of the queried value.
4347 =item B<$3>
4349 The plugin name of the queried value.
4351 =item B<$4>
4353 The plugin instance of the queried value. This value may be B<NULL> if there
4354 is no plugin instance.
4356 =item B<$5>
4358 The type of the queried value (cf. L<types.db(5)>).
4360 =item B<$6>
4362 The type instance of the queried value. This value may be B<NULL> if there is
4363 no type instance.
4365 =item B<$7>
4367 An array of names for the submitted values (i.E<nbsp>e., the name of the data
4368 sources of the submitted value-list).
4370 =item B<$8>
4372 An array of types for the submitted values (i.E<nbsp>e., the type of the data
4373 sources of the submitted value-list; C<counter>, C<gauge>, ...). Note, that if
4374 B<StoreRates> is enabled (which is the default, see below), all types will be
4375 C<gauge>.
4377 =item B<$9>
4379 An array of the submitted values. The dimensions of the value name and value
4380 arrays match.
4382 =back
4384 In general, it is advisable to create and call a custom function in the
4385 PostgreSQL database for this purpose. Any procedural language supported by
4386 PostgreSQL will do (see chapter "Server Programming" in the PostgreSQL manual
4387 for details).
4389 =item B<StoreRates> B<false>|B<true>
4391 If set to B<true> (the default), convert counter values to rates. If set to
4392 B<false> counter values are stored as is, i.E<nbsp>e. as an increasing integer
4393 number.
4395 =back
4397 The B<Database> block defines one PostgreSQL database for which to collect
4398 statistics. It accepts a single mandatory argument which specifies the
4399 database name. None of the other options are required. PostgreSQL will use
4400 default values as documented in the section "CONNECTING TO A DATABASE" in the
4401 L<psql(1)> manpage. However, be aware that those defaults may be influenced by
4402 the user collectd is run as and special environment variables. See the manpage
4403 for details.
4405 =over 4
4407 =item B<Interval> I<seconds>
4409 Specify the interval with which the database should be queried. The default is
4410 to use the global B<Interval> setting.
4412 =item B<CommitInterval> I<seconds>
4414 This option may be used for database connections which have "writers" assigned
4415 (see above). If specified, it causes a writer to put several updates into a
4416 single transaction. This transaction will last for the specified amount of
4417 time. By default, each update will be executed in a separate transaction. Each
4418 transaction generates a fair amount of overhead which can, thus, be reduced by
4419 activating this option. The draw-back is, that data covering the specified
4420 amount of time will be lost, for example, if a single statement within the
4421 transaction fails or if the database server crashes.
4423 =item B<Host> I<hostname>
4425 Specify the hostname or IP of the PostgreSQL server to connect to. If the
4426 value begins with a slash, it is interpreted as the directory name in which to
4427 look for the UNIX domain socket.
4429 This option is also used to determine the hostname that is associated with a
4430 collected data set. If it has been omitted or either begins with with a slash
4431 or equals B<localhost> it will be replaced with the global hostname definition
4432 of collectd. Any other value will be passed literally to collectd when
4433 dispatching values. Also see the global B<Hostname> and B<FQDNLookup> options.
4435 =item B<Port> I<port>
4437 Specify the TCP port or the local UNIX domain socket file extension of the
4438 server.
4440 =item B<User> I<username>
4442 Specify the username to be used when connecting to the server.
4444 =item B<Password> I<password>
4446 Specify the password to be used when connecting to the server.
4448 =item B<SSLMode> I<disable>|I<allow>|I<prefer>|I<require>
4450 Specify whether to use an SSL connection when contacting the server. The
4451 following modes are supported:
4453 =item B<Instance> I<name>
4455 Specify the plugin instance name that should be used instead of the database
4456 name (which is the default, if this option has not been specified). This
4457 allows to query multiple databases of the same name on the same host (e.g.
4458 when running multiple database server versions in parallel).
4460 =over 4
4462 =item I<disable>
4464 Do not use SSL at all.
4466 =item I<allow>
4468 First, try to connect without using SSL. If that fails, try using SSL.
4470 =item I<prefer> (default)
4472 First, try to connect using SSL. If that fails, try without using SSL.
4474 =item I<require>
4476 Use SSL only.
4478 =back
4480 =item B<KRBSrvName> I<kerberos_service_name>
4482 Specify the Kerberos service name to use when authenticating with Kerberos 5
4483 or GSSAPI. See the sections "Kerberos authentication" and "GSSAPI" of the
4484 B<PostgreSQL Documentation> for details.
4486 =item B<Service> I<service_name>
4488 Specify the PostgreSQL service name to use for additional parameters. That
4489 service has to be defined in F<pg_service.conf> and holds additional
4490 connection parameters. See the section "The Connection Service File" in the
4491 B<PostgreSQL Documentation> for details.
4493 =item B<Query> I<query>
4495 Specifies a I<query> which should be executed in the context of the database
4496 connection. This may be any of the predefined or user-defined queries. If no
4497 such option is given, it defaults to "backends", "transactions", "queries",
4498 "query_plans", "table_states", "disk_io" and "disk_usage" (unless a B<Writer>
4499 has been specified). Else, the specified queries are used only.
4501 =item B<Writer> I<writer>
4503 Assigns the specified I<writer> backend to the database connection. This
4504 causes all collected data to be send to the database using the settings
4505 defined in the writer configuration (see the section "FILTER CONFIGURATION"
4506 below for details on how to selectively send data to certain plugins).
4508 Each writer will register a flush callback which may be used when having long
4509 transactions enabled (see the B<CommitInterval> option above). When issuing
4510 the B<FLUSH> command (see L<collectd-unixsock(5)> for details) the current
4511 transaction will be committed right away. Two different kinds of flush
4512 callbacks are available with the C<postgresql> plugin:
4514 =over 4
4516 =item B<postgresql>
4518 Flush all writer backends.
4520 =item B<postgresql->I<database>
4522 Flush all writers of the specified I<database> only.
4524 =back
4526 =back
4528 =head2 Plugin C<powerdns>
4530 The C<powerdns> plugin queries statistics from an authoritative PowerDNS
4531 nameserver and/or a PowerDNS recursor. Since both offer a wide variety of
4532 values, many of which are probably meaningless to most users, but may be useful
4533 for some. So you may chose which values to collect, but if you don't, some
4534 reasonable defaults will be collected.
4536   <Plugin "powerdns">
4537     <Server "server_name">
4538       Collect "latency"
4539       Collect "udp-answers" "udp-queries"
4540       Socket "/var/run/pdns.controlsocket"
4541     </Server>
4542     <Recursor "recursor_name">
4543       Collect "questions"
4544       Collect "cache-hits" "cache-misses"
4545       Socket "/var/run/pdns_recursor.controlsocket"
4546     </Recursor>
4547     LocalSocket "/opt/collectd/var/run/collectd-powerdns"
4548   </Plugin>
4550 =over 4
4552 =item B<Server> and B<Recursor> block
4554 The B<Server> block defines one authoritative server to query, the B<Recursor>
4555 does the same for an recursing server. The possible options in both blocks are
4556 the same, though. The argument defines a name for the serverE<nbsp>/ recursor
4557 and is required.
4559 =over 4
4561 =item B<Collect> I<Field>
4563 Using the B<Collect> statement you can select which values to collect. Here,
4564 you specify the name of the values as used by the PowerDNS servers, e.E<nbsp>g.
4565 C<dlg-only-drops>, C<answers10-100>.
4567 The method of getting the values differs for B<Server> and B<Recursor> blocks:
4568 When querying the server a C<SHOW *> command is issued in any case, because
4569 that's the only way of getting multiple values out of the server at once.
4570 collectd then picks out the values you have selected. When querying the
4571 recursor, a command is generated to query exactly these values. So if you
4572 specify invalid fields when querying the recursor, a syntax error may be
4573 returned by the daemon and collectd may not collect any values at all.
4575 If no B<Collect> statement is given, the following B<Server> values will be
4576 collected:
4578 =over 4
4580 =item latency
4582 =item packetcache-hit
4584 =item packetcache-miss
4586 =item packetcache-size
4588 =item query-cache-hit
4590 =item query-cache-miss
4592 =item recursing-answers
4594 =item recursing-questions
4596 =item tcp-answers
4598 =item tcp-queries
4600 =item udp-answers
4602 =item udp-queries
4604 =back
4606 The following B<Recursor> values will be collected by default:
4608 =over 4
4610 =item noerror-answers
4612 =item nxdomain-answers
4614 =item servfail-answers
4616 =item sys-msec
4618 =item user-msec
4620 =item qa-latency
4622 =item cache-entries
4624 =item cache-hits
4626 =item cache-misses
4628 =item questions
4630 =back
4632 Please note that up to that point collectd doesn't know what values are
4633 available on the server and values that are added do not need a change of the
4634 mechanism so far. However, the values must be mapped to collectd's naming
4635 scheme, which is done using a lookup table that lists all known values. If
4636 values are added in the future and collectd does not know about them, you will
4637 get an error much like this:
4639   powerdns plugin: submit: Not found in lookup table: foobar = 42
4641 In this case please file a bug report with the collectd team.
4643 =item B<Socket> I<Path>
4645 Configures the path to the UNIX domain socket to be used when connecting to the
4646 daemon. By default C<${localstatedir}/run/pdns.controlsocket> will be used for
4647 an authoritative server and C<${localstatedir}/run/pdns_recursor.controlsocket>
4648 will be used for the recursor.
4650 =back
4652 =item B<LocalSocket> I<Path>
4654 Querying the recursor is done using UDP. When using UDP over UNIX domain
4655 sockets, the client socket needs a name in the file system, too. You can set
4656 this local name to I<Path> using the B<LocalSocket> option. The default is
4657 C<I<prefix>/var/run/collectd-powerdns>.
4659 =back
4661 =head2 Plugin C<processes>
4663 =over 4
4665 =item B<Process> I<Name>
4667 Select more detailed statistics of processes matching this name. The statistics
4668 collected for these selected processes are size of the resident segment size
4669 (RSS), user- and system-time used, number of processes and number of threads,
4670 io data (where available) and minor and major pagefaults.
4672 =item B<ProcessMatch> I<name> I<regex>
4674 Similar to the B<Process> option this allows to select more detailed
4675 statistics of processes matching the specified I<regex> (see L<regex(7)> for
4676 details). The statistics of all matching processes are summed up and
4677 dispatched to the daemon using the specified I<name> as an identifier. This
4678 allows to "group" several processes together. I<name> must not contain
4679 slashes.
4681 =back
4683 =head2 Plugin C<protocols>
4685 Collects a lot of information about various network protocols, such as I<IP>,
4686 I<TCP>, I<UDP>, etc.
4688 Available configuration options:
4690 =over 4
4692 =item B<Value> I<Selector>
4694 Selects whether or not to select a specific value. The string being matched is
4695 of the form "I<Protocol>:I<ValueName>", where I<Protocol> will be used as the
4696 plugin instance and I<ValueName> will be used as type instance. An example of
4697 the string being used would be C<Tcp:RetransSegs>.
4699 You can use regular expressions to match a large number of values with just one
4700 configuration option. To select all "extended" I<TCP> values, you could use the
4701 following statement:
4703   Value "/^TcpExt:/"
4705 Whether only matched values are selected or all matched values are ignored
4706 depends on the B<IgnoreSelected>. By default, only matched values are selected.
4707 If no value is configured at all, all values will be selected.
4709 =item B<IgnoreSelected> B<true>|B<false>
4711 If set to B<true>, inverts the selection made by B<Value>, i.E<nbsp>e. all
4712 matching values will be ignored.
4714 =back
4716 =head2 Plugin C<python>
4718 This plugin embeds a Python-interpreter into collectd and provides an interface
4719 to collectd's plugin system. See L<collectd-python(5)> for its documentation.
4721 =head2 Plugin C<routeros>
4723 The C<routeros> plugin connects to a device running I<RouterOS>, the
4724 Linux-based operating system for routers by I<MikroTik>. The plugin uses
4725 I<librouteros> to connect and reads information about the interfaces and
4726 wireless connections of the device. The configuration supports querying
4727 multiple routers:
4729   <Plugin "routeros">
4730     <Router>
4731       Host "router0.example.com"
4732       User "collectd"
4733       Password "secr3t"
4734       CollectInterface true
4735       CollectCPULoad true
4736       CollectMemory true
4737     </Router>
4738     <Router>
4739       Host "router1.example.com"
4740       User "collectd"
4741       Password "5ecret"
4742       CollectInterface true
4743       CollectRegistrationTable true
4744       CollectDF true
4745       CollectDisk true
4746     </Router>
4747   </Plugin>
4749 As you can see above, the configuration of the I<routeros> plugin consists of
4750 one or more B<E<lt>RouterE<gt>> blocks. Within each block, the following
4751 options are understood:
4753 =over 4
4755 =item B<Host> I<Host>
4757 Hostname or IP-address of the router to connect to.
4759 =item B<Port> I<Port>
4761 Port name or port number used when connecting. If left unspecified, the default
4762 will be chosen by I<librouteros>, currently "8728". This option expects a
4763 string argument, even when a numeric port number is given.
4765 =item B<User> I<User>
4767 Use the user name I<User> to authenticate. Defaults to "admin".
4769 =item B<Password> I<Password>
4771 Set the password used to authenticate.
4773 =item B<CollectInterface> B<true>|B<false>
4775 When set to B<true>, interface statistics will be collected for all interfaces
4776 present on the device. Defaults to B<false>.
4778 =item B<CollectRegistrationTable> B<true>|B<false>
4780 When set to B<true>, information about wireless LAN connections will be
4781 collected. Defaults to B<false>.
4783 =item B<CollectCPULoad> B<true>|B<false>
4785 When set to B<true>, information about the CPU usage will be collected. The
4786 number is a dimensionless value where zero indicates no CPU usage at all.
4787 Defaults to B<false>.
4789 =item B<CollectMemory> B<true>|B<false>
4791 When enabled, the amount of used and free memory will be collected. How used
4792 memory is calculated is unknown, for example whether or not caches are counted
4793 as used space.
4794 Defaults to B<false>.
4796 =item B<CollectDF> B<true>|B<false>
4798 When enabled, the amount of used and free disk space will be collected.
4799 Defaults to B<false>.
4801 =item B<CollectDisk> B<true>|B<false>
4803 When enabled, the number of sectors written and bad blocks will be collected.
4804 Defaults to B<false>.
4806 =back
4808 =head2 Plugin C<redis>
4810 The I<Redis plugin> connects to one or more Redis servers and gathers
4811 information about each server's state. For each server there is a I<Node> block
4812 which configures the connection parameters for this node.
4814   <Plugin redis>
4815     <Node "example">
4816         Host "localhost"
4817         Port "6379"
4818         Timeout 2000
4819     </Node>
4820   </Plugin>
4822 The information shown in the synopsis above is the I<default configuration>
4823 which is used by the plugin if no configuration is present.
4825 =over 4
4827 =item B<Node> I<Nodename>
4829 The B<Node> block identifies a new Redis node, that is a new Redis instance
4830 running in an specified host and port. The name for node is a canonical
4831 identifier which is used as I<plugin instance>. It is limited to
4832 64E<nbsp>characters in length.
4834 =item B<Host> I<Hostname>
4836 The B<Host> option is the hostname or IP-address where the Redis instance is
4837 running on.
4839 =item B<Port> I<Port>
4841 The B<Port> option is the TCP port on which the Redis instance accepts
4842 connections. Either a service name of a port number may be given. Please note
4843 that numerical port numbers must be given as a string, too.
4845 =item B<Password> I<Password>
4847 Use I<Password> to authenticate when connecting to I<Redis>.
4849 =item B<Timeout> I<Timeout in miliseconds>
4851 The B<Timeout> option set the socket timeout for node response. Since the Redis
4852 read function is blocking, you should keep this value as low as possible. Keep
4853 in mind that the sum of all B<Timeout> values for all B<Nodes> should be lower
4854 than B<Interval> defined globally.
4856 =back
4858 =head2 Plugin C<rrdcached>
4860 The C<rrdcached> plugin uses the RRDtool accelerator daemon, L<rrdcached(1)>,
4861 to store values to RRD files in an efficient manner. The combination of the
4862 C<rrdcached> B<plugin> and the C<rrdcached> B<daemon> is very similar to the
4863 way the C<rrdtool> plugin works (see below). The added abstraction layer
4864 provides a number of benefits, though: Because the cache is not within
4865 C<collectd> anymore, it does not need to be flushed when C<collectd> is to be
4866 restarted. This results in much shorter (if any) gaps in graphs, especially
4867 under heavy load. Also, the C<rrdtool> command line utility is aware of the
4868 daemon so that it can flush values to disk automatically when needed. This
4869 allows to integrate automated flushing of values into graphing solutions much
4870 more easily.
4872 There are disadvantages, though: The daemon may reside on a different host, so
4873 it may not be possible for C<collectd> to create the appropriate RRD files
4874 anymore. And even if C<rrdcached> runs on the same host, it may run in a
4875 different base directory, so relative paths may do weird stuff if you're not
4876 careful.
4878 So the B<recommended configuration> is to let C<collectd> and C<rrdcached> run
4879 on the same host, communicating via a UNIX domain socket. The B<DataDir>
4880 setting should be set to an absolute path, so that a changed base directory
4881 does not result in RRD files being createdE<nbsp>/ expected in the wrong place.
4883 =over 4
4885 =item B<DaemonAddress> I<Address>
4887 Address of the daemon as understood by the C<rrdc_connect> function of the RRD
4888 library. See L<rrdcached(1)> for details. Example:
4890   <Plugin "rrdcached">
4891     DaemonAddress "unix:/var/run/rrdcached.sock"
4892   </Plugin>
4894 =item B<DataDir> I<Directory>
4896 Set the base directory in which the RRD files reside. If this is a relative
4897 path, it is relative to the working base directory of the C<rrdcached> daemon!
4898 Use of an absolute path is recommended.
4900 =item B<CreateFiles> B<true>|B<false>
4902 Enables or disables the creation of RRD files. If the daemon is not running
4903 locally, or B<DataDir> is set to a relative path, this will not work as
4904 expected. Default is B<true>.
4906 =item B<CreateFilesAsync> B<false>|B<true>
4908 When enabled, new RRD files are enabled asynchronously, using a separate thread
4909 that runs in the background. This prevents writes to block, which is a problem
4910 especially when many hundreds of files need to be created at once. However,
4911 since the purpose of creating the files asynchronously is I<not> to block until
4912 the file is available, values before the file is available will be discarded.
4913 When disabled (the default) files are created synchronously, blocking for a
4914 short while, while the file is being written.
4916 =item B<StepSize> I<Seconds>
4918 B<Force> the stepsize of newly created RRD-files. Ideally (and per default)
4919 this setting is unset and the stepsize is set to the interval in which the data
4920 is collected. Do not use this option unless you absolutely have to for some
4921 reason. Setting this option may cause problems with the C<snmp plugin>, the
4922 C<exec plugin> or when the daemon is set up to receive data from other hosts.
4924 =item B<HeartBeat> I<Seconds>
4926 B<Force> the heartbeat of newly created RRD-files. This setting should be unset
4927 in which case the heartbeat is set to twice the B<StepSize> which should equal
4928 the interval in which data is collected. Do not set this option unless you have
4929 a very good reason to do so.
4931 =item B<RRARows> I<NumRows>
4933 The C<rrdtool plugin> calculates the number of PDPs per CDP based on the
4934 B<StepSize>, this setting and a timespan. This plugin creates RRD-files with
4935 three times five RRAs, i. e. five RRAs with the CFs B<MIN>, B<AVERAGE>, and
4936 B<MAX>. The five RRAs are optimized for graphs covering one hour, one day, one
4937 week, one month, and one year.
4939 So for each timespan, it calculates how many PDPs need to be consolidated into
4940 one CDP by calculating:
4941   number of PDPs = timespan / (stepsize * rrarows)
4943 Bottom line is, set this no smaller than the width of you graphs in pixels. The
4944 default is 1200.
4946 =item B<RRATimespan> I<Seconds>
4948 Adds an RRA-timespan, given in seconds. Use this option multiple times to have
4949 more then one RRA. If this option is never used, the built-in default of (3600,
4950 86400, 604800, 2678400, 31622400) is used.
4952 For more information on how RRA-sizes are calculated see B<RRARows> above.
4954 =item B<XFF> I<Factor>
4956 Set the "XFiles Factor". The default is 0.1. If unsure, don't set this option.
4957 I<Factor> must be in the range C<[0.0-1.0)>, i.e. between zero (inclusive) and
4958 one (exclusive).
4960 =back
4962 =head2 Plugin C<rrdtool>
4964 You can use the settings B<StepSize>, B<HeartBeat>, B<RRARows>, and B<XFF> to
4965 fine-tune your RRD-files. Please read L<rrdcreate(1)> if you encounter problems
4966 using these settings. If you don't want to dive into the depths of RRDtool, you
4967 can safely ignore these settings.
4969 =over 4
4971 =item B<DataDir> I<Directory>
4973 Set the directory to store RRD files under. By default RRD files are generated
4974 beneath the daemon's working directory, i.e. the B<BaseDir>.
4976 =item B<CreateFilesAsync> B<false>|B<true>
4978 When enabled, new RRD files are enabled asynchronously, using a separate thread
4979 that runs in the background. This prevents writes to block, which is a problem
4980 especially when many hundreds of files need to be created at once. However,
4981 since the purpose of creating the files asynchronously is I<not> to block until
4982 the file is available, values before the file is available will be discarded.
4983 When disabled (the default) files are created synchronously, blocking for a
4984 short while, while the file is being written.
4986 =item B<StepSize> I<Seconds>
4988 B<Force> the stepsize of newly created RRD-files. Ideally (and per default)
4989 this setting is unset and the stepsize is set to the interval in which the data
4990 is collected. Do not use this option unless you absolutely have to for some
4991 reason. Setting this option may cause problems with the C<snmp plugin>, the
4992 C<exec plugin> or when the daemon is set up to receive data from other hosts.
4994 =item B<HeartBeat> I<Seconds>
4996 B<Force> the heartbeat of newly created RRD-files. This setting should be unset
4997 in which case the heartbeat is set to twice the B<StepSize> which should equal
4998 the interval in which data is collected. Do not set this option unless you have
4999 a very good reason to do so.
5001 =item B<RRARows> I<NumRows>
5003 The C<rrdtool plugin> calculates the number of PDPs per CDP based on the
5004 B<StepSize>, this setting and a timespan. This plugin creates RRD-files with
5005 three times five RRAs, i.e. five RRAs with the CFs B<MIN>, B<AVERAGE>, and
5006 B<MAX>. The five RRAs are optimized for graphs covering one hour, one day, one
5007 week, one month, and one year.
5009 So for each timespan, it calculates how many PDPs need to be consolidated into
5010 one CDP by calculating:
5011   number of PDPs = timespan / (stepsize * rrarows)
5013 Bottom line is, set this no smaller than the width of you graphs in pixels. The
5014 default is 1200.
5016 =item B<RRATimespan> I<Seconds>
5018 Adds an RRA-timespan, given in seconds. Use this option multiple times to have
5019 more then one RRA. If this option is never used, the built-in default of (3600,
5020 86400, 604800, 2678400, 31622400) is used.
5022 For more information on how RRA-sizes are calculated see B<RRARows> above.
5024 =item B<XFF> I<Factor>
5026 Set the "XFiles Factor". The default is 0.1. If unsure, don't set this option.
5027 I<Factor> must be in the range C<[0.0-1.0)>, i.e. between zero (inclusive) and
5028 one (exclusive).
5030 =item B<CacheFlush> I<Seconds>
5032 When the C<rrdtool> plugin uses a cache (by setting B<CacheTimeout>, see below)
5033 it writes all values for a certain RRD-file if the oldest value is older than
5034 (or equal to) the number of seconds specified. If some RRD-file is not updated
5035 anymore for some reason (the computer was shut down, the network is broken,
5036 etc.) some values may still be in the cache. If B<CacheFlush> is set, then the
5037 entire cache is searched for entries older than B<CacheTimeout> seconds and
5038 written to disk every I<Seconds> seconds. Since this is kind of expensive and
5039 does nothing under normal circumstances, this value should not be too small.
5040 900 seconds might be a good value, though setting this to 7200 seconds doesn't
5041 normally do much harm either.
5043 =item B<CacheTimeout> I<Seconds>
5045 If this option is set to a value greater than zero, the C<rrdtool plugin> will
5046 save values in a cache, as described above. Writing multiple values at once
5047 reduces IO-operations and thus lessens the load produced by updating the files.
5048 The trade off is that the graphs kind of "drag behind" and that more memory is
5049 used.
5051 =item B<WritesPerSecond> I<Updates>
5053 When collecting many statistics with collectd and the C<rrdtool> plugin, you
5054 will run serious performance problems. The B<CacheFlush> setting and the
5055 internal update queue assert that collectd continues to work just fine even
5056 under heavy load, but the system may become very unresponsive and slow. This is
5057 a problem especially if you create graphs from the RRD files on the same
5058 machine, for example using the C<graph.cgi> script included in the
5059 C<contrib/collection3/> directory.
5061 This setting is designed for very large setups. Setting this option to a value
5062 between 25 and 80 updates per second, depending on your hardware, will leave
5063 the server responsive enough to draw graphs even while all the cached values
5064 are written to disk. Flushed values, i.E<nbsp>e. values that are forced to disk
5065 by the B<FLUSH> command, are B<not> effected by this limit. They are still
5066 written as fast as possible, so that web frontends have up to date data when
5067 generating graphs.
5069 For example: If you have 100,000 RRD files and set B<WritesPerSecond> to 30
5070 updates per second, writing all values to disk will take approximately
5071 56E<nbsp>minutes. Together with the flushing ability that's integrated into
5072 "collection3" you'll end up with a responsive and fast system, up to date
5073 graphs and basically a "backup" of your values every hour.
5075 =item B<RandomTimeout> I<Seconds>
5077 When set, the actual timeout for each value is chosen randomly between
5078 I<CacheTimeout>-I<RandomTimeout> and I<CacheTimeout>+I<RandomTimeout>. The
5079 intention is to avoid high load situations that appear when many values timeout
5080 at the same time. This is especially a problem shortly after the daemon starts,
5081 because all values were added to the internal cache at roughly the same time.
5083 =back
5085 =head2 Plugin C<sensors>
5087 The I<Sensors plugin> uses B<lm_sensors> to retrieve sensor-values. This means
5088 that all the needed modules have to be loaded and lm_sensors has to be
5089 configured (most likely by editing F</etc/sensors.conf>. Read
5090 L<sensors.conf(5)> for details.
5092 The B<lm_sensors> homepage can be found at
5093 L<http://secure.netroedge.com/~lm78/>.
5095 =over 4
5097 =item B<SensorConfigFile> I<File>
5099 Read the I<lm_sensors> configuration from I<File>. When unset (recommended),
5100 the library's default will be used.
5102 =item B<Sensor> I<chip-bus-address/type-feature>
5104 Selects the name of the sensor which you want to collect or ignore, depending
5105 on the B<IgnoreSelected> below. For example, the option "B<Sensor>
5106 I<it8712-isa-0290/voltage-in1>" will cause collectd to gather data for the
5107 voltage sensor I<in1> of the I<it8712> on the isa bus at the address 0290.
5109 =item B<IgnoreSelected> I<true>|I<false>
5111 If no configuration if given, the B<sensors>-plugin will collect data from all
5112 sensors. This may not be practical, especially for uninteresting sensors.
5113 Thus, you can use the B<Sensor>-option to pick the sensors you're interested
5114 in. Sometimes, however, it's easier/preferred to collect all sensors I<except> a
5115 few ones. This option enables you to do that: By setting B<IgnoreSelected> to
5116 I<true> the effect of B<Sensor> is inverted: All selected sensors are ignored
5117 and all other sensors are collected.
5119 =back
5121 =head2 Plugin C<snmp>
5123 Since the configuration of the C<snmp plugin> is a little more complicated than
5124 other plugins, its documentation has been moved to an own manpage,
5125 L<collectd-snmp(5)>. Please see there for details.
5127 =head2 Plugin C<swap>
5129 The I<Swap plugin> collects information about used and available swap space. On
5130 I<Linux> and I<Solaris>, the following options are available:
5132 =over 4
5134 =item B<ReportByDevice> B<false>|B<true>
5136 Configures how to report physical swap devices. If set to B<false> (the
5137 default), the summary over all swap devices is reported only, i.e. the globally
5138 used and available space over all devices. If B<true> is configured, the used
5139 and available space of each device will be reported separately.
5141 This option is only available if the I<Swap plugin> can read C</proc/swaps>
5142 (under Linux) or use the L<swapctl(2)> mechanism (under I<Solaris>).
5144 =item B<ReportBytes> B<false>|B<true>
5146 When enabled, the I<swap I/O> is reported in bytes. When disabled, the default,
5147 I<swap I/O> is reported in pages. This option is available under Linux only.
5149 =back
5151 =head2 Plugin C<syslog>
5153 =over 4
5155 =item B<LogLevel> B<debug|info|notice|warning|err>
5157 Sets the log-level. If, for example, set to B<notice>, then all events with
5158 severity B<notice>, B<warning>, or B<err> will be submitted to the
5159 syslog-daemon.
5161 Please note that B<debug> is only available if collectd has been compiled with
5162 debugging support.
5164 =item B<NotifyLevel> B<OKAY>|B<WARNING>|B<FAILURE>
5166 Controls which notifications should be sent to syslog. The default behaviour is
5167 not to send any. Less severe notifications always imply logging more severe
5168 notifications: Setting this to B<OKAY> means all notifications will be sent to
5169 syslog, setting this to B<WARNING> will send B<WARNING> and B<FAILURE>
5170 notifications but will dismiss B<OKAY> notifications. Setting this option to
5171 B<FAILURE> will only send failures to syslog.
5173 =back
5175 =head2 Plugin C<table>
5177 The C<table plugin> provides generic means to parse tabular data and dispatch
5178 user specified values. Values are selected based on column numbers. For
5179 example, this plugin may be used to get values from the Linux L<proc(5)>
5180 filesystem or CSV (comma separated values) files.
5182   <Plugin table>
5183     <Table "/proc/slabinfo">
5184       Instance "slabinfo"
5185       Separator " "
5186       <Result>
5187         Type gauge
5188         InstancePrefix "active_objs"
5189         InstancesFrom 0
5190         ValuesFrom 1
5191       </Result>
5192       <Result>
5193         Type gauge
5194         InstancePrefix "objperslab"
5195         InstancesFrom 0
5196         ValuesFrom 4
5197       </Result>
5198     </Table>
5199   </Plugin>
5201 The configuration consists of one or more B<Table> blocks, each of which
5202 configures one file to parse. Within each B<Table> block, there are one or
5203 more B<Result> blocks, which configure which data to select and how to
5204 interpret it.
5206 The following options are available inside a B<Table> block:
5208 =over 4
5210 =item B<Instance> I<instance>
5212 If specified, I<instance> is used as the plugin instance. So, in the above
5213 example, the plugin name C<table-slabinfo> would be used. If omitted, the
5214 filename of the table is used instead, with all special characters replaced
5215 with an underscore (C<_>).
5217 =item B<Separator> I<string>
5219 Any character of I<string> is interpreted as a delimiter between the different
5220 columns of the table. A sequence of two or more contiguous delimiters in the
5221 table is considered to be a single delimiter, i.E<nbsp>e. there cannot be any
5222 empty columns. The plugin uses the L<strtok_r(3)> function to parse the lines
5223 of a table - see its documentation for more details. This option is mandatory.
5225 A horizontal tab, newline and carriage return may be specified by C<\\t>,
5226 C<\\n> and C<\\r> respectively. Please note that the double backslashes are
5227 required because of collectd's config parsing.
5229 =back
5231 The following options are available inside a B<Result> block:
5233 =over 4
5235 =item B<Type> I<type>
5237 Sets the type used to dispatch the values to the daemon. Detailed information
5238 about types and their configuration can be found in L<types.db(5)>. This
5239 option is mandatory.
5241 =item B<InstancePrefix> I<prefix>
5243 If specified, prepend I<prefix> to the type instance. If omitted, only the
5244 B<InstancesFrom> option is considered for the type instance.
5246 =item B<InstancesFrom> I<column0> [I<column1> ...]
5248 If specified, the content of the given columns (identified by the column
5249 number starting at zero) will be used to create the type instance for each
5250 row. Multiple values (and the instance prefix) will be joined together with
5251 dashes (I<->) as separation character. If omitted, only the B<InstancePrefix>
5252 option is considered for the type instance.
5254 The plugin itself does not check whether or not all built instances are
5255 different. It’s your responsibility to assure that each is unique. This is
5256 especially true, if you do not specify B<InstancesFrom>: B<You> have to make
5257 sure that the table only contains one row.
5259 If neither B<InstancePrefix> nor B<InstancesFrom> is given, the type instance
5260 will be empty.
5262 =item B<ValuesFrom> I<column0> [I<column1> ...]
5264 Specifies the columns (identified by the column numbers starting at zero)
5265 whose content is used as the actual data for the data sets that are dispatched
5266 to the daemon. How many such columns you need is determined by the B<Type>
5267 setting above. If you specify too many or not enough columns, the plugin will
5268 complain about that and no data will be submitted to the daemon. The plugin
5269 uses L<strtoll(3)> and L<strtod(3)> to parse counter and gauge values
5270 respectively, so anything supported by those functions is supported by the
5271 plugin as well. This option is mandatory.
5273 =back
5275 =head2 Plugin C<tail>
5277 The C<tail plugin> follows logfiles, just like L<tail(1)> does, parses
5278 each line and dispatches found values. What is matched can be configured by the
5279 user using (extended) regular expressions, as described in L<regex(7)>.
5281   <Plugin "tail">
5282     <File "/var/log/exim4/mainlog">
5283       Instance "exim"
5284       <Match>
5285         Regex "S=([1-9][0-9]*)"
5286         DSType "CounterAdd"
5287         Type "ipt_bytes"
5288         Instance "total"
5289       </Match>
5290       <Match>
5291         Regex "\\<R=local_user\\>"
5292         ExcludeRegex "\\<R=local_user\\>.*mail_spool defer"
5293         DSType "CounterInc"
5294         Type "counter"
5295         Instance "local_user"
5296       </Match>
5297     </File>
5298   </Plugin>
5300 The config consists of one or more B<File> blocks, each of which configures one
5301 logfile to parse. Within each B<File> block, there are one or more B<Match>
5302 blocks, which configure a regular expression to search for.
5304 The B<Instance> option in the B<File> block may be used to set the plugin
5305 instance. So in the above example the plugin name C<tail-foo> would be used.
5306 This plugin instance is for all B<Match> blocks that B<follow> it, until the
5307 next B<Instance> option. This way you can extract several plugin instances from
5308 one logfile, handy when parsing syslog and the like.
5310 Each B<Match> block has the following options to describe how the match should
5311 be performed:
5313 =over 4
5315 =item B<Regex> I<regex>
5317 Sets the regular expression to use for matching against a line. The first
5318 subexpression has to match something that can be turned into a number by
5319 L<strtoll(3)> or L<strtod(3)>, depending on the value of C<CounterAdd>, see
5320 below. Because B<extended> regular expressions are used, you do not need to use
5321 backslashes for subexpressions! If in doubt, please consult L<regex(7)>. Due to
5322 collectd's config parsing you need to escape backslashes, though. So if you
5323 want to match literal parentheses you need to do the following:
5325   Regex "SPAM \\(Score: (-?[0-9]+\\.[0-9]+)\\)"
5327 =item B<ExcludeRegex> I<regex>
5329 Sets an optional regular expression to use for excluding lines from the match.
5330 An example which excludes all connections from localhost from the match:
5332   ExcludeRegex "127\\.0\\.0\\.1"
5334 =item B<DSType> I<Type>
5336 Sets how the values are cumulated. I<Type> is one of:
5338 =over 4
5340 =item B<GaugeAverage>
5342 Calculate the average.
5344 =item B<GaugeMin>
5346 Use the smallest number only.
5348 =item B<GaugeMax>
5350 Use the greatest number only.
5352 =item B<GaugeLast>
5354 Use the last number found.
5356 =item B<CounterSet>
5358 =item B<DeriveSet>
5360 =item B<AbsoluteSet>
5362 The matched number is a counter. Simply I<sets> the internal counter to this
5363 value. Variants exist for C<COUNTER>, C<DERIVE>, and C<ABSOLUTE> data sources.
5365 =item B<CounterAdd>
5367 =item B<DeriveAdd>
5369 Add the matched value to the internal counter. In case of B<DeriveAdd>, the
5370 matched number may be negative, which will effectively subtract from the
5371 internal counter.
5373 =item B<CounterInc>
5375 =item B<DeriveInc>
5377 Increase the internal counter by one. These B<DSType> are the only ones that do
5378 not use the matched subexpression, but simply count the number of matched
5379 lines. Thus, you may use a regular expression without submatch in this case.
5381 =back
5383 As you'd expect the B<Gauge*> types interpret the submatch as a floating point
5384 number, using L<strtod(3)>. The B<Counter*> and B<AbsoluteSet> types interpret
5385 the submatch as an unsigned integer using L<strtoull(3)>. The B<Derive*> types
5386 interpret the submatch as a signed integer using L<strtoll(3)>. B<CounterInc>
5387 and B<DeriveInc> do not use the submatch at all and it may be omitted in this
5388 case.
5390 =item B<Type> I<Type>
5392 Sets the type used to dispatch this value. Detailed information about types and
5393 their configuration can be found in L<types.db(5)>.
5395 =item B<Instance> I<TypeInstance>
5397 This optional setting sets the type instance to use.
5399 =back
5401 =head2 Plugin C<tail_csv>
5403 The I<tail_csv plugin> reads files in the CSV format, e.g. the statistics file
5404 written by I<Snort>.
5406 B<Synopsis:>
5408  <Plugin "tail_csv">
5409    <Metric "snort-dropped">
5410        Type "percent"
5411        Instance "dropped"
5412        Index 1
5413    </Metric>
5414    <File "/var/log/snort/snort.stats">
5415        Instance "snort-eth0"
5416        Interval 600
5417        Collect "snort-dropped"
5418    </File>
5419  </Plugin>
5421 The configuration consists of one or more B<Metric> blocks that define an index
5422 into the line of the CSV file and how this value is mapped to I<collectd's>
5423 internal representation. These are followed by one or more B<Instance> blocks
5424 which configure which file to read, in which interval and which metrics to
5425 extract.
5427 =over 4
5429 =item E<lt>B<Metric> I<Name>E<gt>
5431 The B<Metric> block configures a new metric to be extracted from the statistics
5432 file and how it is mapped on I<collectd's> data model. The string I<Name> is
5433 only used inside the B<Instance> blocks to refer to this block, so you can use
5434 one B<Metric> block for multiple CSV files.
5436 =over 4
5438 =item B<Type> I<Type>
5440 Configures which I<Type> to use when dispatching this metric. Types are defined
5441 in the L<types.db(5)> file, see the appropriate manual page for more
5442 information on specifying types. Only types with a single I<data source> are
5443 supported by the I<tail_csv plugin>. The information whether the value is an
5444 absolute value (i.e. a C<GAUGE>) or a rate (i.e. a C<DERIVE>) is taken from the
5445 I<Type's> definition.
5447 =item B<Instance> I<TypeInstance>
5449 If set, I<TypeInstance> is used to populate the type instance field of the
5450 created value lists. Otherwise, no type instance is used.
5452 =item B<ValueFrom> I<Index>
5454 Configure to read the value from the field with the zero-based index I<Index>.
5455 If the value is parsed as signed integer, unsigned integer or double depends on
5456 the B<Type> setting, see above.
5458 =back
5460 =item E<lt>B<File> I<Path>E<gt>
5462 Each B<File> block represents one CSV file to read. There must be at least one
5463 I<File> block but there can be multiple if you have multiple CSV files.
5465 =over 4
5467 =item B<Instance> I<PluginInstance>
5469 Sets the I<plugin instance> used when dispatching the values.
5471 =item B<Collect> I<Metric>
5473 Specifies which I<Metric> to collect. This option must be specified at least
5474 once, and you can use this option multiple times to specify more than one
5475 metric to be extracted from this statistic file.
5477 =item B<Interval> I<Seconds>
5479 Configures the interval in which to read values from this instance / file.
5480 Defaults to the plugin's default interval.
5482 =item B<TimeFrom> I<Index>
5484 Rather than using the local time when dispatching a value, read the timestamp
5485 from the field with the zero-based index I<Index>. The value is interpreted as
5486 seconds since epoch. The value is parsed as a double and may be factional.
5488 =back
5490 =back
5492 =head2 Plugin C<teamspeak2>
5494 The C<teamspeak2 plugin> connects to the query port of a teamspeak2 server and
5495 polls interesting global and virtual server data. The plugin can query only one
5496 physical server but unlimited virtual servers. You can use the following
5497 options to configure it:
5499 =over 4
5501 =item B<Host> I<hostname/ip>
5503 The hostname or ip which identifies the physical server.
5504 Default: 127.0.0.1
5506 =item B<Port> I<port>
5508 The query port of the physical server. This needs to be a string.
5509 Default: "51234"
5511 =item B<Server> I<port>
5513 This option has to be added once for every virtual server the plugin should
5514 query. If you want to query the virtual server on port 8767 this is what the
5515 option would look like:
5517   Server "8767"
5519 This option, although numeric, needs to be a string, i.E<nbsp>e. you B<must>
5520 use quotes around it! If no such statement is given only global information
5521 will be collected.
5523 =back
5525 =head2 Plugin C<ted>
5527 The I<TED> plugin connects to a device of "The Energy Detective", a device to
5528 measure power consumption. These devices are usually connected to a serial
5529 (RS232) or USB port. The plugin opens a configured device and tries to read the
5530 current energy readings. For more information on TED, visit
5531 L<http://www.theenergydetective.com/>.
5533 Available configuration options:
5535 =over 4
5537 =item B<Device> I<Path>
5539 Path to the device on which TED is connected. collectd will need read and write
5540 permissions on that file.
5542 Default: B</dev/ttyUSB0>
5544 =item B<Retries> I<Num>
5546 Apparently reading from TED is not that reliable. You can therefore configure a
5547 number of retries here. You only configure the I<retries> here, to if you
5548 specify zero, one reading will be performed (but no retries if that fails); if
5549 you specify three, a maximum of four readings are performed. Negative values
5550 are illegal.
5552 Default: B<0>
5554 =back
5556 =head2 Plugin C<tcpconns>
5558 The C<tcpconns plugin> counts the number of currently established TCP
5559 connections based on the local port and/or the remote port. Since there may be
5560 a lot of connections the default if to count all connections with a local port,
5561 for which a listening socket is opened. You can use the following options to
5562 fine-tune the ports you are interested in:
5564 =over 4
5566 =item B<ListeningPorts> I<true>|I<false>
5568 If this option is set to I<true>, statistics for all local ports for which a
5569 listening socket exists are collected. The default depends on B<LocalPort> and
5570 B<RemotePort> (see below): If no port at all is specifically selected, the
5571 default is to collect listening ports. If specific ports (no matter if local or
5572 remote ports) are selected, this option defaults to I<false>, i.E<nbsp>e. only
5573 the selected ports will be collected unless this option is set to I<true>
5574 specifically.
5576 =item B<LocalPort> I<Port>
5578 Count the connections to a specific local port. This can be used to see how
5579 many connections are handled by a specific daemon, e.E<nbsp>g. the mailserver.
5580 You have to specify the port in numeric form, so for the mailserver example
5581 you'd need to set B<25>.
5583 =item B<RemotePort> I<Port>
5585 Count the connections to a specific remote port. This is useful to see how
5586 much a remote service is used. This is most useful if you want to know how many
5587 connections a local service has opened to remote services, e.E<nbsp>g. how many
5588 connections a mail server or news server has to other mail or news servers, or
5589 how many connections a web proxy holds to web servers. You have to give the
5590 port in numeric form.
5592 =back
5594 =head2 Plugin C<thermal>
5596 =over 4
5598 =item B<ForceUseProcfs> I<true>|I<false>
5600 By default, the I<Thermal plugin> tries to read the statistics from the Linux
5601 C<sysfs> interface. If that is not available, the plugin falls back to the
5602 C<procfs> interface. By setting this option to I<true>, you can force the
5603 plugin to use the latter. This option defaults to I<false>.
5605 =item B<Device> I<Device>
5607 Selects the name of the thermal device that you want to collect or ignore,
5608 depending on the value of the B<IgnoreSelected> option. This option may be
5609 used multiple times to specify a list of devices.
5611 =item B<IgnoreSelected> I<true>|I<false>
5613 Invert the selection: If set to true, all devices B<except> the ones that
5614 match the device names specified by the B<Device> option are collected. By
5615 default only selected devices are collected if a selection is made. If no
5616 selection is configured at all, B<all> devices are selected.
5618 =back
5620 =head2 Plugin C<threshold>
5622 The I<Threshold plugin> checks values collected or received by I<collectd>
5623 against a configurable I<threshold> and issues I<notifications> if values are
5624 out of bounds.
5626 Documentation for this plugin is available in the L<collectd-threshold(5)>
5627 manual page.
5629 =head2 Plugin C<tokyotyrant>
5631 The I<TokyoTyrant plugin> connects to a TokyoTyrant server and collects a
5632 couple metrics: number of records, and database size on disk.
5634 =over 4
5636 =item B<Host> I<Hostname/IP>
5638 The hostname or ip which identifies the server.
5639 Default: B<127.0.0.1>
5641 =item B<Port> I<Service/Port>
5643 The query port of the server. This needs to be a string, even if the port is
5644 given in its numeric form.
5645 Default: B<1978>
5647 =back
5649 =head2 Plugin C<unixsock>
5651 =over 4
5653 =item B<SocketFile> I<Path>
5655 Sets the socket-file which is to be created.
5657 =item B<SocketGroup> I<Group>
5659 If running as root change the group of the UNIX-socket after it has been
5660 created. Defaults to B<collectd>.
5662 =item B<SocketPerms> I<Permissions>
5664 Change the file permissions of the UNIX-socket after it has been created. The
5665 permissions must be given as a numeric, octal value as you would pass to
5666 L<chmod(1)>. Defaults to B<0770>.
5668 =item B<DeleteSocket> B<false>|B<true>
5670 If set to B<true>, delete the socket file before calling L<bind(2)>, if a file
5671 with the given name already exists. If I<collectd> crashes a socket file may be
5672 left over, preventing the daemon from opening a new socket when restarted.
5673 Since this is potentially dangerous, this defaults to B<false>.
5675 =back
5677 =head2 Plugin C<uuid>
5679 This plugin, if loaded, causes the Hostname to be taken from the machine's
5680 UUID. The UUID is a universally unique designation for the machine, usually
5681 taken from the machine's BIOS. This is most useful if the machine is running in
5682 a virtual environment such as Xen, in which case the UUID is preserved across
5683 shutdowns and migration.
5685 The following methods are used to find the machine's UUID, in order:
5687 =over 4
5689 =item
5691 Check I</etc/uuid> (or I<UUIDFile>).
5693 =item
5695 Check for UUID from HAL (L<http://www.freedesktop.org/wiki/Software/hal>) if
5696 present.
5698 =item
5700 Check for UUID from C<dmidecode> / SMBIOS.
5702 =item
5704 Check for UUID from Xen hypervisor.
5706 =back
5708 If no UUID can be found then the hostname is not modified.
5710 =over 4
5712 =item B<UUIDFile> I<Path>
5714 Take the UUID from the given file (default I</etc/uuid>).
5716 =back
5718 =head2 Plugin C<varnish>
5720 The I<varnish plugin> collects information about Varnish, an HTTP accelerator.
5722 Synopsis:
5724  <Plugin "varnish">
5725    <Instance "example">
5726      CollectCache       true
5727      CollectConnections true
5728      CollectBackend     true
5729      CollectSHM         true
5730      CollectESI         false
5731      CollectFetch       false
5732      CollectHCB         false
5733      CollectSMA         false
5734      CollectSMS         false
5735      CollectSM          false
5736      CollectTotals      false
5737      CollectWorkers     false
5738    </Instance>
5739  </Plugin>
5741 The configuration consists of one or more E<lt>B<Instance>E<nbsp>I<Name>E<gt>
5742 blocks. I<Name> is the parameter passed to "varnishd -n". If left empty, it
5743 will collectd statistics from the default "varnishd" instance (this should work
5744 fine in most cases).
5746 Inside each E<lt>B<Instance>E<gt> blocks, the following options are recognized:
5748 =over 4
5750 =item B<CollectCache> B<true>|B<false>
5752 Cache hits and misses. True by default.
5754 =item B<CollectConnections> B<true>|B<false>
5756 Number of client connections received, accepted and dropped. True by default.
5758 =item B<CollectBackend> B<true>|B<false>
5760 Back-end connection statistics, such as successful, reused,
5761 and closed connections. True by default.
5763 =item B<CollectSHM> B<true>|B<false>
5765 Statistics about the shared memory log, a memory region to store
5766 log messages which is flushed to disk when full. True by default.
5768 =item B<CollectBan> B<true>|B<false>
5770 Statistics about ban operations, such as number of bans added, retired, and
5771 number of objects tested against ban operations. Only available with Varnish
5772 3.x. False by default.
5774 =item B<CollectDirectorDNS> B<true>|B<false>
5776 DNS director lookup cache statistics. Only available with Varnish 3.x. False by
5777 default.
5779 =item B<CollectESI> B<true>|B<false>
5781 Edge Side Includes (ESI) parse statistics. False by default.
5783 =item B<CollectFetch> B<true>|B<false>
5785 Statistics about fetches (HTTP requests sent to the backend). False by default.
5787 =item B<CollectHCB> B<true>|B<false>
5789 Inserts and look-ups in the crit bit tree based hash. Look-ups are
5790 divided into locked and unlocked look-ups. False by default.
5792 =item B<CollectObjects> B<true>|B<false>
5794 Statistics on cached objects: number of objects expired, nuked (prematurely
5795 expired), saved, moved, etc. False by default.
5797 =item B<CollectPurge> B<true>|B<false>
5799 Statistics about purge operations, such as number of purges added, retired, and
5800 number of objects tested against purge operations. Only available with Varnish
5801 2.x. False by default.
5803 =item B<CollectSession> B<true>|B<false>
5805 Client session statistics. Number of past and current sessions, session herd and
5806 linger counters, etc. False by default.
5808 =item B<CollectSMA> B<true>|B<false>
5810 malloc or umem (umem_alloc(3MALLOC) based) storage statistics. The umem storage
5811 component is Solaris specific. Only available with Varnish 2.x. False by
5812 default.
5814 =item B<CollectSMS> B<true>|B<false>
5816 synth (synthetic content) storage statistics. This storage
5817 component is used internally only. False by default.
5819 =item B<CollectSM> B<true>|B<false>
5821 file (memory mapped file) storage statistics. Only available with Varnish 2.x.
5822 False by default.
5824 =item B<CollectStruct> B<true>|B<false>
5826 Current varnish internal state statistics. Number of current sessions, objects
5827 in cache store, open connections to backends (with Varnish 2.x), etc. False by
5828 default.
5830 =item B<CollectTotals> B<true>|B<false>
5832 Collects overview counters, such as the number of sessions created,
5833 the number of requests and bytes transferred. False by default.
5835 =item B<CollectUptime> B<true>|B<false>
5837 Varnish uptime. False by default.
5839 =item B<CollectVCL> B<true>|B<false>
5841 Number of total (available + discarded) VCL (config files). False by default.
5843 =item B<CollectWorkers> B<true>|B<false>
5845 Collect statistics about worker threads. False by default.
5847 =back
5849 =head2 Plugin C<vmem>
5851 The C<vmem> plugin collects information about the usage of virtual memory.
5852 Since the statistics provided by the Linux kernel are very detailed, they are
5853 collected very detailed. However, to get all the details, you have to switch
5854 them on manually. Most people just want an overview over, such as the number of
5855 pages read from swap space.
5857 =over 4
5859 =item B<Verbose> B<true>|B<false>
5861 Enables verbose collection of information. This will start collecting page
5862 "actions", e.E<nbsp>g. page allocations, (de)activations, steals and so on.
5863 Part of these statistics are collected on a "per zone" basis.
5865 =back
5867 =head2 Plugin C<vserver>
5869 This plugin doesn't have any options. B<VServer> support is only available for
5870 Linux. It cannot yet be found in a vanilla kernel, though. To make use of this
5871 plugin you need a kernel that has B<VServer> support built in, i.E<nbsp>e. you
5872 need to apply the patches and compile your own kernel, which will then provide
5873 the F</proc/virtual> filesystem that is required by this plugin.
5875 The B<VServer> homepage can be found at L<http://linux-vserver.org/>.
5877 B<Note>: The traffic collected by this plugin accounts for the amount of
5878 traffic passing a socket which might be a lot less than the actual on-wire
5879 traffic (e.E<nbsp>g. due to headers and retransmission). If you want to
5880 collect on-wire traffic you could, for example, use the logging facilities of
5881 iptables to feed data for the guest IPs into the iptables plugin.
5883 =head2 Plugin C<write_graphite>
5885 The C<write_graphite> plugin writes data to I<Graphite>, an open-source metrics
5886 storage and graphing project. The plugin connects to I<Carbon>, the data layer
5887 of I<Graphite>, via I<TCP> or I<UDP> and sends data via the "line based"
5888 protocol (per default using portE<nbsp>2003). The data will be sent in blocks
5889 of at most 1428 bytes to minimize the number of network packets.
5891 Synopsis:
5893  <Plugin write_graphite>
5894    <Node "example">
5895      Host "localhost"
5896      Port "2003"
5897      Protocol "udp"
5898      LogSendErrors true
5899      Prefix "collectd"
5900    </Node>
5901  </Plugin>
5903 The configuration consists of one or more E<lt>B<Node>E<nbsp>I<Name>E<gt>
5904 blocks. Inside the B<Node> blocks, the following options are recognized:
5906 =over 4
5908 =item B<Host> I<Address>
5910 Hostname or address to connect to. Defaults to C<localhost>.
5912 =item B<Port> I<Service>
5914 Service name or port number to connect to. Defaults to C<2003>.
5916 =item B<Protocol> I<String>
5918 Protocol to use when connecting to I<Graphite>. Defaults to C<tcp>.
5920 =item B<LogSendErrors> B<false>|B<true>
5922 If set to B<true> (the default), logs errors when sending data to I<Graphite>.
5923 If set to B<false>, it will not log the errors. This is especially useful when
5924 using Protocol UDP since many times we want to use the "fire-and-forget"
5925 approach and logging errors fills syslog with unneeded messages.
5927 =item B<Prefix> I<String>
5929 When set, I<String> is added in front of the host name. Dots and whitespace are
5930 I<not> escaped in this string (see B<EscapeCharacter> below).
5932 =item B<Postfix> I<String>
5934 When set, I<String> is appended to the host name. Dots and whitespace are
5935 I<not> escaped in this string (see B<EscapeCharacter> below).
5937 =item B<EscapeCharacter> I<Char>
5939 I<Carbon> uses the dot (C<.>) as escape character and doesn't allow whitespace
5940 in the identifier. The B<EscapeCharacter> option determines which character
5941 dots, whitespace and control characters are replaced with. Defaults to
5942 underscore (C<_>).
5944 =item B<StoreRates> B<false>|B<true>
5946 If set to B<true> (the default), convert counter values to rates. If set to
5947 B<false> counter values are stored as is, i.E<nbsp>e. as an increasing integer
5948 number.
5950 =item B<SeparateInstances> B<false>|B<true>
5952 If set to B<true>, the plugin instance and type instance will be in their own
5953 path component, for example C<host.cpu.0.cpu.idle>. If set to B<false> (the
5954 default), the plugin and plugin instance (and likewise the type and type
5955 instance) are put into one component, for example C<host.cpu-0.cpu-idle>.
5957 =item B<AlwaysAppendDS> B<false>|B<true>
5959 If set the B<true>, append the name of the I<Data Source> (DS) to the "metric"
5960 identifier. If set to B<false> (the default), this is only done when there is
5961 more than one DS.
5963 =back
5965 =head2 Plugin C<write_mongodb>
5967 The I<write_mongodb plugin> will send values to I<MongoDB>, a schema-less
5968 NoSQL database.
5970 B<Synopsis:>
5972  <Plugin "write_mongodb">
5973    <Node "default">
5974      Host "localhost"
5975      Port "27017"
5976      Timeout 1000
5977      StoreRates true
5978    </Node>
5979  </Plugin>
5981 The plugin can send values to multiple instances of I<MongoDB> by specifying
5982 one B<Node> block for each instance. Within the B<Node> blocks, the following
5983 options are available:
5985 =over 4
5987 =item B<Host> I<Address>
5989 Hostname or address to connect to. Defaults to C<localhost>.
5991 =item B<Port> I<Service>
5993 Service name or port number to connect to. Defaults to C<27017>.
5995 =item B<Timeout> I<Timeout>
5997 Set the timeout for each operation on I<MongoDB> to I<Timeout> milliseconds.
5998 Setting this option to zero means no timeout, which is the default.
6000 =item B<StoreRates> B<false>|B<true>
6002 If set to B<true> (the default), convert counter values to rates. If set to
6003 B<false> counter values are stored as is, i.e. as an increasing integer
6004 number.
6006 =item B<Database> I<Database>
6008 =item B<User> I<User>
6010 =item B<Password> I<Password>
6012 Sets the information used when authenticating to a I<MongoDB> database. The
6013 fields are optional (in which case no authentication is attempted), but if you
6014 want to use authentication all three fields must be set.
6016 =back
6018 =head2 Plugin C<write_http>
6020 This output plugin submits values to an http server by POST them using the
6021 PUTVAL plain-text protocol. Each destination you want to post data to needs to
6022 have one B<URL> block, within which the destination can be configured further,
6023 for example by specifying authentication data.
6025 Synopsis:
6027  <Plugin "write_http">
6028    <URL "http://example.com/post-collectd">
6029      User "collectd"
6030      Password "weCh3ik0"
6031    </URL>
6032  </Plugin>
6034 B<URL> blocks need one string argument which is used as the URL to which data
6035 is posted. The following options are understood within B<URL> blocks.
6037 =over 4
6039 =item B<User> I<Username>
6041 Optional user name needed for authentication.
6043 =item B<Password> I<Password>
6045 Optional password needed for authentication.
6047 =item B<VerifyPeer> B<true>|B<false>
6049 Enable or disable peer SSL certificate verification. See
6050 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
6052 =item B<VerifyHost> B<true|false>
6054 Enable or disable peer host name verification. If enabled, the plugin checks if
6055 the C<Common Name> or a C<Subject Alternate Name> field of the SSL certificate
6056 matches the host name provided by the B<URL> option. If this identity check
6057 fails, the connection is aborted. Obviously, only works when connecting to a
6058 SSL enabled server. Enabled by default.
6060 =item B<CACert> I<File>
6062 File that holds one or more SSL certificates. If you want to use HTTPS you will
6063 possibly need this option. What CA certificates come bundled with C<libcurl>
6064 and are checked by default depends on the distribution you use.
6066 =item B<Format> B<Command>|B<JSON>
6068 Format of the output to generate. If set to B<Command>, will create output that
6069 is understood by the I<Exec> and I<UnixSock> plugins. When set to B<JSON>, will
6070 create output in the I<JavaScript Object Notation> (JSON).
6072 Defaults to B<Command>.
6074 =item B<StoreRates> B<true|false>
6076 If set to B<true>, convert counter values to rates. If set to B<false> (the
6077 default) counter values are stored as is, i.E<nbsp>e. as an increasing integer
6078 number.
6080 =back
6082 =head2 Plugin C<write_riemann>
6084 The I<write_riemann plugin> will send values to I<Riemann>, a powerfull stream
6085 aggregation and monitoring system. The plugin sends I<Protobuf> encoded data to
6086 I<Riemann> using UDP packets.
6088 Synopsis:
6090  <Plugin "write_riemann">
6091    <Node "example">
6092      Host "localhost"
6093      Port "5555"
6094      Protocol UDP
6095      StoreRates true
6096      AlwaysAppendDS false
6097      TTLFactor 2.0
6098    </Node>
6099    Tag "foobar"
6100  </Plugin>
6102 The following options are understood by the I<write_riemann plugin>:
6104 =over 4
6106 =item E<lt>B<Node> I<Name>E<gt>
6108 The plugin's configuration consists of one or more B<Node> blocks. Each block
6109 is given a unique I<Name> and specifies one connection to an instance of
6110 I<Riemann>. Indise the B<Node> block, the following per-connection options are
6111 understood:
6113 =over 4
6115 =item B<Host> I<Address>
6117 Hostname or address to connect to. Defaults to C<localhost>.
6119 =item B<Port> I<Service>
6121 Service name or port number to connect to. Defaults to C<5555>.
6123 =item B<Protocol> B<UDP>|B<TCP>
6125 Specify the protocol to use when communicating with I<Riemann>. Defaults to
6126 B<UDP>.
6128 =item B<StoreRates> B<true>|B<false>
6130 If set to B<true> (the default), convert counter values to rates. If set to
6131 B<false> counter values are stored as is, i.e. as an increasing integer number.
6133 This will be reflected in the C<ds_type> tag: If B<StoreRates> is enabled,
6134 converted values will have "rate" appended to the data source type, e.g.
6135 C<ds_type:derive:rate>.
6137 =item B<AlwaysAppendDS> B<false>|B<true>
6139 If set the B<true>, append the name of the I<Data Source> (DS) to the
6140 "service", i.e. the field that, together with the "host" field, uniquely
6141 identifies a metric in I<Riemann>. If set to B<false> (the default), this is
6142 only done when there is more than one DS.
6144 =item B<TTLFactor> I<Factor>
6146 I<Riemann> events have a I<Time to Live> (TTL) which specifies how long each
6147 event is considered active. I<collectd> populates this field based on the
6148 metrics interval setting. This setting controls the factor with which the
6149 interval is multiplied to set the TTL. The default value is B<2.0>. Unless you
6150 know exactly what you're doing, you should only increase this setting from its
6151 default value.
6153 =back
6155 =item B<Tag> I<String>
6157 Add the given string as an additional tag to the metric being sent to
6158 I<Riemann>.
6160 =back
6162 =head1 THRESHOLD CONFIGURATION
6164 Starting with version C<4.3.0> collectd has support for B<monitoring>. By that
6165 we mean that the values are not only stored or sent somewhere, but that they
6166 are judged and, if a problem is recognized, acted upon. The only action
6167 collectd takes itself is to generate and dispatch a "notification". Plugins can
6168 register to receive notifications and perform appropriate further actions.
6170 Since systems and what you expect them to do differ a lot, you can configure
6171 B<thresholds> for your values freely. This gives you a lot of flexibility but
6172 also a lot of responsibility.
6174 Every time a value is out of range a notification is dispatched. This means
6175 that the idle percentage of your CPU needs to be less then the configured
6176 threshold only once for a notification to be generated. There's no such thing
6177 as a moving average or similar - at least not now.
6179 Also, all values that match a threshold are considered to be relevant or
6180 "interesting". As a consequence collectd will issue a notification if they are
6181 not received for B<Timeout> iterations. The B<Timeout> configuration option is
6182 explained in section L<"GLOBAL OPTIONS">. If, for example, B<Timeout> is set to
6183 "2" (the default) and some hosts sends it's CPU statistics to the server every
6184 60 seconds, a notification will be dispatched after about 120 seconds. It may
6185 take a little longer because the timeout is checked only once each B<Interval>
6186 on the server.
6188 When a value comes within range again or is received after it was missing, an
6189 "OKAY-notification" is dispatched.
6191 Here is a configuration example to get you started. Read below for more
6192 information.
6194  <Threshold>
6195    <Type "foo">
6196      WarningMin    0.00
6197      WarningMax 1000.00
6198      FailureMin    0.00
6199      FailureMax 1200.00
6200      Invert false
6201      Instance "bar"
6202    </Type>
6204    <Plugin "interface">
6205      Instance "eth0"
6206      <Type "if_octets">
6207        FailureMax 10000000
6208        DataSource "rx"
6209      </Type>
6210    </Plugin>
6212    <Host "hostname">
6213      <Type "cpu">
6214        Instance "idle"
6215        FailureMin 10
6216      </Type>
6218      <Plugin "memory">
6219        <Type "memory">
6220          Instance "cached"
6221          WarningMin 100000000
6222        </Type>
6223      </Plugin>
6224    </Host>
6225  </Threshold>
6227 There are basically two types of configuration statements: The C<Host>,
6228 C<Plugin>, and C<Type> blocks select the value for which a threshold should be
6229 configured. The C<Plugin> and C<Type> blocks may be specified further using the
6230 C<Instance> option. You can combine the block by nesting the blocks, though
6231 they must be nested in the above order, i.E<nbsp>e. C<Host> may contain either
6232 C<Plugin> and C<Type> blocks, C<Plugin> may only contain C<Type> blocks and
6233 C<Type> may not contain other blocks. If multiple blocks apply to the same
6234 value the most specific block is used.
6236 The other statements specify the threshold to configure. They B<must> be
6237 included in a C<Type> block. Currently the following statements are recognized:
6239 =over 4
6241 =item B<FailureMax> I<Value>
6243 =item B<WarningMax> I<Value>
6245 Sets the upper bound of acceptable values. If unset defaults to positive
6246 infinity. If a value is greater than B<FailureMax> a B<FAILURE> notification
6247 will be created. If the value is greater than B<WarningMax> but less than (or
6248 equal to) B<FailureMax> a B<WARNING> notification will be created.
6250 =item B<FailureMin> I<Value>
6252 =item B<WarningMin> I<Value>
6254 Sets the lower bound of acceptable values. If unset defaults to negative
6255 infinity. If a value is less than B<FailureMin> a B<FAILURE> notification will
6256 be created. If the value is less than B<WarningMin> but greater than (or equal
6257 to) B<FailureMin> a B<WARNING> notification will be created.
6259 =item B<DataSource> I<DSName>
6261 Some data sets have more than one "data source". Interesting examples are the
6262 C<if_octets> data set, which has received (C<rx>) and sent (C<tx>) bytes and
6263 the C<disk_ops> data set, which holds C<read> and C<write> operations. The
6264 system load data set, C<load>, even has three data sources: C<shortterm>,
6265 C<midterm>, and C<longterm>.
6267 Normally, all data sources are checked against a configured threshold. If this
6268 is undesirable, or if you want to specify different limits for each data
6269 source, you can use the B<DataSource> option to have a threshold apply only to
6270 one data source.
6272 =item B<Invert> B<true>|B<false>
6274 If set to B<true> the range of acceptable values is inverted, i.E<nbsp>e.
6275 values between B<FailureMin> and B<FailureMax> (B<WarningMin> and
6276 B<WarningMax>) are not okay. Defaults to B<false>.
6278 =item B<Persist> B<true>|B<false>
6280 Sets how often notifications are generated. If set to B<true> one notification
6281 will be generated for each value that is out of the acceptable range. If set to
6282 B<false> (the default) then a notification is only generated if a value is out
6283 of range but the previous value was okay.
6285 This applies to missing values, too: If set to B<true> a notification about a
6286 missing value is generated once every B<Interval> seconds. If set to B<false>
6287 only one such notification is generated until the value appears again.
6289 =item B<Percentage> B<true>|B<false>
6291 If set to B<true>, the minimum and maximum values given are interpreted as
6292 percentage value, relative to the other data sources. This is helpful for
6293 example for the "df" type, where you may want to issue a warning when less than
6294 5E<nbsp>% of the total space is available. Defaults to B<false>.
6296 =item B<Hits> I<Number>
6298 Delay creating the notification until the threshold has been passed I<Number>
6299 times. When a notification has been generated, or when a subsequent value is
6300 inside the threshold, the counter is reset. If, for example, a value is
6301 collected once every 10E<nbsp>seconds and B<Hits> is set to 3, a notification
6302 will be dispatched at most once every 30E<nbsp>seconds.
6304 This is useful when short bursts are not a problem. If, for example, 100% CPU
6305 usage for up to a minute is normal (and data is collected every
6306 10E<nbsp>seconds), you could set B<Hits> to B<6> to account for this.
6308 =item B<Hysteresis> I<Number>
6310 When set to non-zero, a hysteresis value is applied when checking minimum and
6311 maximum bounds. This is useful for values that increase slowly and fluctuate a
6312 bit while doing so. When these values come close to the threshold, they may
6313 "flap", i.e. switch between failure / warning case and okay case repeatedly.
6315 If, for example, the threshold is configures as
6317   WarningMax 100.0
6318   Hysteresis 1.0
6320 then a I<Warning> notification is created when the value exceeds I<101> and the
6321 corresponding I<Okay> notification is only created once the value falls below
6322 I<99>, thus avoiding the "flapping".
6324 =back
6326 =head1 FILTER CONFIGURATION
6328 Starting with collectd 4.6 there is a powerful filtering infrastructure
6329 implemented in the daemon. The concept has mostly been copied from
6330 I<ip_tables>, the packet filter infrastructure for Linux. We'll use a similar
6331 terminology, so that users that are familiar with iptables feel right at home.
6333 =head2 Terminology
6335 The following are the terms used in the remainder of the filter configuration
6336 documentation. For an ASCII-art schema of the mechanism, see
6337 L<"General structure"> below.
6339 =over 4
6341 =item B<Match>
6343 A I<match> is a criteria to select specific values. Examples are, of course, the
6344 name of the value or it's current value.
6346 Matches are implemented in plugins which you have to load prior to using the
6347 match. The name of such plugins starts with the "match_" prefix.
6349 =item B<Target>
6351 A I<target> is some action that is to be performed with data. Such actions
6352 could, for example, be to change part of the value's identifier or to ignore
6353 the value completely.
6355 Some of these targets are built into the daemon, see L<"Built-in targets">
6356 below. Other targets are implemented in plugins which you have to load prior to
6357 using the target. The name of such plugins starts with the "target_" prefix.
6359 =item B<Rule>
6361 The combination of any number of matches and at least one target is called a
6362 I<rule>. The target actions will be performed for all values for which B<all>
6363 matches apply. If the rule does not have any matches associated with it, the
6364 target action will be performed for all values.
6366 =item B<Chain>
6368 A I<chain> is a list of rules and possibly default targets. The rules are tried
6369 in order and if one matches, the associated target will be called. If a value
6370 is handled by a rule, it depends on the target whether or not any subsequent
6371 rules are considered or if traversal of the chain is aborted, see
6372 L<"Flow control"> below. After all rules have been checked, the default targets
6373 will be executed.
6375 =back
6377 =head2 General structure
6379 The following shows the resulting structure:
6381  +---------+
6382  ! Chain   !
6383  +---------+
6384       !
6385       V
6386  +---------+  +---------+  +---------+  +---------+
6387  ! Rule    !->! Match   !->! Match   !->! Target  !
6388  +---------+  +---------+  +---------+  +---------+
6389       !
6390       V
6391  +---------+  +---------+  +---------+
6392  ! Rule    !->! Target  !->! Target  !
6393  +---------+  +---------+  +---------+
6394       !
6395       V
6396       :
6397       :
6398       !
6399       V
6400  +---------+  +---------+  +---------+
6401  ! Rule    !->! Match   !->! Target  !
6402  +---------+  +---------+  +---------+
6403       !
6404       V
6405  +---------+
6406  ! Default !
6407  ! Target  !
6408  +---------+
6410 =head2 Flow control
6412 There are four ways to control which way a value takes through the filter
6413 mechanism:
6415 =over 4
6417 =item B<jump>
6419 The built-in B<jump> target can be used to "call" another chain, i.E<nbsp>e.
6420 process the value with another chain. When the called chain finishes, usually
6421 the next target or rule after the jump is executed.
6423 =item B<stop>
6425 The stop condition, signaled for example by the built-in target B<stop>, causes
6426 all processing of the value to be stopped immediately.
6428 =item B<return>
6430 Causes processing in the current chain to be aborted, but processing of the
6431 value generally will continue. This means that if the chain was called via
6432 B<Jump>, the next target or rule after the jump will be executed. If the chain
6433 was not called by another chain, control will be returned to the daemon and it
6434 may pass the value to another chain.
6436 =item B<continue>
6438 Most targets will signal the B<continue> condition, meaning that processing
6439 should continue normally. There is no special built-in target for this
6440 condition.
6442 =back
6444 =head2 Synopsis
6446 The configuration reflects this structure directly:
6448  PostCacheChain "PostCache"
6449  <Chain "PostCache">
6450    <Rule "ignore_mysql_show">
6451      <Match "regex">
6452        Plugin "^mysql$"
6453        Type "^mysql_command$"
6454        TypeInstance "^show_"
6455      </Match>
6456      <Target "stop">
6457      </Target>
6458    </Rule>
6459    <Target "write">
6460      Plugin "rrdtool"
6461    </Target>
6462  </Chain>
6464 The above configuration example will ignore all values where the plugin field
6465 is "mysql", the type is "mysql_command" and the type instance begins with
6466 "show_". All other values will be sent to the C<rrdtool> write plugin via the
6467 default target of the chain. Since this chain is run after the value has been
6468 added to the cache, the MySQL C<show_*> command statistics will be available
6469 via the C<unixsock> plugin.
6471 =head2 List of configuration options
6473 =over 4
6475 =item B<PreCacheChain> I<ChainName>
6477 =item B<PostCacheChain> I<ChainName>
6479 Configure the name of the "pre-cache chain" and the "post-cache chain". The
6480 argument is the name of a I<chain> that should be executed before and/or after
6481 the values have been added to the cache.
6483 To understand the implications, it's important you know what is going on inside
6484 I<collectd>. The following diagram shows how values are passed from the
6485 read-plugins to the write-plugins:
6487    +---------------+
6488    !  Read-Plugin  !
6489    +-------+-------+
6490            !
6491  + - - - - V - - - - +
6492  : +---------------+ :
6493  : !   Pre-Cache   ! :
6494  : !     Chain     ! :
6495  : +-------+-------+ :
6496  :         !         :
6497  :         V         :
6498  : +-------+-------+ :  +---------------+
6499  : !     Cache     !--->!  Value Cache  !
6500  : !     insert    ! :  +---+---+-------+
6501  : +-------+-------+ :      !   !
6502  :         !   ,------------'   !
6503  :         V   V     :          V
6504  : +-------+---+---+ :  +-------+-------+
6505  : !  Post-Cache   +--->! Write-Plugins !
6506  : !     Chain     ! :  +---------------+
6507  : +---------------+ :
6508  :                   :
6509  :  dispatch values  :
6510  + - - - - - - - - - +
6512 After the values are passed from the "read" plugins to the dispatch functions,
6513 the pre-cache chain is run first. The values are added to the internal cache
6514 afterwards. The post-cache chain is run after the values have been added to the
6515 cache. So why is it such a huge deal if chains are run before or after the
6516 values have been added to this cache?
6518 Targets that change the identifier of a value list should be executed before
6519 the values are added to the cache, so that the name in the cache matches the
6520 name that is used in the "write" plugins. The C<unixsock> plugin, too, uses
6521 this cache to receive a list of all available values. If you change the
6522 identifier after the value list has been added to the cache, this may easily
6523 lead to confusion, but it's not forbidden of course.
6525 The cache is also used to convert counter values to rates. These rates are, for
6526 example, used by the C<value> match (see below). If you use the rate stored in
6527 the cache B<before> the new value is added, you will use the old, B<previous>
6528 rate. Write plugins may use this rate, too, see the C<csv> plugin, for example.
6529 The C<unixsock> plugin uses these rates too, to implement the C<GETVAL>
6530 command.
6532 Last but not last, the B<stop> target makes a difference: If the pre-cache
6533 chain returns the stop condition, the value will not be added to the cache and
6534 the post-cache chain will not be run.
6536 =item B<Chain> I<Name>
6538 Adds a new chain with a certain name. This name can be used to refer to a
6539 specific chain, for example to jump to it.
6541 Within the B<Chain> block, there can be B<Rule> blocks and B<Target> blocks.
6543 =item B<Rule> [I<Name>]
6545 Adds a new rule to the current chain. The name of the rule is optional and
6546 currently has no meaning for the daemon.
6548 Within the B<Rule> block, there may be any number of B<Match> blocks and there
6549 must be at least one B<Target> block.
6551 =item B<Match> I<Name>
6553 Adds a match to a B<Rule> block. The name specifies what kind of match should
6554 be performed. Available matches depend on the plugins that have been loaded.
6556 The arguments inside the B<Match> block are passed to the plugin implementing
6557 the match, so which arguments are valid here depends on the plugin being used.
6558 If you do not need any to pass any arguments to a match, you can use the
6559 shorter syntax:
6561  Match "foobar"
6563 Which is equivalent to:
6565  <Match "foobar">
6566  </Match>
6568 =item B<Target> I<Name>
6570 Add a target to a rule or a default target to a chain. The name specifies what
6571 kind of target is to be added. Which targets are available depends on the
6572 plugins being loaded.
6574 The arguments inside the B<Target> block are passed to the plugin implementing
6575 the target, so which arguments are valid here depends on the plugin being used.
6576 If you do not need any to pass any arguments to a target, you can use the
6577 shorter syntax:
6579  Target "stop"
6581 This is the same as writing:
6583  <Target "stop">
6584  </Target>
6586 =back
6588 =head2 Built-in targets
6590 The following targets are built into the core daemon and therefore need no
6591 plugins to be loaded:
6593 =over 4
6595 =item B<return>
6597 Signals the "return" condition, see the L<"Flow control"> section above. This
6598 causes the current chain to stop processing the value and returns control to
6599 the calling chain. The calling chain will continue processing targets and rules
6600 just after the B<jump> target (see below). This is very similar to the
6601 B<RETURN> target of iptables, see L<iptables(8)>.
6603 This target does not have any options.
6605 Example:
6607  Target "return"
6609 =item B<stop>
6611 Signals the "stop" condition, see the L<"Flow control"> section above. This
6612 causes processing of the value to be aborted immediately. This is similar to
6613 the B<DROP> target of iptables, see L<iptables(8)>.
6615 This target does not have any options.
6617 Example:
6619  Target "stop"
6621 =item B<write>
6623 Sends the value to "write" plugins.
6625 Available options:
6627 =over 4
6629 =item B<Plugin> I<Name>
6631 Name of the write plugin to which the data should be sent. This option may be
6632 given multiple times to send the data to more than one write plugin.
6634 =back
6636 If no plugin is explicitly specified, the values will be sent to all available
6637 write plugins.
6639 Example:
6641  <Target "write">
6642    Plugin "rrdtool"
6643  </Target>
6645 =item B<jump>
6647 Starts processing the rules of another chain, see L<"Flow control"> above. If
6648 the end of that chain is reached, or a stop condition is encountered,
6649 processing will continue right after the B<jump> target, i.E<nbsp>e. with the
6650 next target or the next rule. This is similar to the B<-j> command line option
6651 of iptables, see L<iptables(8)>.
6653 Available options:
6655 =over 4
6657 =item B<Chain> I<Name>
6659 Jumps to the chain I<Name>. This argument is required and may appear only once.
6661 =back
6663 Example:
6665  <Target "jump">
6666    Chain "foobar"
6667  </Target>
6669 =back
6671 =head2 Available matches
6673 =over 4
6675 =item B<regex>
6677 Matches a value using regular expressions.
6679 Available options:
6681 =over 4
6683 =item B<Host> I<Regex>
6685 =item B<Plugin> I<Regex>
6687 =item B<PluginInstance> I<Regex>
6689 =item B<Type> I<Regex>
6691 =item B<TypeInstance> I<Regex>
6693 Match values where the given regular expressions match the various fields of
6694 the identifier of a value. If multiple regular expressions are given, B<all>
6695 regexen must match for a value to match.
6697 =item B<Invert> B<false>|B<true>
6699 When set to B<true>, the result of the match is inverted, i.e. all value lists
6700 where all regular expressions apply are not matched, all other value lists are
6701 matched. Defaults to B<false>.
6703 =back
6705 Example:
6707  <Match "regex">
6708    Host "customer[0-9]+"
6709    Plugin "^foobar$"
6710  </Match>
6712 =item B<timediff>
6714 Matches values that have a time which differs from the time on the server.
6716 This match is mainly intended for servers that receive values over the
6717 C<network> plugin and write them to disk using the C<rrdtool> plugin. RRDtool
6718 is very sensitive to the timestamp used when updating the RRD files. In
6719 particular, the time must be ever increasing. If a misbehaving client sends one
6720 packet with a timestamp far in the future, all further packets with a correct
6721 time will be ignored because of that one packet. What's worse, such corrupted
6722 RRD files are hard to fix.
6724 This match lets one match all values B<outside> a specified time range
6725 (relative to the server's time), so you can use the B<stop> target (see below)
6726 to ignore the value, for example.
6728 Available options:
6730 =over 4
6732 =item B<Future> I<Seconds>
6734 Matches all values that are I<ahead> of the server's time by I<Seconds> or more
6735 seconds. Set to zero for no limit. Either B<Future> or B<Past> must be
6736 non-zero.
6738 =item B<Past> I<Seconds>
6740 Matches all values that are I<behind> of the server's time by I<Seconds> or
6741 more seconds. Set to zero for no limit. Either B<Future> or B<Past> must be
6742 non-zero.
6744 =back
6746 Example:
6748  <Match "timediff">
6749    Future  300
6750    Past   3600
6751  </Match>
6753 This example matches all values that are five minutes or more ahead of the
6754 server or one hour (or more) lagging behind.
6756 =item B<value>
6758 Matches the actual value of data sources against given minimumE<nbsp>/ maximum
6759 values. If a data-set consists of more than one data-source, all data-sources
6760 must match the specified ranges for a positive match.
6762 Available options:
6764 =over 4
6766 =item B<Min> I<Value>
6768 Sets the smallest value which still results in a match. If unset, behaves like
6769 negative infinity.
6771 =item B<Max> I<Value>
6773 Sets the largest value which still results in a match. If unset, behaves like
6774 positive infinity.
6776 =item B<Invert> B<true>|B<false>
6778 Inverts the selection. If the B<Min> and B<Max> settings result in a match,
6779 no-match is returned and vice versa. Please note that the B<Invert> setting
6780 only effects how B<Min> and B<Max> are applied to a specific value. Especially
6781 the B<DataSource> and B<Satisfy> settings (see below) are not inverted.
6783 =item B<DataSource> I<DSName> [I<DSName> ...]
6785 Select one or more of the data sources. If no data source is configured, all
6786 data sources will be checked. If the type handled by the match does not have a
6787 data source of the specified name(s), this will always result in no match
6788 (independent of the B<Invert> setting).
6790 =item B<Satisfy> B<Any>|B<All>
6792 Specifies how checking with several data sources is performed. If set to
6793 B<Any>, the match succeeds if one of the data sources is in the configured
6794 range. If set to B<All> the match only succeeds if all data sources are within
6795 the configured range. Default is B<All>.
6797 Usually B<All> is used for positive matches, B<Any> is used for negative
6798 matches. This means that with B<All> you usually check that all values are in a
6799 "good" range, while with B<Any> you check if any value is within a "bad" range
6800 (or outside the "good" range).
6802 =back
6804 Either B<Min> or B<Max>, but not both, may be unset.
6806 Example:
6808  # Match all values smaller than or equal to 100. Matches only if all data
6809  # sources are below 100.
6810  <Match "value">
6811    Max 100
6812    Satisfy "All"
6813  </Match>
6814  
6815  # Match if the value of any data source is outside the range of 0 - 100.
6816  <Match "value">
6817    Min   0
6818    Max 100
6819    Invert true
6820    Satisfy "Any"
6821  </Match>
6823 =item B<empty_counter>
6825 Matches all values with one or more data sources of type B<COUNTER> and where
6826 all counter values are zero. These counters usually I<never> increased since
6827 they started existing (and are therefore uninteresting), or got reset recently
6828 or overflowed and you had really, I<really> bad luck.
6830 Please keep in mind that ignoring such counters can result in confusing
6831 behavior: Counters which hardly ever increase will be zero for long periods of
6832 time. If the counter is reset for some reason (machine or service restarted,
6833 usually), the graph will be empty (NAN) for a long time. People may not
6834 understand why.
6836 =item B<hashed>
6838 Calculates a hash value of the host name and matches values according to that
6839 hash value. This makes it possible to divide all hosts into groups and match
6840 only values that are in a specific group. The intended use is in load
6841 balancing, where you want to handle only part of all data and leave the rest
6842 for other servers.
6844 The hashing function used tries to distribute the hosts evenly. First, it
6845 calculates a 32E<nbsp>bit hash value using the characters of the hostname:
6847   hash_value = 0;
6848   for (i = 0; host[i] != 0; i++)
6849     hash_value = (hash_value * 251) + host[i];
6851 The constant 251 is a prime number which is supposed to make this hash value
6852 more random. The code then checks the group for this host according to the
6853 I<Total> and I<Match> arguments:
6855   if ((hash_value % Total) == Match)
6856     matches;
6857   else
6858     does not match;
6860 Please note that when you set I<Total> to two (i.E<nbsp>e. you have only two
6861 groups), then the least significant bit of the hash value will be the XOR of
6862 all least significant bits in the host name. One consequence is that when you
6863 have two hosts, "server0.example.com" and "server1.example.com", where the host
6864 name differs in one digit only and the digits differ by one, those hosts will
6865 never end up in the same group.
6867 Available options:
6869 =over 4
6871 =item B<Match> I<Match> I<Total>
6873 Divide the data into I<Total> groups and match all hosts in group I<Match> as
6874 described above. The groups are numbered from zero, i.E<nbsp>e. I<Match> must
6875 be smaller than I<Total>. I<Total> must be at least one, although only values
6876 greater than one really do make any sense.
6878 You can repeat this option to match multiple groups, for example:
6880   Match 3 7
6881   Match 5 7
6883 The above config will divide the data into seven groups and match groups three
6884 and five. One use would be to keep every value on two hosts so that if one
6885 fails the missing data can later be reconstructed from the second host.
6887 =back
6889 Example:
6891  # Operate on the pre-cache chain, so that ignored values are not even in the
6892  # global cache.
6893  <Chain "PreCache">
6894    <Rule>
6895      <Match "hashed">
6896        # Divide all received hosts in seven groups and accept all hosts in
6897        # group three.
6898        Match 3 7
6899      </Match>
6900      # If matched: Return and continue.
6901      Target "return"
6902    </Rule>
6903    # If not matched: Return and stop.
6904    Target "stop"
6905  </Chain>
6907 =back
6909 =head2 Available targets
6911 =over 4
6913 =item B<notification>
6915 Creates and dispatches a notification.
6917 Available options:
6919 =over 4
6921 =item B<Message> I<String>
6923 This required option sets the message of the notification. The following
6924 placeholders will be replaced by an appropriate value:
6926 =over 4
6928 =item B<%{host}>
6930 =item B<%{plugin}>
6932 =item B<%{plugin_instance}>
6934 =item B<%{type}>
6936 =item B<%{type_instance}>
6938 These placeholders are replaced by the identifier field of the same name.
6940 =item B<%{ds:>I<name>B<}>
6942 These placeholders are replaced by a (hopefully) human readable representation
6943 of the current rate of this data source. If you changed the instance name
6944 (using the B<set> or B<replace> targets, see below), it may not be possible to
6945 convert counter values to rates.
6947 =back
6949 Please note that these placeholders are B<case sensitive>!
6951 =item B<Severity> B<"FAILURE">|B<"WARNING">|B<"OKAY">
6953 Sets the severity of the message. If omitted, the severity B<"WARNING"> is
6954 used.
6956 =back
6958 Example:
6960   <Target "notification">
6961     Message "Oops, the %{type_instance} temperature is currently %{ds:value}!"
6962     Severity "WARNING"
6963   </Target>
6965 =item B<replace>
6967 Replaces parts of the identifier using regular expressions.
6969 Available options:
6971 =over 4
6973 =item B<Host> I<Regex> I<Replacement>
6975 =item B<Plugin> I<Regex> I<Replacement>
6977 =item B<PluginInstance> I<Regex> I<Replacement>
6979 =item B<TypeInstance> I<Regex> I<Replacement>
6981 Match the appropriate field with the given regular expression I<Regex>. If the
6982 regular expression matches, that part that matches is replaced with
6983 I<Replacement>. If multiple places of the input buffer match a given regular
6984 expression, only the first occurrence will be replaced.
6986 You can specify each option multiple times to use multiple regular expressions
6987 one after another.
6989 =back
6991 Example:
6993  <Target "replace">
6994    # Replace "example.net" with "example.com"
6995    Host "\\<example.net\\>" "example.com"
6996  
6997    # Strip "www." from hostnames
6998    Host "\\<www\\." ""
6999  </Target>
7001 =item B<set>
7003 Sets part of the identifier of a value to a given string.
7005 Available options:
7007 =over 4
7009 =item B<Host> I<String>
7011 =item B<Plugin> I<String>
7013 =item B<PluginInstance> I<String>
7015 =item B<TypeInstance> I<String>
7017 Set the appropriate field to the given string. The strings for plugin instance
7018 and type instance may be empty, the strings for host and plugin may not be
7019 empty. It's currently not possible to set the type of a value this way.
7021 =back
7023 Example:
7025  <Target "set">
7026    PluginInstance "coretemp"
7027    TypeInstance "core3"
7028  </Target>
7030 =back
7032 =head2 Backwards compatibility
7034 If you use collectd with an old configuration, i.E<nbsp>e. one without a
7035 B<Chain> block, it will behave as it used to. This is equivalent to the
7036 following configuration:
7038  <Chain "PostCache">
7039    Target "write"
7040  </Chain>
7042 If you specify a B<PostCacheChain>, the B<write> target will not be added
7043 anywhere and you will have to make sure that it is called where appropriate. We
7044 suggest to add the above snippet as default target to your "PostCache" chain.
7046 =head2 Examples
7048 Ignore all values, where the hostname does not contain a dot, i.E<nbsp>e. can't
7049 be an FQDN.
7051  <Chain "PreCache">
7052    <Rule "no_fqdn">
7053      <Match "regex">
7054        Host "^[^\.]*$"
7055      </Match>
7056      Target "stop"
7057    </Rule>
7058    Target "write"
7059  </Chain>
7061 =head1 SEE ALSO
7063 L<collectd(1)>,
7064 L<collectd-exec(5)>,
7065 L<collectd-perl(5)>,
7066 L<collectd-unixsock(5)>,
7067 L<types.db(5)>,
7068 L<hddtemp(8)>,
7069 L<iptables(8)>,
7070 L<kstat(3KSTAT)>,
7071 L<mbmon(1)>,
7072 L<psql(1)>,
7073 L<regex(7)>,
7074 L<rrdtool(1)>,
7075 L<sensors(1)>
7077 =head1 AUTHOR
7079 Florian Forster E<lt>octo@verplant.orgE<gt>
7081 =cut