Fix compile time issues
[collectd.git] / src / collectd.conf.pod
1 =encoding UTF-8
2
3 =head1 NAME
4
5 collectd.conf - Configuration for the system statistics collection daemon B<collectd>
6
7 =head1 SYNOPSIS
8
9   BaseDir "/var/lib/collectd"
10   PIDFile "/run/collectd.pid"
11   Interval 10.0
12
13   LoadPlugin cpu
14   LoadPlugin load
15
16   <LoadPlugin df>
17     Interval 3600
18   </LoadPlugin>
19   <Plugin df>
20     ValuesPercentage true
21   </Plugin>
22
23   LoadPlugin ping
24   <Plugin ping>
25     Host "example.org"
26     Host "provider.net"
27   </Plugin>
28
29 =head1 DESCRIPTION
30
31 This config file controls how the system statistics collection daemon
32 B<collectd> behaves. The most significant option is B<LoadPlugin>, which
33 controls which plugins to load. These plugins ultimately define collectd's
34 behavior. If the B<AutoLoadPlugin> option has been enabled, the explicit
35 B<LoadPlugin> lines may be omitted for all plugins with a configuration block,
36 i.e. a C<E<lt>PluginE<nbsp>...E<gt>> block.
37
38 The syntax of this config file is similar to the config file of the famous
39 I<Apache> webserver. Each line contains either an option (a key and a list of
40 one or more values) or a section-start or -end. Empty lines and everything
41 after a non-quoted hash-symbol (C<#>) are ignored. I<Keys> are unquoted
42 strings, consisting only of alphanumeric characters and the underscore (C<_>)
43 character. Keys are handled case insensitive by I<collectd> itself and all
44 plugins included with it. I<Values> can either be an I<unquoted string>, a
45 I<quoted string> (enclosed in double-quotes) a I<number> or a I<boolean>
46 expression. I<Unquoted strings> consist of only alphanumeric characters and
47 underscores (C<_>) and do not need to be quoted. I<Quoted strings> are
48 enclosed in double quotes (C<">). You can use the backslash character (C<\>)
49 to include double quotes as part of the string. I<Numbers> can be specified in
50 decimal and floating point format (using a dot C<.> as decimal separator),
51 hexadecimal when using the C<0x> prefix and octal with a leading zero (C<0>).
52 I<Boolean> values are either B<true> or B<false>.
53
54 Lines may be wrapped by using C<\> as the last character before the newline.
55 This allows long lines to be split into multiple lines. Quoted strings may be
56 wrapped as well. However, those are treated special in that whitespace at the
57 beginning of the following lines will be ignored, which allows for nicely
58 indenting the wrapped lines.
59
60 The configuration is read and processed in order, i.e. from top to bottom. So
61 the plugins are loaded in the order listed in this config file. It is a good
62 idea to load any logging plugins first in order to catch messages from plugins
63 during configuration. Also, unless B<AutoLoadPlugin> is enabled, the
64 B<LoadPlugin> option I<must> occur I<before> the appropriate
65 C<E<lt>B<Plugin> ...E<gt>> block.
66
67 =head1 GLOBAL OPTIONS
68
69 =over 4
70
71 =item B<BaseDir> I<Directory>
72
73 Sets the base directory. This is the directory beneath which all RRD-files are
74 created. Possibly more subdirectories are created. This is also the working
75 directory for the daemon.
76
77 =item B<LoadPlugin> I<Plugin>
78
79 Loads the plugin I<Plugin>. This is required to load plugins, unless the
80 B<AutoLoadPlugin> option is enabled (see below). Without any loaded plugins,
81 I<collectd> will be mostly useless.
82
83 Only the first B<LoadPlugin> statement or block for a given plugin name has any
84 effect. This is useful when you want to split up the configuration into smaller
85 files and want each file to be "self contained", i.e. it contains a B<Plugin>
86 block I<and> the appropriate B<LoadPlugin> statement. The downside is that if
87 you have multiple conflicting B<LoadPlugin> blocks, e.g. when they specify
88 different intervals, only one of them (the first one encountered) will take
89 effect and all others will be silently ignored.
90
91 B<LoadPlugin> may either be a simple configuration I<statement> or a I<block>
92 with additional options, affecting the behavior of B<LoadPlugin>. A simple
93 statement looks like this:
94
95  LoadPlugin "cpu"
96
97 Options inside a B<LoadPlugin> block can override default settings and
98 influence the way plugins are loaded, e.g.:
99
100  <LoadPlugin perl>
101    Interval 60
102  </LoadPlugin>
103
104 The following options are valid inside B<LoadPlugin> blocks:
105
106 =over 4
107
108 =item B<Globals> B<true|false>
109
110 If enabled, collectd will export all global symbols of the plugin (and of all
111 libraries loaded as dependencies of the plugin) and, thus, makes those symbols
112 available for resolving unresolved symbols in subsequently loaded plugins if
113 that is supported by your system.
114
115 This is useful (or possibly even required), e.g., when loading a plugin that
116 embeds some scripting language into the daemon (e.g. the I<Perl> and
117 I<Python plugins>). Scripting languages usually provide means to load
118 extensions written in C. Those extensions require symbols provided by the
119 interpreter, which is loaded as a dependency of the respective collectd plugin.
120 See the documentation of those plugins (e.g., L<collectd-perl(5)> or
121 L<collectd-python(5)>) for details.
122
123 By default, this is disabled. As a special exception, if the plugin name is
124 either C<perl> or C<python>, the default is changed to enabled in order to keep
125 the average user from ever having to deal with this low level linking stuff.
126
127 =item B<Interval> I<Seconds>
128
129 Sets a plugin-specific interval for collecting metrics. This overrides the
130 global B<Interval> setting. If a plugin provides its own support for specifying
131 an interval, that setting will take precedence.
132
133 =item B<FlushInterval> I<Seconds>
134
135 Specifies the interval, in seconds, to call the flush callback if it's
136 defined in this plugin. By default, this is disabled.
137
138 =item B<FlushTimeout> I<Seconds>
139
140 Specifies the value of the timeout argument of the flush callback.
141
142 =back
143
144 =item B<AutoLoadPlugin> B<false>|B<true>
145
146 When set to B<false> (the default), each plugin needs to be loaded explicitly,
147 using the B<LoadPlugin> statement documented above. If a
148 B<E<lt>PluginE<nbsp>...E<gt>> block is encountered and no configuration
149 handling callback for this plugin has been registered, a warning is logged and
150 the block is ignored.
151
152 When set to B<true>, explicit B<LoadPlugin> statements are not required. Each
153 B<E<lt>PluginE<nbsp>...E<gt>> block acts as if it was immediately preceded by a
154 B<LoadPlugin> statement. B<LoadPlugin> statements are still required for
155 plugins that don't provide any configuration, e.g. the I<Load plugin>.
156
157 =item B<CollectInternalStats> B<false>|B<true>
158
159 When set to B<true>, various statistics about the I<collectd> daemon will be
160 collected, with "collectd" as the I<plugin name>. Defaults to B<false>.
161
162 The following metrics are reported:
163
164 =over 4
165
166 =item C<collectd-write_queue/queue_length>
167
168 The number of metrics currently in the write queue. You can limit the queue
169 length with the B<WriteQueueLimitLow> and B<WriteQueueLimitHigh> options.
170
171 =item C<collectd-write_queue/derive-dropped>
172
173 The number of metrics dropped due to a queue length limitation.
174 If this value is non-zero, your system can't handle all incoming metrics and
175 protects itself against overload by dropping metrics.
176
177 =item C<collectd-cache/cache_size>
178
179 The number of elements in the metric cache (the cache you can interact with
180 using L<collectd-unixsock(5)>).
181
182 =back
183
184 =item B<Include> I<Path> [I<pattern>]
185
186 If I<Path> points to a file, includes that file. If I<Path> points to a
187 directory, recursively includes all files within that directory and its
188 subdirectories. If the C<wordexp> function is available on your system,
189 shell-like wildcards are expanded before files are included. This means you can
190 use statements like the following:
191
192   Include "/etc/collectd.d/*.conf"
193
194 Starting with version 5.3, this may also be a block in which further options
195 affecting the behavior of B<Include> may be specified. The following option is
196 currently allowed:
197
198   <Include "/etc/collectd.d">
199     Filter "*.conf"
200   </Include>
201
202 =over 4
203
204 =item B<Filter> I<pattern>
205
206 If the C<fnmatch> function is available on your system, a shell-like wildcard
207 I<pattern> may be specified to filter which files to include. This may be used
208 in combination with recursively including a directory to easily be able to
209 arbitrarily mix configuration files and other documents (e.g. README files).
210 The given example is similar to the first example above but includes all files
211 matching C<*.conf> in any subdirectory of C</etc/collectd.d>.
212
213 =back
214
215 If more than one file is included by a single B<Include> option, the files
216 will be included in lexicographical order (as defined by the C<strcmp>
217 function). Thus, you can e.E<nbsp>g. use numbered prefixes to specify the
218 order in which the files are loaded.
219
220 To prevent loops and shooting yourself in the foot in interesting ways the
221 nesting is limited to a depth of 8E<nbsp>levels, which should be sufficient for
222 most uses. Since symlinks are followed it is still possible to crash the daemon
223 by looping symlinks. In our opinion significant stupidity should result in an
224 appropriate amount of pain.
225
226 It is no problem to have a block like C<E<lt>Plugin fooE<gt>> in more than one
227 file, but you cannot include files from within blocks.
228
229 =item B<PIDFile> I<File>
230
231 Sets where to write the PID file to. This file is overwritten when it exists
232 and deleted when the program is stopped. Some init-scripts might override this
233 setting using the B<-P> command-line option.
234
235 =item B<PluginDir> I<Directory>
236
237 Path to the plugins (shared objects) of collectd.
238
239 =item B<TypesDB> I<File> [I<File> ...]
240
241 Set one or more files that contain the data-set descriptions. See
242 L<types.db(5)> for a description of the format of this file.
243
244 If this option is not specified, a default file is read. If you need to define
245 custom types in addition to the types defined in the default file, you need to
246 explicitly load both. In other words, if the B<TypesDB> option is encountered
247 the default behavior is disabled and if you need the default types you have to
248 also explicitly load them.
249
250 =item B<Interval> I<Seconds>
251
252 Configures the interval in which to query the read plugins. Obviously smaller
253 values lead to a higher system load produced by collectd, while higher values
254 lead to more coarse statistics.
255
256 B<Warning:> You should set this once and then never touch it again. If you do,
257 I<you will have to delete all your RRD files> or know some serious RRDtool
258 magic! (Assuming you're using the I<RRDtool> or I<RRDCacheD> plugin.)
259
260 =item B<MaxReadInterval> I<Seconds>
261
262 A read plugin doubles the interval between queries after each failed attempt
263 to get data.
264
265 This options limits the maximum value of the interval. The default value is
266 B<86400>.
267
268 =item B<Timeout> I<Iterations>
269
270 Consider a value list "missing" when no update has been read or received for
271 I<Iterations> iterations. By default, I<collectd> considers a value list
272 missing when no update has been received for twice the update interval. Since
273 this setting uses iterations, the maximum allowed time without update depends
274 on the I<Interval> information contained in each value list. This is used in
275 the I<Threshold> configuration to dispatch notifications about missing values,
276 see L<collectd-threshold(5)> for details.
277
278 =item B<ReadThreads> I<Num>
279
280 Number of threads to start for reading plugins. The default value is B<5>, but
281 you may want to increase this if you have more than five plugins that take a
282 long time to read. Mostly those are plugins that do network-IO. Setting this to
283 a value higher than the number of registered read callbacks is not recommended.
284
285 =item B<WriteThreads> I<Num>
286
287 Number of threads to start for dispatching value lists to write plugins. The
288 default value is B<5>, but you may want to increase this if you have more than
289 five plugins that may take relatively long to write to.
290
291 =item B<WriteQueueLimitHigh> I<HighNum>
292
293 =item B<WriteQueueLimitLow> I<LowNum>
294
295 Metrics are read by the I<read threads> and then put into a queue to be handled
296 by the I<write threads>. If one of the I<write plugins> is slow (e.g. network
297 timeouts, I/O saturation of the disk) this queue will grow. In order to avoid
298 running into memory issues in such a case, you can limit the size of this
299 queue.
300
301 By default, there is no limit and memory may grow indefinitely. This is most
302 likely not an issue for clients, i.e. instances that only handle the local
303 metrics. For servers it is recommended to set this to a non-zero value, though.
304
305 You can set the limits using B<WriteQueueLimitHigh> and B<WriteQueueLimitLow>.
306 Each of them takes a numerical argument which is the number of metrics in the
307 queue. If there are I<HighNum> metrics in the queue, any new metrics I<will> be
308 dropped. If there are less than I<LowNum> metrics in the queue, all new metrics
309 I<will> be enqueued. If the number of metrics currently in the queue is between
310 I<LowNum> and I<HighNum>, the metric is dropped with a probability that is
311 proportional to the number of metrics in the queue (i.e. it increases linearly
312 until it reaches 100%.)
313
314 If B<WriteQueueLimitHigh> is set to non-zero and B<WriteQueueLimitLow> is
315 unset, the latter will default to half of B<WriteQueueLimitHigh>.
316
317 If you do not want to randomly drop values when the queue size is between
318 I<LowNum> and I<HighNum>, set B<WriteQueueLimitHigh> and B<WriteQueueLimitLow>
319 to the same value.
320
321 Enabling the B<CollectInternalStats> option is of great help to figure out the
322 values to set B<WriteQueueLimitHigh> and B<WriteQueueLimitLow> to.
323
324 =item B<Hostname> I<Name>
325
326 Sets the hostname that identifies a host. If you omit this setting, the
327 hostname will be determined using the L<gethostname(2)> system call.
328
329 =item B<FQDNLookup> B<true|false>
330
331 If B<Hostname> is determined automatically this setting controls whether or not
332 the daemon should try to figure out the "fully qualified domain name", FQDN.
333 This is done using a lookup of the name returned by C<gethostname>. This option
334 is enabled by default.
335
336 =item B<PreCacheChain> I<ChainName>
337
338 =item B<PostCacheChain> I<ChainName>
339
340 Configure the name of the "pre-cache chain" and the "post-cache chain". Please
341 see L</"FILTER CONFIGURATION"> below on information on chains and how these
342 setting change the daemon's behavior.
343
344 =back
345
346 =head1 PLUGIN OPTIONS
347
348 Some plugins may register own options. These options must be enclosed in a
349 C<Plugin>-Section. Which options exist depends on the plugin used. Some plugins
350 require external configuration, too. The C<apache plugin>, for example,
351 required C<mod_status> to be configured in the webserver you're going to
352 collect data from. These plugins are listed below as well, even if they don't
353 require any configuration within collectd's configuration file.
354
355 A list of all plugins and a short summary for each plugin can be found in the
356 F<README> file shipped with the sourcecode and hopefully binary packets as
357 well.
358
359 =head2 Plugin C<aggregation>
360
361 The I<Aggregation plugin> makes it possible to aggregate several values into
362 one using aggregation functions such as I<sum>, I<average>, I<min> and I<max>.
363 This can be put to a wide variety of uses, e.g. average and total CPU
364 statistics for your entire fleet.
365
366 The grouping is powerful but, as with many powerful tools, may be a bit
367 difficult to wrap your head around. The grouping will therefore be
368 demonstrated using an example: The average and sum of the CPU usage across
369 all CPUs of each host is to be calculated.
370
371 To select all the affected values for our example, set C<Plugin cpu> and
372 C<Type cpu>. The other values are left unspecified, meaning "all values". The
373 I<Host>, I<Plugin>, I<PluginInstance>, I<Type> and I<TypeInstance> options
374 work as if they were specified in the C<WHERE> clause of an C<SELECT> SQL
375 statement.
376
377   Plugin "cpu"
378   Type "cpu"
379
380 Although the I<Host>, I<PluginInstance> (CPU number, i.e. 0, 1, 2, ...)  and
381 I<TypeInstance> (idle, user, system, ...) fields are left unspecified in the
382 example, the intention is to have a new value for each host / type instance
383 pair. This is achieved by "grouping" the values using the C<GroupBy> option.
384 It can be specified multiple times to group by more than one field.
385
386   GroupBy "Host"
387   GroupBy "TypeInstance"
388
389 We do neither specify nor group by I<plugin instance> (the CPU number), so all
390 metrics that differ in the CPU number only will be aggregated. Each
391 aggregation needs I<at least one> such field, otherwise no aggregation would
392 take place.
393
394 The full example configuration looks like this:
395
396  <Plugin "aggregation">
397    <Aggregation>
398      Plugin "cpu"
399      Type "cpu"
400
401      GroupBy "Host"
402      GroupBy "TypeInstance"
403
404      CalculateSum true
405      CalculateAverage true
406    </Aggregation>
407  </Plugin>
408
409 There are a couple of limitations you should be aware of:
410
411 =over 4
412
413 =item *
414
415 The I<Type> cannot be left unspecified, because it is not reasonable to add
416 apples to oranges. Also, the internal lookup structure won't work if you try
417 to group by type.
418
419 =item *
420
421 There must be at least one unspecified, ungrouped field. Otherwise nothing
422 will be aggregated.
423
424 =back
425
426 As you can see in the example above, each aggregation has its own
427 B<Aggregation> block. You can have multiple aggregation blocks and aggregation
428 blocks may match the same values, i.e. one value list can update multiple
429 aggregations. The following options are valid inside B<Aggregation> blocks:
430
431 =over 4
432
433 =item B<Host> I<Host>
434
435 =item B<Plugin> I<Plugin>
436
437 =item B<PluginInstance> I<PluginInstance>
438
439 =item B<Type> I<Type>
440
441 =item B<TypeInstance> I<TypeInstance>
442
443 Selects the value lists to be added to this aggregation. B<Type> must be a
444 valid data set name, see L<types.db(5)> for details.
445
446 If the string starts with and ends with a slash (C</>), the string is
447 interpreted as a I<regular expression>. The regex flavor used are POSIX
448 extended regular expressions as described in L<regex(7)>. Example usage:
449
450  Host "/^db[0-9]\\.example\\.com$/"
451
452 =item B<GroupBy> B<Host>|B<Plugin>|B<PluginInstance>|B<TypeInstance>
453
454 Group valued by the specified field. The B<GroupBy> option may be repeated to
455 group by multiple fields.
456
457 =item B<SetHost> I<Host>
458
459 =item B<SetPlugin> I<Plugin>
460
461 =item B<SetPluginInstance> I<PluginInstance>
462
463 =item B<SetTypeInstance> I<TypeInstance>
464
465 Sets the appropriate part of the identifier to the provided string.
466
467 The I<PluginInstance> should include the placeholder C<%{aggregation}> which
468 will be replaced with the aggregation function, e.g. "average". Not including
469 the placeholder will result in duplication warnings and/or messed up values if
470 more than one aggregation function are enabled.
471
472 The following example calculates the average usage of all "even" CPUs:
473
474  <Plugin "aggregation">
475    <Aggregation>
476      Plugin "cpu"
477      PluginInstance "/[0,2,4,6,8]$/"
478      Type "cpu"
479
480      SetPlugin "cpu"
481      SetPluginInstance "even-%{aggregation}"
482
483      GroupBy "Host"
484      GroupBy "TypeInstance"
485
486      CalculateAverage true
487    </Aggregation>
488  </Plugin>
489
490 This will create the files:
491
492 =over 4
493
494 =item *
495
496 foo.example.com/cpu-even-average/cpu-idle
497
498 =item *
499
500 foo.example.com/cpu-even-average/cpu-system
501
502 =item *
503
504 foo.example.com/cpu-even-average/cpu-user
505
506 =item *
507
508 ...
509
510 =back
511
512 =item B<CalculateNum> B<true>|B<false>
513
514 =item B<CalculateSum> B<true>|B<false>
515
516 =item B<CalculateAverage> B<true>|B<false>
517
518 =item B<CalculateMinimum> B<true>|B<false>
519
520 =item B<CalculateMaximum> B<true>|B<false>
521
522 =item B<CalculateStddev> B<true>|B<false>
523
524 Boolean options for enabling calculation of the number of value lists, their
525 sum, average, minimum, maximum andE<nbsp>/ or standard deviation. All options
526 are disabled by default.
527
528 =back
529
530 =head2 Plugin C<amqp>
531
532 The I<AMQP plugin> can be used to communicate with other instances of
533 I<collectd> or third party applications using an AMQP 0.9.1 message broker.
534 Values are sent to or received from the broker, which handles routing,
535 queueing and possibly filtering out messages.
536
537 B<Synopsis:>
538
539  <Plugin "amqp">
540    # Send values to an AMQP broker
541    <Publish "some_name">
542      Host "localhost"
543      Port "5672"
544      VHost "/"
545      User "guest"
546      Password "guest"
547      Exchange "amq.fanout"
548  #   ExchangeType "fanout"
549  #   RoutingKey "collectd"
550  #   Persistent false
551  #   ConnectionRetryDelay 0
552  #   Format "command"
553  #   StoreRates false
554  #   GraphitePrefix "collectd."
555  #   GraphiteEscapeChar "_"
556  #   GraphiteSeparateInstances false
557  #   GraphiteAlwaysAppendDS false
558  #   GraphitePreserveSeparator false
559    </Publish>
560
561    # Receive values from an AMQP broker
562    <Subscribe "some_name">
563      Host "localhost"
564      Port "5672"
565      VHost "/"
566      User "guest"
567      Password "guest"
568      Exchange "amq.fanout"
569  #   ExchangeType "fanout"
570  #   Queue "queue_name"
571  #   QueueDurable false
572  #   QueueAutoDelete true
573  #   RoutingKey "collectd.#"
574  #   ConnectionRetryDelay 0
575    </Subscribe>
576  </Plugin>
577
578 The plugin's configuration consists of a number of I<Publish> and I<Subscribe>
579 blocks, which configure sending and receiving of values respectively. The two
580 blocks are very similar, so unless otherwise noted, an option can be used in
581 either block. The name given in the blocks starting tag is only used for
582 reporting messages, but may be used to support I<flushing> of certain
583 I<Publish> blocks in the future.
584
585 =over 4
586
587 =item B<Host> I<Host>
588
589 Hostname or IP-address of the AMQP broker. Defaults to the default behavior of
590 the underlying communications library, I<rabbitmq-c>, which is "localhost".
591
592 =item B<Port> I<Port>
593
594 Service name or port number on which the AMQP broker accepts connections. This
595 argument must be a string, even if the numeric form is used. Defaults to
596 "5672".
597
598 =item B<VHost> I<VHost>
599
600 Name of the I<virtual host> on the AMQP broker to use. Defaults to "/".
601
602 =item B<User> I<User>
603
604 =item B<Password> I<Password>
605
606 Credentials used to authenticate to the AMQP broker. By default "guest"/"guest"
607 is used.
608
609 =item B<Exchange> I<Exchange>
610
611 In I<Publish> blocks, this option specifies the I<exchange> to send values to.
612 By default, "amq.fanout" will be used.
613
614 In I<Subscribe> blocks this option is optional. If given, a I<binding> between
615 the given exchange and the I<queue> is created, using the I<routing key> if
616 configured. See the B<Queue> and B<RoutingKey> options below.
617
618 =item B<ExchangeType> I<Type>
619
620 If given, the plugin will try to create the configured I<exchange> with this
621 I<type> after connecting. When in a I<Subscribe> block, the I<queue> will then
622 be bound to this exchange.
623
624 =item B<Queue> I<Queue> (Subscribe only)
625
626 Configures the I<queue> name to subscribe to. If no queue name was configured
627 explicitly, a unique queue name will be created by the broker.
628
629 =item B<QueueDurable> B<true>|B<false> (Subscribe only)
630
631 Defines if the I<queue> subscribed to is durable (saved to persistent storage)
632 or transient (will disappear if the AMQP broker is restarted). Defaults to
633 "false".
634
635 This option should be used in conjunction with the I<Persistent> option on the
636 publish side.
637
638 =item B<QueueAutoDelete> B<true>|B<false> (Subscribe only)
639
640 Defines if the I<queue> subscribed to will be deleted once the last consumer
641 unsubscribes. Defaults to "true".
642
643 =item B<RoutingKey> I<Key>
644
645 In I<Publish> blocks, this configures the routing key to set on all outgoing
646 messages. If not given, the routing key will be computed from the I<identifier>
647 of the value. The host, plugin, type and the two instances are concatenated
648 together using dots as the separator and all containing dots replaced with
649 slashes. For example "collectd.host/example/com.cpu.0.cpu.user". This makes it
650 possible to receive only specific values using a "topic" exchange.
651
652 In I<Subscribe> blocks, configures the I<routing key> used when creating a
653 I<binding> between an I<exchange> and the I<queue>. The usual wildcards can be
654 used to filter messages when using a "topic" exchange. If you're only
655 interested in CPU statistics, you could use the routing key "collectd.*.cpu.#"
656 for example.
657
658 =item B<Persistent> B<true>|B<false> (Publish only)
659
660 Selects the I<delivery method> to use. If set to B<true>, the I<persistent>
661 mode will be used, i.e. delivery is guaranteed. If set to B<false> (the
662 default), the I<transient> delivery mode will be used, i.e. messages may be
663 lost due to high load, overflowing queues or similar issues.
664
665 =item B<ConnectionRetryDelay> I<Delay>
666
667 When the connection to the AMQP broker is lost, defines the time in seconds to
668 wait before attempting to reconnect. Defaults to 0, which implies collectd will
669 attempt to reconnect at each read interval (in Subscribe mode) or each time
670 values are ready for submission (in Publish mode).
671
672 =item B<Format> B<Command>|B<JSON>|B<Graphite> (Publish only)
673
674 Selects the format in which messages are sent to the broker. If set to
675 B<Command> (the default), values are sent as C<PUTVAL> commands which are
676 identical to the syntax used by the I<Exec> and I<UnixSock plugins>. In this
677 case, the C<Content-Type> header field will be set to C<text/collectd>.
678
679 If set to B<JSON>, the values are encoded in the I<JavaScript Object Notation>,
680 an easy and straight forward exchange format. The C<Content-Type> header field
681 will be set to C<application/json>.
682
683 If set to B<Graphite>, values are encoded in the I<Graphite> format, which is
684 "<metric> <value> <timestamp>\n". The C<Content-Type> header field will be set to
685 C<text/graphite>.
686
687 A subscribing client I<should> use the C<Content-Type> header field to
688 determine how to decode the values. Currently, the I<AMQP plugin> itself can
689 only decode the B<Command> format.
690
691 =item B<StoreRates> B<true>|B<false> (Publish only)
692
693 Determines whether or not C<COUNTER>, C<DERIVE> and C<ABSOLUTE> data sources
694 are converted to a I<rate> (i.e. a C<GAUGE> value). If set to B<false> (the
695 default), no conversion is performed. Otherwise the conversion is performed
696 using the internal value cache.
697
698 Please note that currently this option is only used if the B<Format> option has
699 been set to B<JSON>.
700
701 =item B<GraphitePrefix> (Publish and B<Format>=I<Graphite> only)
702
703 A prefix can be added in the metric name when outputting in the I<Graphite> format.
704 It's added before the I<Host> name.
705 Metric name will be "<prefix><host><postfix><plugin><type><name>"
706
707 =item B<GraphitePostfix> (Publish and B<Format>=I<Graphite> only)
708
709 A postfix can be added in the metric name when outputting in the I<Graphite> format.
710 It's added after the I<Host> name.
711 Metric name will be "<prefix><host><postfix><plugin><type><name>"
712
713 =item B<GraphiteEscapeChar> (Publish and B<Format>=I<Graphite> only)
714
715 Specify a character to replace dots (.) in the host part of the metric name.
716 In I<Graphite> metric name, dots are used as separators between different
717 metric parts (host, plugin, type).
718 Default is "_" (I<Underscore>).
719
720 =item B<GraphiteSeparateInstances> B<true>|B<false>
721
722 If set to B<true>, the plugin instance and type instance will be in their own
723 path component, for example C<host.cpu.0.cpu.idle>. If set to B<false> (the
724 default), the plugin and plugin instance (and likewise the type and type
725 instance) are put into one component, for example C<host.cpu-0.cpu-idle>.
726
727 =item B<GraphiteAlwaysAppendDS> B<true>|B<false>
728
729 If set to B<true>, append the name of the I<Data Source> (DS) to the "metric"
730 identifier. If set to B<false> (the default), this is only done when there is
731 more than one DS.
732
733 =item B<GraphitePreserveSeparator> B<false>|B<true>
734
735 If set to B<false> (the default) the C<.> (dot) character is replaced with
736 I<GraphiteEscapeChar>. Otherwise, if set to B<true>, the C<.> (dot) character
737 is preserved, i.e. passed through.
738
739 =back
740
741 =head2 Plugin C<amqp1>
742
743 The I<AMQP1 plugin> can be used to communicate with other instances of
744 I<collectd> or third party applications using an AMQP 1.0 message
745 intermediary. Metric values or notifications are sent to the
746 messaging intermediary which may handle direct messaging or
747 queue based transfer.
748
749 B<Synopsis:>
750
751  <Plugin "amqp1">
752    # Send values to an AMQP 1.0 intermediary
753   <Transport "name">
754     Host "localhost"
755     Port "5672"
756     User "guest"
757     Password "guest"
758     Address "collectd"
759 #    RetryDelay 1
760     <Instance "some_name">
761         Format "command"
762         PreSettle false
763         Notify false
764  #      StoreRates false
765  #      GraphitePrefix "collectd."
766  #      GraphiteEscapeChar "_"
767  #      GraphiteSeparateInstances false
768  #      GraphiteAlwaysAppendDS false
769  #      GraphitePreserveSeparator false
770     </Instance>
771   </Transport>
772  </Plugin>
773
774 The plugin's configuration consists of a I<Transport> that configures
775 communications to the AMQP 1.0 messaging bus and one or more I<Instance>
776 corresponding to metric or event publishers to the messaging system.
777
778 The address in the I<Transport> block concatenated with the name given in the
779 I<Instance> block starting tag will be used as the send-to address for
780 communications over the messaging link.
781
782 The following options are accepted within each I<Transport> block:
783
784 =over 4
785
786 =item B<Host> I<Host>
787
788 Hostname or IP-address of the AMQP 1.0 intermediary. Defaults to the
789 default behavior of the underlying communications library,
790 I<libqpid-proton>, which is "localhost".
791
792 =item B<Port> I<Port>
793
794 Service name or port number on which the AMQP 1.0 intermediary accepts
795 connections. This argument must be a string, even if the numeric form
796 is used. Defaults to "5672".
797
798 =item B<User> I<User>
799
800 =item B<Password> I<Password>
801
802 Credentials used to authenticate to the AMQP 1.0 intermediary. By
803 default "guest"/"guest" is used.
804
805 =item B<Address> I<Address>
806
807 This option specifies the prefix for the send-to value in the message.
808 By default, "collectd" will be used.
809
810 =item B<RetryDelay> I<RetryDelay>
811
812 When the AMQP1 connection is lost, defines the time in seconds to wait
813 before attempting to reconnect. Defaults to 1, which implies attempt
814 to reconnect at 1 second intervals.
815
816 =back
817
818 The following options are accepted within each I<Instance> block:
819
820 =over 4
821
822 =item B<Format> B<Command>|B<JSON>|B<Graphite>
823
824 Selects the format in which messages are sent to the intermediary. If set to
825 B<Command> (the default), values are sent as C<PUTVAL> commands which are
826 identical to the syntax used by the I<Exec> and I<UnixSock plugins>. In this
827 case, the C<Content-Type> header field will be set to C<text/collectd>.
828
829 If set to B<JSON>, the values are encoded in the I<JavaScript Object Notation>,
830 an easy and straight forward exchange format. The C<Content-Type> header field
831 will be set to C<application/json>.
832
833 If set to B<Graphite>, values are encoded in the I<Graphite> format, which is
834 "<metric> <value> <timestamp>\n". The C<Content-Type> header field will be set to
835 C<text/graphite>.
836
837 A subscribing client I<should> use the C<Content-Type> header field to
838 determine how to decode the values.
839
840 =item B<PreSettle> B<true>|B<false>
841
842 If set to B<false> (the default), the plugin will wait for a message
843 acknowledgement from the messaging bus before sending the next
844 message. This indicates transfer of ownership to the messaging
845 system. If set to B<true>, the plugin will not wait for a message
846 acknowledgement and the message may be dropped prior to transfer of
847 ownership.
848
849 =item B<Notify> B<true>|B<false>
850
851 If set to B<false> (the default), the plugin will service the
852 instance write call back as a value list. If set to B<true> the
853 plugin will service the instance as a write notification callback
854 for alert formatting.
855
856 =item B<StoreRates> B<true>|B<false>
857
858 Determines whether or not C<COUNTER>, C<DERIVE> and C<ABSOLUTE> data sources
859 are converted to a I<rate> (i.e. a C<GAUGE> value). If set to B<false> (the
860 default), no conversion is performed. Otherwise the conversion is performed
861 using the internal value cache.
862
863 Please note that currently this option is only used if the B<Format> option has
864 been set to B<JSON>.
865
866 =item B<GraphitePrefix>
867
868 A prefix can be added in the metric name when outputting in the I<Graphite> format.
869 It's added before the I<Host> name.
870 Metric name will be "<prefix><host><postfix><plugin><type><name>"
871
872 =item B<GraphitePostfix>
873
874 A postfix can be added in the metric name when outputting in the I<Graphite> format.
875 It's added after the I<Host> name.
876 Metric name will be "<prefix><host><postfix><plugin><type><name>"
877
878 =item B<GraphiteEscapeChar>
879
880 Specify a character to replace dots (.) in the host part of the metric name.
881 In I<Graphite> metric name, dots are used as separators between different
882 metric parts (host, plugin, type).
883 Default is "_" (I<Underscore>).
884
885 =item B<GraphiteSeparateInstances> B<true>|B<false>
886
887 If set to B<true>, the plugin instance and type instance will be in their own
888 path component, for example C<host.cpu.0.cpu.idle>. If set to B<false> (the
889 default), the plugin and plugin instance (and likewise the type and type
890 instance) are put into one component, for example C<host.cpu-0.cpu-idle>.
891
892 =item B<GraphiteAlwaysAppendDS> B<true>|B<false>
893
894 If set to B<true>, append the name of the I<Data Source> (DS) to the "metric"
895 identifier. If set to B<false> (the default), this is only done when there is
896 more than one DS.
897
898 =item B<GraphitePreserveSeparator> B<false>|B<true>
899
900 If set to B<false> (the default) the C<.> (dot) character is replaced with
901 I<GraphiteEscapeChar>. Otherwise, if set to B<true>, the C<.> (dot) character
902 is preserved, i.e. passed through.
903
904 =back
905
906 =head2 Plugin C<apache>
907
908 To configure the C<apache>-plugin you first need to configure the Apache
909 webserver correctly. The Apache-plugin C<mod_status> needs to be loaded and
910 working and the C<ExtendedStatus> directive needs to be B<enabled>. You can use
911 the following snipped to base your Apache config upon:
912
913   ExtendedStatus on
914   <IfModule mod_status.c>
915     <Location /mod_status>
916       SetHandler server-status
917     </Location>
918   </IfModule>
919
920 Since its C<mod_status> module is very similar to Apache's, B<lighttpd> is
921 also supported. It introduces a new field, called C<BusyServers>, to count the
922 number of currently connected clients. This field is also supported.
923
924 The configuration of the I<Apache> plugin consists of one or more
925 C<E<lt>InstanceE<nbsp>/E<gt>> blocks. Each block requires one string argument
926 as the instance name. For example:
927
928  <Plugin "apache">
929    <Instance "www1">
930      URL "http://www1.example.com/mod_status?auto"
931    </Instance>
932    <Instance "www2">
933      URL "http://www2.example.com/mod_status?auto"
934    </Instance>
935  </Plugin>
936
937 The instance name will be used as the I<plugin instance>. To emulate the old
938 (versionE<nbsp>4) behavior, you can use an empty string (""). In order for the
939 plugin to work correctly, each instance name must be unique. This is not
940 enforced by the plugin and it is your responsibility to ensure it.
941
942 The following options are accepted within each I<Instance> block:
943
944 =over 4
945
946 =item B<URL> I<http://host/mod_status?auto>
947
948 Sets the URL of the C<mod_status> output. This needs to be the output generated
949 by C<ExtendedStatus on> and it needs to be the machine readable output
950 generated by appending the C<?auto> argument. This option is I<mandatory>.
951
952 =item B<User> I<Username>
953
954 Optional user name needed for authentication.
955
956 =item B<Password> I<Password>
957
958 Optional password needed for authentication.
959
960 =item B<VerifyPeer> B<true|false>
961
962 Enable or disable peer SSL certificate verification. See
963 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
964
965 =item B<VerifyHost> B<true|false>
966
967 Enable or disable peer host name verification. If enabled, the plugin checks
968 if the C<Common Name> or a C<Subject Alternate Name> field of the SSL
969 certificate matches the host name provided by the B<URL> option. If this
970 identity check fails, the connection is aborted. Obviously, only works when
971 connecting to a SSL enabled server. Enabled by default.
972
973 =item B<CACert> I<File>
974
975 File that holds one or more SSL certificates. If you want to use HTTPS you will
976 possibly need this option. What CA certificates come bundled with C<libcurl>
977 and are checked by default depends on the distribution you use.
978
979 =item B<SSLCiphers> I<list of ciphers>
980
981 Specifies which ciphers to use in the connection. The list of ciphers
982 must specify valid ciphers. See
983 L<http://www.openssl.org/docs/apps/ciphers.html> for details.
984
985 =item B<Timeout> I<Milliseconds>
986
987 The B<Timeout> option sets the overall timeout for HTTP requests to B<URL>, in
988 milliseconds. By default, the configured B<Interval> is used to set the
989 timeout.
990
991 =back
992
993 =head2 Plugin C<apcups>
994
995 =over 4
996
997 =item B<Host> I<Hostname>
998
999 Hostname of the host running B<apcupsd>. Defaults to B<localhost>. Please note
1000 that IPv6 support has been disabled unless someone can confirm or decline that
1001 B<apcupsd> can handle it.
1002
1003 =item B<Port> I<Port>
1004
1005 TCP-Port to connect to. Defaults to B<3551>.
1006
1007 =item B<ReportSeconds> B<true>|B<false>
1008
1009 If set to B<true>, the time reported in the C<timeleft> metric will be
1010 converted to seconds. This is the recommended setting. If set to B<false>, the
1011 default for backwards compatibility, the time will be reported in minutes.
1012
1013 =item B<PersistentConnection> B<true>|B<false>
1014
1015 The plugin is designed to keep the connection to I<apcupsd> open between reads.
1016 If plugin poll interval is greater than 15 seconds (hardcoded socket close
1017 timeout in I<apcupsd> NIS), then this option is B<false> by default.
1018
1019 You can instruct the plugin to close the connection after each read by setting
1020 this option to B<false> or force keeping the connection by setting it to B<true>.
1021
1022 If I<apcupsd> appears to close the connection due to inactivity quite quickly,
1023 the plugin will try to detect this problem and switch to an open-read-close mode.
1024
1025 =back
1026
1027 =head2 Plugin C<aquaero>
1028
1029 This plugin collects the value of the available sensors in an
1030 I<AquaeroE<nbsp>5> board. AquaeroE<nbsp>5 is a water-cooling controller board,
1031 manufactured by Aqua Computer GmbH L<http://www.aquacomputer.de/>, with a USB2
1032 connection for monitoring and configuration. The board can handle multiple
1033 temperature sensors, fans, water pumps and water level sensors and adjust the
1034 output settings such as fan voltage or power used by the water pump based on
1035 the available inputs using a configurable controller included in the board.
1036 This plugin collects all the available inputs as well as some of the output
1037 values chosen by this controller. The plugin is based on the I<libaquaero5>
1038 library provided by I<aquatools-ng>.
1039
1040 =over 4
1041
1042 =item B<Device> I<DevicePath>
1043
1044 Device path of the AquaeroE<nbsp>5's USB HID (human interface device), usually
1045 in the form C</dev/usb/hiddevX>. If this option is no set the plugin will try
1046 to auto-detect the Aquaero 5 USB device based on vendor-ID and product-ID.
1047
1048 =back
1049
1050 =head2 Plugin C<ascent>
1051
1052 This plugin collects information about an Ascent server, a free server for the
1053 "World of Warcraft" game. This plugin gathers the information by fetching the
1054 XML status page using C<libcurl> and parses it using C<libxml2>.
1055
1056 The configuration options are the same as for the C<apache> plugin above:
1057
1058 =over 4
1059
1060 =item B<URL> I<http://localhost/ascent/status/>
1061
1062 Sets the URL of the XML status output.
1063
1064 =item B<User> I<Username>
1065
1066 Optional user name needed for authentication.
1067
1068 =item B<Password> I<Password>
1069
1070 Optional password needed for authentication.
1071
1072 =item B<VerifyPeer> B<true|false>
1073
1074 Enable or disable peer SSL certificate verification. See
1075 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
1076
1077 =item B<VerifyHost> B<true|false>
1078
1079 Enable or disable peer host name verification. If enabled, the plugin checks
1080 if the C<Common Name> or a C<Subject Alternate Name> field of the SSL
1081 certificate matches the host name provided by the B<URL> option. If this
1082 identity check fails, the connection is aborted. Obviously, only works when
1083 connecting to a SSL enabled server. Enabled by default.
1084
1085 =item B<CACert> I<File>
1086
1087 File that holds one or more SSL certificates. If you want to use HTTPS you will
1088 possibly need this option. What CA certificates come bundled with C<libcurl>
1089 and are checked by default depends on the distribution you use.
1090
1091 =item B<Timeout> I<Milliseconds>
1092
1093 The B<Timeout> option sets the overall timeout for HTTP requests to B<URL>, in
1094 milliseconds. By default, the configured B<Interval> is used to set the
1095 timeout.
1096
1097 =back
1098
1099 =head2 Plugin C<barometer>
1100
1101 This plugin reads absolute air pressure using digital barometer sensor on a I2C
1102 bus. Supported sensors are:
1103
1104 =over 5
1105
1106 =item I<MPL115A2> from Freescale,
1107 see L<http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPL115A>.
1108
1109
1110 =item I<MPL3115> from Freescale
1111 see L<http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPL3115A2>.
1112
1113
1114 =item I<BMP085> from Bosch Sensortec
1115
1116 =back
1117
1118 The sensor type - one of the above - is detected automatically by the plugin
1119 and indicated in the plugin_instance (you will see subdirectory
1120 "barometer-mpl115" or "barometer-mpl3115", or "barometer-bmp085"). The order of
1121 detection is BMP085 -> MPL3115 -> MPL115A2, the first one found will be used
1122 (only one sensor can be used by the plugin).
1123
1124 The plugin provides absolute barometric pressure, air pressure reduced to sea
1125 level (several possible approximations) and as an auxiliary value also internal
1126 sensor temperature. It uses (expects/provides) typical metric units - pressure
1127 in [hPa], temperature in [C], altitude in [m].
1128
1129 It was developed and tested under Linux only. The only platform dependency is
1130 the standard Linux i2c-dev interface (the particular bus driver has to
1131 support the SM Bus command subset).
1132
1133 The reduction or normalization to mean sea level pressure requires (depending
1134 on selected method/approximation) also altitude and reference to temperature
1135 sensor(s).  When multiple temperature sensors are configured the minimum of
1136 their values is always used (expecting that the warmer ones are affected by
1137 e.g. direct sun light at that moment).
1138
1139 Synopsis:
1140
1141   <Plugin "barometer">
1142      Device            "/dev/i2c-0";
1143      Oversampling      512
1144      PressureOffset    0.0
1145      TemperatureOffset 0.0
1146      Normalization     2
1147      Altitude          238.0
1148      TemperatureSensor "myserver/onewire-F10FCA000800/temperature"
1149   </Plugin>
1150
1151 =over 4
1152
1153 =item B<Device> I<device>
1154
1155 The only mandatory configuration parameter.
1156
1157 Device name of the I2C bus to which the sensor is connected. Note that
1158 typically you need to have loaded the i2c-dev module.
1159 Using i2c-tools you can check/list i2c buses available on your system by:
1160
1161   i2cdetect -l
1162
1163 Then you can scan for devices on given bus. E.g. to scan the whole bus 0 use:
1164
1165   i2cdetect -y -a 0
1166
1167 This way you should be able to verify that the pressure sensor (either type) is
1168 connected and detected on address 0x60.
1169
1170 =item B<Oversampling> I<value>
1171
1172 Optional parameter controlling the oversampling/accuracy. Default value
1173 is 1 providing fastest and least accurate reading.
1174
1175 For I<MPL115> this is the size of the averaging window. To filter out sensor
1176 noise a simple averaging using floating window of this configurable size is
1177 used. The plugin will use average of the last C<value> measurements (value of 1
1178 means no averaging).  Minimal size is 1, maximal 1024.
1179
1180 For I<MPL3115> this is the oversampling value. The actual oversampling is
1181 performed by the sensor and the higher value the higher accuracy and longer
1182 conversion time (although nothing to worry about in the collectd context).
1183 Supported values are: 1, 2, 4, 8, 16, 32, 64 and 128. Any other value is
1184 adjusted by the plugin to the closest supported one.
1185
1186 For I<BMP085> this is the oversampling value. The actual oversampling is
1187 performed by the sensor and the higher value the higher accuracy and longer
1188 conversion time (although nothing to worry about in the collectd context).
1189 Supported values are: 1, 2, 4, 8. Any other value is adjusted by the plugin to
1190 the closest supported one.
1191
1192 =item B<PressureOffset> I<offset>
1193
1194 Optional parameter for MPL3115 only.
1195
1196 You can further calibrate the sensor by supplying pressure and/or temperature
1197 offsets.  This is added to the measured/caclulated value (i.e. if the measured
1198 value is too high then use negative offset).
1199 In hPa, default is 0.0.
1200
1201 =item B<TemperatureOffset> I<offset>
1202
1203 Optional parameter for MPL3115 only.
1204
1205 You can further calibrate the sensor by supplying pressure and/or temperature
1206 offsets.  This is added to the measured/caclulated value (i.e. if the measured
1207 value is too high then use negative offset).
1208 In C, default is 0.0.
1209
1210 =item B<Normalization> I<method>
1211
1212 Optional parameter, default value is 0.
1213
1214 Normalization method - what approximation/model is used to compute the mean sea
1215 level pressure from the air absolute pressure.
1216
1217 Supported values of the C<method> (integer between from 0 to 2) are:
1218
1219 =over 5
1220
1221 =item B<0> - no conversion, absolute pressure is simply copied over. For this method you
1222        do not need to configure C<Altitude> or C<TemperatureSensor>.
1223
1224 =item B<1> - international formula for conversion ,
1225 See
1226 L<http://en.wikipedia.org/wiki/Atmospheric_pressure#Altitude_atmospheric_pressure_variation>.
1227 For this method you have to configure C<Altitude> but do not need
1228 C<TemperatureSensor> (uses fixed global temperature average instead).
1229
1230 =item B<2> - formula as recommended by the Deutsche Wetterdienst (German
1231 Meteorological Service).
1232 See L<http://de.wikipedia.org/wiki/Barometrische_H%C3%B6henformel#Theorie>
1233 For this method you have to configure both  C<Altitude> and
1234 C<TemperatureSensor>.
1235
1236 =back
1237
1238
1239 =item B<Altitude> I<altitude>
1240
1241 The altitude (in meters) of the location where you meassure the pressure.
1242
1243 =item B<TemperatureSensor> I<reference>
1244
1245 Temperature sensor(s) which should be used as a reference when normalizing the
1246 pressure using C<Normalization> method 2.
1247 When specified more sensors a minimum is found and used each time.  The
1248 temperature reading directly from this pressure sensor/plugin is typically not
1249 suitable as the pressure sensor will be probably inside while we want outside
1250 temperature.  The collectd reference name is something like
1251 <hostname>/<plugin_name>-<plugin_instance>/<type>-<type_instance>
1252 (<type_instance> is usually omitted when there is just single value type). Or
1253 you can figure it out from the path of the output data files.
1254
1255 =back
1256
1257 =head2 Plugin C<battery>
1258
1259 The I<battery plugin> reports the remaining capacity, power and voltage of
1260 laptop batteries.
1261
1262 =over 4
1263
1264 =item B<ValuesPercentage> B<false>|B<true>
1265
1266 When enabled, remaining capacity is reported as a percentage, e.g. "42%
1267 capacity remaining". Otherwise the capacity is stored as reported by the
1268 battery, most likely in "Wh". This option does not work with all input methods,
1269 in particular when only C</proc/pmu> is available on an old Linux system.
1270 Defaults to B<false>.
1271
1272 =item B<ReportDegraded> B<false>|B<true>
1273
1274 Typical laptop batteries degrade over time, meaning the capacity decreases with
1275 recharge cycles. The maximum charge of the previous charge cycle is tracked as
1276 "last full capacity" and used to determine that a battery is "fully charged".
1277
1278 When this option is set to B<false>, the default, the I<battery plugin> will
1279 only report the remaining capacity. If the B<ValuesPercentage> option is
1280 enabled, the relative remaining capacity is calculated as the ratio of the
1281 "remaining capacity" and the "last full capacity". This is what most tools,
1282 such as the status bar of desktop environments, also do.
1283
1284 When set to B<true>, the battery plugin will report three values: B<charged>
1285 (remaining capacity), B<discharged> (difference between "last full capacity"
1286 and "remaining capacity") and B<degraded> (difference between "design capacity"
1287 and "last full capacity").
1288
1289 =item B<QueryStateFS> B<false>|B<true>
1290
1291 When set to B<true>, the battery plugin will only read statistics
1292 related to battery performance as exposed by StateFS at
1293 /run/state. StateFS is used in Mer-based Sailfish OS, for
1294 example.
1295
1296 =back
1297
1298 =head2 Plugin C<bind>
1299
1300 Starting with BIND 9.5.0, the most widely used DNS server software provides
1301 extensive statistics about queries, responses and lots of other information.
1302 The bind plugin retrieves this information that's encoded in XML and provided
1303 via HTTP and submits the values to collectd.
1304
1305 To use this plugin, you first need to tell BIND to make this information
1306 available. This is done with the C<statistics-channels> configuration option:
1307
1308  statistics-channels {
1309    inet localhost port 8053;
1310  };
1311
1312 The configuration follows the grouping that can be seen when looking at the
1313 data with an XSLT compatible viewer, such as a modern web browser. It's
1314 probably a good idea to make yourself familiar with the provided values, so you
1315 can understand what the collected statistics actually mean.
1316
1317 Synopsis:
1318
1319  <Plugin "bind">
1320    URL "http://localhost:8053/"
1321    ParseTime       false
1322    OpCodes         true
1323    QTypes          true
1324
1325    ServerStats     true
1326    ZoneMaintStats  true
1327    ResolverStats   false
1328    MemoryStats     true
1329
1330    <View "_default">
1331      QTypes        true
1332      ResolverStats true
1333      CacheRRSets   true
1334
1335      Zone "127.in-addr.arpa/IN"
1336    </View>
1337  </Plugin>
1338
1339 The bind plugin accepts the following configuration options:
1340
1341 =over 4
1342
1343 =item B<URL> I<URL>
1344
1345 URL from which to retrieve the XML data. If not specified,
1346 C<http://localhost:8053/> will be used.
1347
1348 =item B<ParseTime> B<true>|B<false>
1349
1350 When set to B<true>, the time provided by BIND will be parsed and used to
1351 dispatch the values. When set to B<false>, the local time source is queried.
1352
1353 This setting is set to B<true> by default for backwards compatibility; setting
1354 this to B<false> is I<recommended> to avoid problems with timezones and
1355 localization.
1356
1357 =item B<OpCodes> B<true>|B<false>
1358
1359 When enabled, statistics about the I<"OpCodes">, for example the number of
1360 C<QUERY> packets, are collected.
1361
1362 Default: Enabled.
1363
1364 =item B<QTypes> B<true>|B<false>
1365
1366 When enabled, the number of I<incoming> queries by query types (for example
1367 C<A>, C<MX>, C<AAAA>) is collected.
1368
1369 Default: Enabled.
1370
1371 =item B<ServerStats> B<true>|B<false>
1372
1373 Collect global server statistics, such as requests received over IPv4 and IPv6,
1374 successful queries, and failed updates.
1375
1376 Default: Enabled.
1377
1378 =item B<ZoneMaintStats> B<true>|B<false>
1379
1380 Collect zone maintenance statistics, mostly information about notifications
1381 (zone updates) and zone transfers.
1382
1383 Default: Enabled.
1384
1385 =item B<ResolverStats> B<true>|B<false>
1386
1387 Collect resolver statistics, i.E<nbsp>e. statistics about outgoing requests
1388 (e.E<nbsp>g. queries over IPv4, lame servers). Since the global resolver
1389 counters apparently were removed in BIND 9.5.1 and 9.6.0, this is disabled by
1390 default. Use the B<ResolverStats> option within a B<View "_default"> block
1391 instead for the same functionality.
1392
1393 Default: Disabled.
1394
1395 =item B<MemoryStats>
1396
1397 Collect global memory statistics.
1398
1399 Default: Enabled.
1400
1401 =item B<Timeout> I<Milliseconds>
1402
1403 The B<Timeout> option sets the overall timeout for HTTP requests to B<URL>, in
1404 milliseconds. By default, the configured B<Interval> is used to set the
1405 timeout.
1406
1407 =item B<View> I<Name>
1408
1409 Collect statistics about a specific I<"view">. BIND can behave different,
1410 mostly depending on the source IP-address of the request. These different
1411 configurations are called "views". If you don't use this feature, you most
1412 likely are only interested in the C<_default> view.
1413
1414 Within a E<lt>B<View>E<nbsp>I<name>E<gt> block, you can specify which
1415 information you want to collect about a view. If no B<View> block is
1416 configured, no detailed view statistics will be collected.
1417
1418 =over 4
1419
1420 =item B<QTypes> B<true>|B<false>
1421
1422 If enabled, the number of I<outgoing> queries by query type (e.E<nbsp>g. C<A>,
1423 C<MX>) is collected.
1424
1425 Default: Enabled.
1426
1427 =item B<ResolverStats> B<true>|B<false>
1428
1429 Collect resolver statistics, i.E<nbsp>e. statistics about outgoing requests
1430 (e.E<nbsp>g. queries over IPv4, lame servers).
1431
1432 Default: Enabled.
1433
1434 =item B<CacheRRSets> B<true>|B<false>
1435
1436 If enabled, the number of entries (I<"RR sets">) in the view's cache by query
1437 type is collected. Negative entries (queries which resulted in an error, for
1438 example names that do not exist) are reported with a leading exclamation mark,
1439 e.E<nbsp>g. "!A".
1440
1441 Default: Enabled.
1442
1443 =item B<Zone> I<Name>
1444
1445 When given, collect detailed information about the given zone in the view. The
1446 information collected if very similar to the global B<ServerStats> information
1447 (see above).
1448
1449 You can repeat this option to collect detailed information about multiple
1450 zones.
1451
1452 By default no detailed zone information is collected.
1453
1454 =back
1455
1456 =back
1457
1458 =head2 Plugin C<ceph>
1459
1460 The ceph plugin collects values from JSON data to be parsed by B<libyajl>
1461 (L<https://lloyd.github.io/yajl/>) retrieved from ceph daemon admin sockets.
1462
1463 A separate B<Daemon> block must be configured for each ceph daemon to be
1464 monitored. The following example will read daemon statistics from four
1465 separate ceph daemons running on the same device (two OSDs, one MON, one MDS) :
1466
1467   <Plugin ceph>
1468     LongRunAvgLatency false
1469     ConvertSpecialMetricTypes true
1470     <Daemon "osd.0">
1471       SocketPath "/var/run/ceph/ceph-osd.0.asok"
1472     </Daemon>
1473     <Daemon "osd.1">
1474       SocketPath "/var/run/ceph/ceph-osd.1.asok"
1475     </Daemon>
1476     <Daemon "mon.a">
1477       SocketPath "/var/run/ceph/ceph-mon.ceph1.asok"
1478     </Daemon>
1479     <Daemon "mds.a">
1480       SocketPath "/var/run/ceph/ceph-mds.ceph1.asok"
1481     </Daemon>
1482   </Plugin>
1483
1484 The ceph plugin accepts the following configuration options:
1485
1486 =over 4
1487
1488 =item B<LongRunAvgLatency> B<true>|B<false>
1489
1490 If enabled, latency values(sum,count pairs) are calculated as the long run
1491 average - average since the ceph daemon was started = (sum / count).
1492 When disabled, latency values are calculated as the average since the last
1493 collection = (sum_now - sum_last) / (count_now - count_last).
1494
1495 Default: Disabled
1496
1497 =item B<ConvertSpecialMetricTypes> B<true>|B<false>
1498
1499 If enabled, special metrics (metrics that differ in type from similar counters)
1500 are converted to the type of those similar counters. This currently only
1501 applies to filestore.journal_wr_bytes which is a counter for OSD daemons. The
1502 ceph schema reports this metric type as a sum,count pair while similar counters
1503 are treated as derive types. When converted, the sum is used as the counter
1504 value and is treated as a derive type.
1505 When disabled, all metrics are treated as the types received from the ceph schema.
1506
1507 Default: Enabled
1508
1509 =back
1510
1511 Each B<Daemon> block must have a string argument for the plugin instance name.
1512 A B<SocketPath> is also required for each B<Daemon> block:
1513
1514 =over 4
1515
1516 =item B<Daemon> I<DaemonName>
1517
1518 Name to be used as the instance name for this daemon.
1519
1520 =item B<SocketPath> I<SocketPath>
1521
1522 Specifies the path to the UNIX admin socket of the ceph daemon.
1523
1524 =back
1525
1526 =head2 Plugin C<cgroups>
1527
1528 This plugin collects the CPU user/system time for each I<cgroup> by reading the
1529 F<cpuacct.stat> files in the first cpuacct-mountpoint (typically
1530 F</sys/fs/cgroup/cpu.cpuacct> on machines using systemd).
1531
1532 =over 4
1533
1534 =item B<CGroup> I<Directory>
1535
1536 Select I<cgroup> based on the name. Whether only matching I<cgroups> are
1537 collected or if they are ignored is controlled by the B<IgnoreSelected> option;
1538 see below.
1539
1540 See F</"IGNORELISTS"> for details.
1541
1542 =item B<IgnoreSelected> B<true>|B<false>
1543
1544 Invert the selection: If set to true, all cgroups I<except> the ones that
1545 match any one of the criteria are collected. By default only selected
1546 cgroups are collected if a selection is made. If no selection is configured
1547 at all, B<all> cgroups are selected.
1548
1549 =back
1550
1551 =head2 Plugin C<chrony>
1552
1553 The C<chrony> plugin collects ntp data from a B<chronyd> server, such as clock
1554 skew and per-peer stratum.
1555
1556 For talking to B<chronyd>, it mimics what the B<chronyc> control program does
1557 on the wire.
1558
1559 Available configuration options for the C<chrony> plugin:
1560
1561 =over 4
1562
1563 =item B<Host> I<Hostname>
1564
1565 Hostname of the host running B<chronyd>. Defaults to B<localhost>.
1566
1567 =item B<Port> I<Port>
1568
1569 UDP-Port to connect to. Defaults to B<323>.
1570
1571 =item B<Timeout> I<Timeout>
1572
1573 Connection timeout in seconds. Defaults to B<2>.
1574
1575 =back
1576
1577 =head2 Plugin C<conntrack>
1578
1579 This plugin collects IP conntrack statistics.
1580
1581 =over 4
1582
1583 =item B<OldFiles>
1584
1585 Assume the B<conntrack_count> and B<conntrack_max> files to be found in
1586 F</proc/sys/net/ipv4/netfilter> instead of F</proc/sys/net/netfilter/>.
1587
1588 =back
1589
1590 =head2 Plugin C<cpu>
1591
1592 The I<CPU plugin> collects CPU usage metrics. By default, CPU usage is reported
1593 as Jiffies, using the C<cpu> type. Two aggregations are available:
1594
1595 =over 4
1596
1597 =item *
1598
1599 Sum, per-state, over all CPUs installed in the system; and
1600
1601 =item *
1602
1603 Sum, per-CPU, over all non-idle states of a CPU, creating an "active" state.
1604
1605 =back
1606
1607 The two aggregations can be combined, leading to I<collectd> only emitting a
1608 single "active" metric for the entire system. As soon as one of these
1609 aggregations (or both) is enabled, the I<cpu plugin> will report a percentage,
1610 rather than Jiffies. In addition, you can request individual, per-state,
1611 per-CPU metrics to be reported as percentage.
1612
1613 The following configuration options are available:
1614
1615 =over 4
1616
1617 =item B<ReportByState> B<true>|B<false>
1618
1619 When set to B<true>, the default, reports per-state metrics, e.g. "system",
1620 "user" and "idle".
1621 When set to B<false>, aggregates (sums) all I<non-idle> states into one
1622 "active" metric.
1623
1624 =item B<ReportByCpu> B<true>|B<false>
1625
1626 When set to B<true>, the default, reports per-CPU (per-core) metrics.
1627 When set to B<false>, instead of reporting metrics for individual CPUs, only a
1628 global sum of CPU states is emitted.
1629
1630 =item B<ValuesPercentage> B<false>|B<true>
1631
1632 This option is only considered when both, B<ReportByCpu> and B<ReportByState>
1633 are set to B<true>. In this case, by default, metrics will be reported as
1634 Jiffies. By setting this option to B<true>, you can request percentage values
1635 in the un-aggregated (per-CPU, per-state) mode as well.
1636
1637 =item B<ReportNumCpu> B<false>|B<true>
1638
1639 When set to B<true>, reports the number of available CPUs.
1640 Defaults to B<false>.
1641
1642 =item B<ReportGuestState> B<false>|B<true>
1643
1644 When set to B<true>, reports the "guest" and "guest_nice" CPU states.
1645 Defaults to B<false>.
1646
1647 =item B<SubtractGuestState> B<false>|B<true>
1648
1649 This option is only considered when B<ReportGuestState> is set to B<true>.
1650 "guest" and "guest_nice" are included in respectively "user" and "nice".
1651 If set to B<true>, "guest" will be subtracted from "user" and "guest_nice"
1652 will be subtracted from "nice".
1653 Defaults to B<true>.
1654
1655 =back
1656
1657 =head2 Plugin C<cpufreq>
1658
1659 This plugin is available on Linux and FreeBSD only.  It doesn't have any
1660 options.  On Linux it reads
1661 F</sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq> (for the first CPU
1662 installed) to get the current CPU frequency. If this file does not exist make
1663 sure B<cpufreqd> (L<http://cpufreqd.sourceforge.net/>) or a similar tool is
1664 installed and an "cpu governor" (that's a kernel module) is loaded.
1665
1666 On Linux, if the system has the I<cpufreq-stats> kernel module loaded, this
1667 plugin reports the rate of p-state (cpu frequency) transitions and the
1668 percentage of time spent in each p-state.
1669
1670 On FreeBSD it does a sysctl dev.cpu.0.freq and submits this as instance 0.
1671 At this time FreeBSD only has one frequency setting for all cores.
1672 See the BUGS section in the FreeBSD man page for cpufreq(4) for more details.
1673
1674 On FreeBSD the plugin checks the success of sysctl dev.cpu.0.freq and
1675 unregisters the plugin when this fails.  A message will be logged to indicate
1676 this.
1677
1678 =head2 Plugin C<cpusleep>
1679
1680 This plugin doesn't have any options. It reads CLOCK_BOOTTIME and
1681 CLOCK_MONOTONIC and reports the difference between these clocks. Since
1682 BOOTTIME clock increments while device is suspended and MONOTONIC
1683 clock does not, the derivative of the difference between these clocks
1684 gives the relative amount of time the device has spent in suspend
1685 state. The recorded value is in milliseconds of sleep per seconds of
1686 wall clock.
1687
1688 =head2 Plugin C<csv>
1689
1690 =over 4
1691
1692 =item B<DataDir> I<Directory>
1693
1694 Set the directory to store CSV-files under. Per default CSV-files are generated
1695 beneath the daemon's working directory, i.E<nbsp>e. the B<BaseDir>.
1696 The special strings B<stdout> and B<stderr> can be used to write to the standard
1697 output and standard error channels, respectively. This, of course, only makes
1698 much sense when collectd is running in foreground- or non-daemon-mode.
1699
1700 =item B<StoreRates> B<true|false>
1701
1702 If set to B<true>, convert counter values to rates. If set to B<false> (the
1703 default) counter values are stored as is, i.E<nbsp>e. as an increasing integer
1704 number.
1705
1706 =back
1707
1708 =head2 cURL Statistics
1709
1710 All cURL-based plugins support collection of generic, request-based
1711 statistics. These are disabled by default and can be enabled selectively for
1712 each page or URL queried from the curl, curl_json, or curl_xml plugins. See
1713 the documentation of those plugins for specific information. This section
1714 describes the available metrics that can be configured for each plugin. All
1715 options are disabled by default.
1716
1717 See L<http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html> for more details.
1718
1719 =over 4
1720
1721 =item B<TotalTime> B<true|false>
1722
1723 Total time of the transfer, including name resolving, TCP connect, etc.
1724
1725 =item B<NamelookupTime> B<true|false>
1726
1727 Time it took from the start until name resolving was completed.
1728
1729 =item B<ConnectTime> B<true|false>
1730
1731 Time it took from the start until the connect to the remote host (or proxy)
1732 was completed.
1733
1734 =item B<AppconnectTime> B<true|false>
1735
1736 Time it took from the start until the SSL/SSH connect/handshake to the remote
1737 host was completed.
1738
1739 =item B<PretransferTime> B<true|false>
1740
1741 Time it took from the start until just before the transfer begins.
1742
1743 =item B<StarttransferTime> B<true|false>
1744
1745 Time it took from the start until the first byte was received.
1746
1747 =item B<RedirectTime> B<true|false>
1748
1749 Time it took for all redirection steps include name lookup, connect,
1750 pre-transfer and transfer before final transaction was started.
1751
1752 =item B<RedirectCount> B<true|false>
1753
1754 The total number of redirections that were actually followed.
1755
1756 =item B<SizeUpload> B<true|false>
1757
1758 The total amount of bytes that were uploaded.
1759
1760 =item B<SizeDownload> B<true|false>
1761
1762 The total amount of bytes that were downloaded.
1763
1764 =item B<SpeedDownload> B<true|false>
1765
1766 The average download speed that curl measured for the complete download.
1767
1768 =item B<SpeedUpload> B<true|false>
1769
1770 The average upload speed that curl measured for the complete upload.
1771
1772 =item B<HeaderSize> B<true|false>
1773
1774 The total size of all the headers received.
1775
1776 =item B<RequestSize> B<true|false>
1777
1778 The total size of the issued requests.
1779
1780 =item B<ContentLengthDownload> B<true|false>
1781
1782 The content-length of the download.
1783
1784 =item B<ContentLengthUpload> B<true|false>
1785
1786 The specified size of the upload.
1787
1788 =item B<NumConnects> B<true|false>
1789
1790 The number of new connections that were created to achieve the transfer.
1791
1792 =back
1793
1794 =head2 Plugin C<curl>
1795
1796 The curl plugin uses the B<libcurl> (L<http://curl.haxx.se/>) to read web pages
1797 and the match infrastructure (the same code used by the tail plugin) to use
1798 regular expressions with the received data.
1799
1800 The following example will read the current value of AMD stock from Google's
1801 finance page and dispatch the value to collectd.
1802
1803   <Plugin curl>
1804     <Page "stock_quotes">
1805       Plugin "quotes"
1806       URL "http://finance.google.com/finance?q=NYSE%3AAMD"
1807       AddressFamily "any"
1808       User "foo"
1809       Password "bar"
1810       Digest false
1811       VerifyPeer true
1812       VerifyHost true
1813       CACert "/path/to/ca.crt"
1814       Header "X-Custom-Header: foobar"
1815       Post "foo=bar"
1816
1817       MeasureResponseTime false
1818       MeasureResponseCode false
1819
1820       <Match>
1821         Regex "<span +class=\"pr\"[^>]*> *([0-9]*\\.[0-9]+) *</span>"
1822         DSType "GaugeAverage"
1823         # Note: `stock_value' is not a standard type.
1824         Type "stock_value"
1825         Instance "AMD"
1826       </Match>
1827     </Page>
1828   </Plugin>
1829
1830 In the B<Plugin> block, there may be one or more B<Page> blocks, each defining
1831 a web page and one or more "matches" to be performed on the returned data. The
1832 string argument to the B<Page> block is used as plugin instance.
1833
1834 The following options are valid within B<Page> blocks:
1835
1836 =over 4
1837
1838 =item B<Plugin> I<Plugin>
1839
1840 Use I<Plugin> as the plugin name when submitting values.
1841 Defaults to C<curl>.
1842
1843 =item B<URL> I<URL>
1844
1845 URL of the web site to retrieve. Since a regular expression will be used to
1846 extract information from this data, non-binary data is a big plus here ;)
1847
1848 =item B<AddressFamily> I<Type>
1849
1850 IP version to resolve URL to. Useful in cases when hostname in URL resolves
1851 to both IPv4 and IPv6 addresses, and you are interested in using one of them
1852 specifically.
1853 Use C<ipv4> to enforce IPv4, C<ipv6> to enforce IPv6, or C<any> to keep the
1854 default behavior of resolving addresses to all IP versions your system allows.
1855 If C<libcurl> is compiled without IPv6 support, using C<ipv6> will result in
1856 a warning and fallback to C<any>.
1857 If C<Type> cannot be parsed, a warning will be printed and the whole B<Page>
1858 block will be ignored.
1859
1860 =item B<User> I<Name>
1861
1862 Username to use if authorization is required to read the page.
1863
1864 =item B<Password> I<Password>
1865
1866 Password to use if authorization is required to read the page.
1867
1868 =item B<Digest> B<true>|B<false>
1869
1870 Enable HTTP digest authentication.
1871
1872 =item B<VerifyPeer> B<true>|B<false>
1873
1874 Enable or disable peer SSL certificate verification. See
1875 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
1876
1877 =item B<VerifyHost> B<true>|B<false>
1878
1879 Enable or disable peer host name verification. If enabled, the plugin checks if
1880 the C<Common Name> or a C<Subject Alternate Name> field of the SSL certificate
1881 matches the host name provided by the B<URL> option. If this identity check
1882 fails, the connection is aborted. Obviously, only works when connecting to a
1883 SSL enabled server. Enabled by default.
1884
1885 =item B<CACert> I<file>
1886
1887 File that holds one or more SSL certificates. If you want to use HTTPS you will
1888 possibly need this option. What CA certificates come bundled with C<libcurl>
1889 and are checked by default depends on the distribution you use.
1890
1891 =item B<Header> I<Header>
1892
1893 A HTTP header to add to the request. Multiple headers are added if this option
1894 is specified more than once.
1895
1896 =item B<Post> I<Body>
1897
1898 Specifies that the HTTP operation should be a POST instead of a GET. The
1899 complete data to be posted is given as the argument.  This option will usually
1900 need to be accompanied by a B<Header> option to set an appropriate
1901 C<Content-Type> for the post body (e.g. to
1902 C<application/x-www-form-urlencoded>).
1903
1904 =item B<MeasureResponseTime> B<true>|B<false>
1905
1906 Measure response time for the request. If this setting is enabled, B<Match>
1907 blocks (see below) are optional. Disabled by default.
1908
1909 Beware that requests will get aborted if they take too long to complete. Adjust
1910 B<Timeout> accordingly if you expect B<MeasureResponseTime> to report such slow
1911 requests.
1912
1913 This option is similar to enabling the B<TotalTime> statistic but it's
1914 measured by collectd instead of cURL.
1915
1916 =item B<MeasureResponseCode> B<true>|B<false>
1917
1918 Measure response code for the request. If this setting is enabled, B<Match>
1919 blocks (see below) are optional. Disabled by default.
1920
1921 =item B<E<lt>StatisticsE<gt>>
1922
1923 One B<Statistics> block can be used to specify cURL statistics to be collected
1924 for each request to the remote web site. See the section "cURL Statistics"
1925 above for details. If this setting is enabled, B<Match> blocks (see below) are
1926 optional.
1927
1928 =item B<E<lt>MatchE<gt>>
1929
1930 One or more B<Match> blocks that define how to match information in the data
1931 returned by C<libcurl>. The C<curl> plugin uses the same infrastructure that's
1932 used by the C<tail> plugin, so please see the documentation of the C<tail>
1933 plugin below on how matches are defined. If the B<MeasureResponseTime> or
1934 B<MeasureResponseCode> options are set to B<true>, B<Match> blocks are
1935 optional.
1936
1937 =item B<Interval> I<Interval>
1938
1939 Sets the interval (in seconds) in which the values will be collected from this
1940 URL. By default the global B<Interval> setting will be used.
1941
1942 =item B<Timeout> I<Milliseconds>
1943
1944 The B<Timeout> option sets the overall timeout for HTTP requests to B<URL>, in
1945 milliseconds. By default, the configured B<Interval> is used to set the
1946 timeout. Prior to version 5.5.0, there was no timeout and requests could hang
1947 indefinitely. This legacy behaviour can be achieved by setting the value of
1948 B<Timeout> to 0.
1949
1950 If B<Timeout> is 0 or bigger than the B<Interval>, keep in mind that each slow
1951 network connection will stall one read thread. Adjust the B<ReadThreads> global
1952 setting accordingly to prevent this from blocking other plugins.
1953
1954 =back
1955
1956 =head2 Plugin C<curl_json>
1957
1958 The B<curl_json plugin> collects values from JSON data to be parsed by
1959 B<libyajl> (L<https://lloyd.github.io/yajl/>) retrieved via
1960 either B<libcurl> (L<http://curl.haxx.se/>) or read directly from a
1961 unix socket. The former can be used, for example, to collect values
1962 from CouchDB documents (which are stored JSON notation), and the
1963 latter to collect values from a uWSGI stats socket.
1964
1965 The following example will collect several values from the built-in
1966 C<_stats> runtime statistics module of I<CouchDB>
1967 (L<http://wiki.apache.org/couchdb/Runtime_Statistics>).
1968
1969   <Plugin curl_json>
1970     <URL "http://localhost:5984/_stats">
1971       AddressFamily "any"
1972       Instance "httpd"
1973       <Key "httpd/requests/count">
1974         Type "http_requests"
1975       </Key>
1976
1977       <Key "httpd_request_methods/*/count">
1978         Type "http_request_methods"
1979       </Key>
1980
1981       <Key "httpd_status_codes/*/count">
1982         Type "http_response_codes"
1983       </Key>
1984     </URL>
1985   </Plugin>
1986
1987 This example will collect data directly from a I<uWSGI> "Stats Server" socket.
1988
1989   <Plugin curl_json>
1990     <Sock "/var/run/uwsgi.stats.sock">
1991       Instance "uwsgi"
1992       <Key "workers/*/requests">
1993         Type "http_requests"
1994       </Key>
1995
1996       <Key "workers/*/apps/*/requests">
1997         Type "http_requests"
1998       </Key>
1999     </Sock>
2000   </Plugin>
2001
2002 In the B<Plugin> block, there may be one or more B<URL> blocks, each
2003 defining a URL to be fetched via HTTP (using libcurl) or B<Sock>
2004 blocks defining a unix socket to read JSON from directly.  Each of
2005 these blocks may have one or more B<Key> blocks.
2006
2007 The B<Key> string argument must be in a path format. Each component is
2008 used to match the key from a JSON map or the index of an JSON
2009 array. If a path component of a B<Key> is a I<*>E<nbsp>wildcard, the
2010 values for all map keys or array indices will be collectd.
2011
2012 The following options are valid within B<URL> blocks:
2013
2014 =over 4
2015
2016 =item B<AddressFamily> I<Type>
2017
2018 IP version to resolve URL to. Useful in cases when hostname in URL resolves
2019 to both IPv4 and IPv6 addresses, and you are interested in using one of them
2020 specifically.
2021 Use C<ipv4> to enforce IPv4, C<ipv6> to enforce IPv6, or C<any> to keep the
2022 default behavior of resolving addresses to all IP versions your system allows.
2023 If C<libcurl> is compiled without IPv6 support, using C<ipv6> will result in
2024 a warning and fallback to C<any>.
2025 If C<Type> cannot be parsed, a warning will be printed and the whole B<URL>
2026 block will be ignored.
2027
2028 =item B<Host> I<Name>
2029
2030 Use I<Name> as the host name when submitting values. Defaults to the global
2031 host name setting.
2032
2033 =item B<Plugin> I<Plugin>
2034
2035 Use I<Plugin> as the plugin name when submitting values.
2036 Defaults to C<curl_json>.
2037
2038 =item B<Instance> I<Instance>
2039
2040 Sets the plugin instance to I<Instance>.
2041
2042 =item B<Interval> I<Interval>
2043
2044 Sets the interval (in seconds) in which the values will be collected from this
2045 URL. By default the global B<Interval> setting will be used.
2046
2047 =item B<User> I<Name>
2048
2049 =item B<Password> I<Password>
2050
2051 =item B<Digest> B<true>|B<false>
2052
2053 =item B<VerifyPeer> B<true>|B<false>
2054
2055 =item B<VerifyHost> B<true>|B<false>
2056
2057 =item B<CACert> I<file>
2058
2059 =item B<Header> I<Header>
2060
2061 =item B<Post> I<Body>
2062
2063 =item B<Timeout> I<Milliseconds>
2064
2065 These options behave exactly equivalent to the appropriate options of the
2066 I<cURL> plugin. Please see there for a detailed description.
2067
2068 =item B<E<lt>StatisticsE<gt>>
2069
2070 One B<Statistics> block can be used to specify cURL statistics to be collected
2071 for each request to the remote URL. See the section "cURL Statistics" above
2072 for details.
2073
2074 =back
2075
2076 The following options are valid within B<Key> blocks:
2077
2078 =over 4
2079
2080 =item B<Type> I<Type>
2081
2082 Sets the type used to dispatch the values to the daemon. Detailed information
2083 about types and their configuration can be found in L<types.db(5)>. This
2084 option is mandatory.
2085
2086 =item B<Instance> I<Instance>
2087
2088 Type-instance to use. Defaults to the current map key or current string array element value.
2089
2090 =back
2091
2092 =head2 Plugin C<curl_xml>
2093
2094 The B<curl_xml plugin> uses B<libcurl> (L<http://curl.haxx.se/>) and B<libxml2>
2095 (L<http://xmlsoft.org/>) to retrieve XML data via cURL.
2096
2097  <Plugin "curl_xml">
2098    <URL "http://localhost/stats.xml">
2099      AddressFamily "any"
2100      Host "my_host"
2101      #Plugin "curl_xml"
2102      Instance "some_instance"
2103      User "collectd"
2104      Password "thaiNg0I"
2105      VerifyPeer true
2106      VerifyHost true
2107      CACert "/path/to/ca.crt"
2108      Header "X-Custom-Header: foobar"
2109      Post "foo=bar"
2110
2111      <XPath "table[@id=\"magic_level\"]/tr">
2112        Type "magic_level"
2113        #InstancePrefix "prefix-"
2114        InstanceFrom "td[1]"
2115        #PluginInstanceFrom "td[1]"
2116        ValuesFrom "td[2]/span[@class=\"level\"]"
2117      </XPath>
2118    </URL>
2119  </Plugin>
2120
2121 In the B<Plugin> block, there may be one or more B<URL> blocks, each defining a
2122 URL to be fetched using libcurl. Within each B<URL> block there are
2123 options which specify the connection parameters, for example authentication
2124 information, and one or more B<XPath> blocks.
2125
2126 Each B<XPath> block specifies how to get one type of information. The
2127 string argument must be a valid XPath expression which returns a list
2128 of "base elements". One value is dispatched for each "base element". The
2129 I<type instance> and values are looked up using further I<XPath> expressions
2130 that should be relative to the base element.
2131
2132 Within the B<URL> block the following options are accepted:
2133
2134 =over 4
2135
2136 =item B<AddressFamily> I<Type>
2137
2138 IP version to resolve URL to. Useful in cases when hostname in URL resolves
2139 to both IPv4 and IPv6 addresses, and you are interested in using one of them
2140 specifically.
2141 Use C<ipv4> to enforce IPv4, C<ipv6> to enforce IPv6, or C<any> to keep the
2142 default behavior of resolving addresses to all IP versions your system allows.
2143 If C<libcurl> is compiled without IPv6 support, using C<ipv6> will result in
2144 a warning and fallback to C<any>.
2145 If C<Type> cannot be parsed, a warning will be printed and the whole B<URL>
2146 block will be ignored.
2147
2148 =item B<Host> I<Name>
2149
2150 Use I<Name> as the host name when submitting values. Defaults to the global
2151 host name setting.
2152
2153 =item B<Plugin> I<Plugin>
2154
2155 Use I<Plugin> as the plugin name when submitting values.
2156 Defaults to 'curl_xml'.
2157
2158 =item B<Instance> I<Instance>
2159
2160 Use I<Instance> as the plugin instance when submitting values.
2161 May be overridden by B<PluginInstanceFrom> option inside B<XPath> blocks.
2162 Defaults to an empty string (no plugin instance).
2163
2164 =item B<Interval> I<Interval>
2165
2166 Sets the interval (in seconds) in which the values will be collected from this
2167 URL. By default the global B<Interval> setting will be used.
2168
2169 =item B<Namespace> I<Prefix> I<URL>
2170
2171 If an XPath expression references namespaces, they must be specified
2172 with this option. I<Prefix> is the "namespace prefix" used in the XML document.
2173 I<URL> is the "namespace name", an URI reference uniquely identifying the
2174 namespace. The option can be repeated to register multiple namespaces.
2175
2176 Examples:
2177
2178   Namespace "s" "http://schemas.xmlsoap.org/soap/envelope/"
2179   Namespace "m" "http://www.w3.org/1998/Math/MathML"
2180
2181 =item B<User> I<User>
2182
2183 =item B<Password> I<Password>
2184
2185 =item B<Digest> B<true>|B<false>
2186
2187 =item B<VerifyPeer> B<true>|B<false>
2188
2189 =item B<VerifyHost> B<true>|B<false>
2190
2191 =item B<CACert> I<CA Cert File>
2192
2193 =item B<Header> I<Header>
2194
2195 =item B<Post> I<Body>
2196
2197 =item B<Timeout> I<Milliseconds>
2198
2199 These options behave exactly equivalent to the appropriate options of the
2200 I<cURL plugin>. Please see there for a detailed description.
2201
2202 =item B<E<lt>StatisticsE<gt>>
2203
2204 One B<Statistics> block can be used to specify cURL statistics to be collected
2205 for each request to the remote URL. See the section "cURL Statistics" above
2206 for details.
2207
2208 =item E<lt>B<XPath> I<XPath-expression>E<gt>
2209
2210 Within each B<URL> block, there must be one or more B<XPath> blocks. Each
2211 B<XPath> block specifies how to get one type of information. The string
2212 argument must be a valid XPath expression which returns a list of "base
2213 elements". One value is dispatched for each "base element".
2214
2215 Within the B<XPath> block the following options are accepted:
2216
2217 =over 4
2218
2219 =item B<Type> I<Type>
2220
2221 Specifies the I<Type> used for submitting patches. This determines the number
2222 of values that are required / expected and whether the strings are parsed as
2223 signed or unsigned integer or as double values. See L<types.db(5)> for details.
2224 This option is required.
2225
2226 =item B<InstancePrefix> I<InstancePrefix>
2227
2228 Prefix the I<type instance> with I<InstancePrefix>. The values are simply
2229 concatenated together without any separator.
2230 This option is optional.
2231
2232 =item B<InstanceFrom> I<InstanceFrom>
2233
2234 Specifies a XPath expression to use for determining the I<type instance>. The
2235 XPath expression must return exactly one element. The element's value is then
2236 used as I<type instance>, possibly prefixed with I<InstancePrefix> (see above).
2237
2238 =item B<PluginInstanceFrom> I<PluginInstanceFrom>
2239
2240 Specifies a XPath expression to use for determining the I<plugin instance>. The
2241 XPath expression must return exactly one element. The element's value is then
2242 used as I<plugin instance>.
2243
2244 =back
2245
2246 If the "base XPath expression" (the argument to the B<XPath> block) returns
2247 exactly one argument, then I<InstanceFrom> and I<PluginInstanceFrom> may be omitted.
2248 Otherwise, at least one of I<InstanceFrom> or I<PluginInstanceFrom> is required.
2249
2250 =over 4
2251
2252 =item B<ValuesFrom> I<ValuesFrom> [I<ValuesFrom> ...]
2253
2254 Specifies one or more XPath expression to use for reading the values. The
2255 number of XPath expressions must match the number of data sources in the
2256 I<type> specified with B<Type> (see above). Each XPath expression must return
2257 exactly one element. The element's value is then parsed as a number and used as
2258 value for the appropriate value in the value list dispatched to the daemon.
2259 This option is required.
2260
2261 =back
2262
2263 =back
2264
2265 =head2 Plugin C<dbi>
2266
2267 This plugin uses the B<dbi> library (L<http://libdbi.sourceforge.net/>) to
2268 connect to various databases, execute I<SQL> statements and read back the
2269 results. I<dbi> is an acronym for "database interface" in case you were
2270 wondering about the name. You can configure how each column is to be
2271 interpreted and the plugin will generate one or more data sets from each row
2272 returned according to these rules.
2273
2274 Because the plugin is very generic, the configuration is a little more complex
2275 than those of other plugins. It usually looks something like this:
2276
2277   <Plugin dbi>
2278     <Query "out_of_stock">
2279       Statement "SELECT category, COUNT(*) AS value FROM products WHERE in_stock = 0 GROUP BY category"
2280       # Use with MySQL 5.0.0 or later
2281       MinVersion 50000
2282       <Result>
2283         Type "gauge"
2284         InstancePrefix "out_of_stock"
2285         InstancesFrom "category"
2286         ValuesFrom "value"
2287       </Result>
2288     </Query>
2289     <Database "product_information">
2290       #Plugin "warehouse"
2291       Driver "mysql"
2292       Interval 120
2293       DriverOption "host" "localhost"
2294       DriverOption "username" "collectd"
2295       DriverOption "password" "aZo6daiw"
2296       DriverOption "dbname" "prod_info"
2297       SelectDB "prod_info"
2298       Query "out_of_stock"
2299     </Database>
2300   </Plugin>
2301
2302 The configuration above defines one query with one result and one database. The
2303 query is then linked to the database with the B<Query> option I<within> the
2304 B<E<lt>DatabaseE<gt>> block. You can have any number of queries and databases
2305 and you can also use the B<Include> statement to split up the configuration
2306 file in multiple, smaller files. However, the B<E<lt>QueryE<gt>> block I<must>
2307 precede the B<E<lt>DatabaseE<gt>> blocks, because the file is interpreted from
2308 top to bottom!
2309
2310 The following is a complete list of options:
2311
2312 =head3 B<Query> blocks
2313
2314 Query blocks define I<SQL> statements and how the returned data should be
2315 interpreted. They are identified by the name that is given in the opening line
2316 of the block. Thus the name needs to be unique. Other than that, the name is
2317 not used in collectd.
2318
2319 In each B<Query> block, there is one or more B<Result> blocks. B<Result> blocks
2320 define which column holds which value or instance information. You can use
2321 multiple B<Result> blocks to create multiple values from one returned row. This
2322 is especially useful, when queries take a long time and sending almost the same
2323 query again and again is not desirable.
2324
2325 Example:
2326
2327   <Query "environment">
2328     Statement "select station, temperature, humidity from environment"
2329     <Result>
2330       Type "temperature"
2331       # InstancePrefix "foo"
2332       InstancesFrom "station"
2333       ValuesFrom "temperature"
2334     </Result>
2335     <Result>
2336       Type "humidity"
2337       InstancesFrom "station"
2338       ValuesFrom "humidity"
2339     </Result>
2340   </Query>
2341
2342 The following options are accepted:
2343
2344 =over 4
2345
2346 =item B<Statement> I<SQL>
2347
2348 Sets the statement that should be executed on the server. This is B<not>
2349 interpreted by collectd, but simply passed to the database server. Therefore,
2350 the SQL dialect that's used depends on the server collectd is connected to.
2351
2352 The query has to return at least two columns, one for the instance and one
2353 value. You cannot omit the instance, even if the statement is guaranteed to
2354 always return exactly one line. In that case, you can usually specify something
2355 like this:
2356
2357   Statement "SELECT \"instance\", COUNT(*) AS value FROM table"
2358
2359 (That works with MySQL but may not be valid SQL according to the spec. If you
2360 use a more strict database server, you may have to select from a dummy table or
2361 something.)
2362
2363 Please note that some databases, for example B<Oracle>, will fail if you
2364 include a semicolon at the end of the statement.
2365
2366 =item B<MinVersion> I<Version>
2367
2368 =item B<MaxVersion> I<Value>
2369
2370 Only use this query for the specified database version. You can use these
2371 options to provide multiple queries with the same name but with a slightly
2372 different syntax. The plugin will use only those queries, where the specified
2373 minimum and maximum versions fit the version of the database in use.
2374
2375 The database version is determined by C<dbi_conn_get_engine_version>, see the
2376 L<libdbi documentation|http://libdbi.sourceforge.net/docs/programmers-guide/reference-conn.html#DBI-CONN-GET-ENGINE-VERSION>
2377 for details. Basically, each part of the version is assumed to be in the range
2378 from B<00> to B<99> and all dots are removed. So version "4.1.2" becomes
2379 "40102", version "5.0.42" becomes "50042".
2380
2381 B<Warning:> The plugin will use B<all> matching queries, so if you specify
2382 multiple queries with the same name and B<overlapping> ranges, weird stuff will
2383 happen. Don't to it! A valid example would be something along these lines:
2384
2385   MinVersion 40000
2386   MaxVersion 49999
2387   ...
2388   MinVersion 50000
2389   MaxVersion 50099
2390   ...
2391   MinVersion 50100
2392   # No maximum
2393
2394 In the above example, there are three ranges that don't overlap. The last one
2395 goes from version "5.1.0" to infinity, meaning "all later versions". Versions
2396 before "4.0.0" are not specified.
2397
2398 =item B<Type> I<Type>
2399
2400 The B<type> that's used for each line returned. See L<types.db(5)> for more
2401 details on how types are defined. In short: A type is a predefined layout of
2402 data and the number of values and type of values has to match the type
2403 definition.
2404
2405 If you specify "temperature" here, you need exactly one gauge column. If you
2406 specify "if_octets", you will need two counter columns. See the B<ValuesFrom>
2407 setting below.
2408
2409 There must be exactly one B<Type> option inside each B<Result> block.
2410
2411 =item B<InstancePrefix> I<prefix>
2412
2413 Prepends I<prefix> to the type instance. If B<InstancesFrom> (see below) is not
2414 given, the string is simply copied. If B<InstancesFrom> is given, I<prefix> and
2415 all strings returned in the appropriate columns are concatenated together,
2416 separated by dashes I<("-")>.
2417
2418 =item B<InstancesFrom> I<column0> [I<column1> ...]
2419
2420 Specifies the columns whose values will be used to create the "type-instance"
2421 for each row. If you specify more than one column, the value of all columns
2422 will be joined together with dashes I<("-")> as separation characters.
2423
2424 The plugin itself does not check whether or not all built instances are
2425 different. It's your responsibility to assure that each is unique. This is
2426 especially true, if you do not specify B<InstancesFrom>: B<You> have to make
2427 sure that only one row is returned in this case.
2428
2429 If neither B<InstancePrefix> nor B<InstancesFrom> is given, the type-instance
2430 will be empty.
2431
2432 =item B<ValuesFrom> I<column0> [I<column1> ...]
2433
2434 Names the columns whose content is used as the actual data for the data sets
2435 that are dispatched to the daemon. How many such columns you need is determined
2436 by the B<Type> setting above. If you specify too many or not enough columns,
2437 the plugin will complain about that and no data will be submitted to the
2438 daemon.
2439
2440 The actual data type in the columns is not that important. The plugin will
2441 automatically cast the values to the right type if it know how to do that. So
2442 it should be able to handle integer an floating point types, as well as strings
2443 (if they include a number at the beginning).
2444
2445 There must be at least one B<ValuesFrom> option inside each B<Result> block.
2446
2447 =item B<MetadataFrom> [I<column0> I<column1> ...]
2448
2449 Names the columns whose content is used as metadata for the data sets
2450 that are dispatched to the daemon.
2451
2452 The actual data type in the columns is not that important. The plugin will
2453 automatically cast the values to the right type if it know how to do that. So
2454 it should be able to handle integer an floating point types, as well as strings
2455 (if they include a number at the beginning).
2456
2457 =back
2458
2459 =head3 B<Database> blocks
2460
2461 Database blocks define a connection to a database and which queries should be
2462 sent to that database. Since the used "dbi" library can handle a wide variety
2463 of databases, the configuration is very generic. If in doubt, refer to libdbi's
2464 documentationE<nbsp>- we stick as close to the terminology used there.
2465
2466 Each database needs a "name" as string argument in the starting tag of the
2467 block. This name will be used as "PluginInstance" in the values submitted to
2468 the daemon. Other than that, that name is not used.
2469
2470 =over 4
2471
2472 =item B<Plugin> I<Plugin>
2473
2474 Use I<Plugin> as the plugin name when submitting query results from
2475 this B<Database>. Defaults to C<dbi>.
2476
2477 =item B<Interval> I<Interval>
2478
2479 Sets the interval (in seconds) in which the values will be collected from this
2480 database. By default the global B<Interval> setting will be used.
2481
2482 =item B<Driver> I<Driver>
2483
2484 Specifies the driver to use to connect to the database. In many cases those
2485 drivers are named after the database they can connect to, but this is not a
2486 technical necessity. These drivers are sometimes referred to as "DBD",
2487 B<D>ataB<B>ase B<D>river, and some distributions ship them in separate
2488 packages. Drivers for the "dbi" library are developed by the B<libdbi-drivers>
2489 project at L<http://libdbi-drivers.sourceforge.net/>.
2490
2491 You need to give the driver name as expected by the "dbi" library here. You
2492 should be able to find that in the documentation for each driver. If you
2493 mistype the driver name, the plugin will dump a list of all known driver names
2494 to the log.
2495
2496 =item B<DriverOption> I<Key> I<Value>
2497
2498 Sets driver-specific options. What option a driver supports can be found in the
2499 documentation for each driver, somewhere at
2500 L<http://libdbi-drivers.sourceforge.net/>. However, the options "host",
2501 "username", "password", and "dbname" seem to be deE<nbsp>facto standards.
2502
2503 DBDs can register two types of options: String options and numeric options. The
2504 plugin will use the C<dbi_conn_set_option> function when the configuration
2505 provides a string and the C<dbi_conn_require_option_numeric> function when the
2506 configuration provides a number. So these two lines will actually result in
2507 different calls being used:
2508
2509   DriverOption "Port" 1234      # numeric
2510   DriverOption "Port" "1234"    # string
2511
2512 Unfortunately, drivers are not too keen to report errors when an unknown option
2513 is passed to them, so invalid settings here may go unnoticed. This is not the
2514 plugin's fault, it will report errors if it gets them from the libraryE<nbsp>/
2515 the driver. If a driver complains about an option, the plugin will dump a
2516 complete list of all options understood by that driver to the log. There is no
2517 way to programmatically find out if an option expects a string or a numeric
2518 argument, so you will have to refer to the appropriate DBD's documentation to
2519 find this out. Sorry.
2520
2521 =item B<SelectDB> I<Database>
2522
2523 In some cases, the database name you connect with is not the database name you
2524 want to use for querying data. If this option is set, the plugin will "select"
2525 (switch to) that database after the connection is established.
2526
2527 =item B<Query> I<QueryName>
2528
2529 Associates the query named I<QueryName> with this database connection. The
2530 query needs to be defined I<before> this statement, i.E<nbsp>e. all query
2531 blocks you want to refer to must be placed above the database block you want to
2532 refer to them from.
2533
2534 =item B<Host> I<Hostname>
2535
2536 Sets the B<host> field of I<value lists> to I<Hostname> when dispatching
2537 values. Defaults to the global hostname setting.
2538
2539 =back
2540
2541 =head2 Plugin C<df>
2542
2543 =over 4
2544
2545 =item B<Device> I<Device>
2546
2547 Select partitions based on the devicename.
2548
2549 See F</"IGNORELISTS"> for details.
2550
2551 =item B<MountPoint> I<Directory>
2552
2553 Select partitions based on the mountpoint.
2554
2555 See F</"IGNORELISTS"> for details.
2556
2557 =item B<FSType> I<FSType>
2558
2559 Select partitions based on the filesystem type.
2560
2561 See F</"IGNORELISTS"> for details.
2562
2563 =item B<IgnoreSelected> B<true>|B<false>
2564
2565 Invert the selection: If set to true, all partitions B<except> the ones that
2566 match any one of the criteria are collected. By default only selected
2567 partitions are collected if a selection is made. If no selection is configured
2568 at all, B<all> partitions are selected.
2569
2570 =item B<ReportByDevice> B<true>|B<false>
2571
2572 Report using the device name rather than the mountpoint. i.e. with this I<false>,
2573 (the default), it will report a disk as "root", but with it I<true>, it will be
2574 "sda1" (or whichever).
2575
2576 =item B<ReportInodes> B<true>|B<false>
2577
2578 Enables or disables reporting of free, reserved and used inodes. Defaults to
2579 inode collection being disabled.
2580
2581 Enable this option if inodes are a scarce resource for you, usually because
2582 many small files are stored on the disk. This is a usual scenario for mail
2583 transfer agents and web caches.
2584
2585 =item B<ValuesAbsolute> B<true>|B<false>
2586
2587 Enables or disables reporting of free and used disk space in 1K-blocks.
2588 Defaults to B<true>.
2589
2590 =item B<ValuesPercentage> B<false>|B<true>
2591
2592 Enables or disables reporting of free and used disk space in percentage.
2593 Defaults to B<false>.
2594
2595 This is useful for deploying I<collectd> on the cloud, where machines with
2596 different disk size may exist. Then it is more practical to configure
2597 thresholds based on relative disk size.
2598
2599 =back
2600
2601 =head2 Plugin C<disk>
2602
2603 The C<disk> plugin collects information about the usage of physical disks and
2604 logical disks (partitions). Values collected are the number of octets written
2605 to and read from a disk or partition, the number of read/write operations
2606 issued to the disk and a rather complex "time" it took for these commands to be
2607 issued.
2608
2609 Using the following two options you can ignore some disks or configure the
2610 collection only of specific disks.
2611
2612 =over 4
2613
2614 =item B<Disk> I<Name>
2615
2616 Select the disk I<Name>. Whether it is collected or ignored depends on the
2617 B<IgnoreSelected> setting, see below. As with other plugins that use the
2618 daemon's ignorelist functionality, a string that starts and ends with a slash
2619 is interpreted as a regular expression. Examples:
2620
2621   Disk "sdd"
2622   Disk "/hda[34]/"
2623
2624 See F</"IGNORELISTS"> for details.
2625
2626 =item B<IgnoreSelected> B<true>|B<false>
2627
2628 Sets whether selected disks, i.E<nbsp>e. the ones matches by any of the B<Disk>
2629 statements, are ignored or if all other disks are ignored. The behavior
2630 (hopefully) is intuitive: If no B<Disk> option is configured, all disks are
2631 collected. If at least one B<Disk> option is given and no B<IgnoreSelected> or
2632 set to B<false>, B<only> matching disks will be collected. If B<IgnoreSelected>
2633 is set to B<true>, all disks are collected B<except> the ones matched.
2634
2635 =item B<UseBSDName> B<true>|B<false>
2636
2637 Whether to use the device's "BSD Name", on MacE<nbsp>OSE<nbsp>X, instead of the
2638 default major/minor numbers. Requires collectd to be built with Apple's
2639 IOKitLib support.
2640
2641 =item B<UdevNameAttr> I<Attribute>
2642
2643 Attempt to override disk instance name with the value of a specified udev
2644 attribute when built with B<libudev>.  If the attribute is not defined for the
2645 given device, the default name is used. Example:
2646
2647   UdevNameAttr "DM_NAME"
2648
2649 =back
2650
2651 =head2 Plugin C<dns>
2652
2653 =over 4
2654
2655 =item B<Interface> I<Interface>
2656
2657 The dns plugin uses B<libpcap> to capture dns traffic and analyzes it. This
2658 option sets the interface that should be used. If this option is not set, or
2659 set to "any", the plugin will try to get packets from B<all> interfaces. This
2660 may not work on certain platforms, such as MacE<nbsp>OSE<nbsp>X.
2661
2662 =item B<IgnoreSource> I<IP-address>
2663
2664 Ignore packets that originate from this address.
2665
2666 =item B<SelectNumericQueryTypes> B<true>|B<false>
2667
2668 Enabled by default, collects unknown (and thus presented as numeric only) query types.
2669
2670 =back
2671
2672 =head2 Plugin C<dpdkevents>
2673
2674 The I<dpdkevents plugin> collects events from DPDK such as link status of
2675 network ports and Keep Alive status of DPDK logical cores.
2676 In order to get Keep Alive events following requirements must be met:
2677 - DPDK >= 16.07
2678 - support for Keep Alive implemented in DPDK application. More details can
2679 be found here: http://dpdk.org/doc/guides/sample_app_ug/keep_alive.html
2680
2681 B<Synopsis:>
2682
2683  <Plugin "dpdkevents">
2684    <EAL>
2685      Coremask "0x1"
2686      MemoryChannels "4"
2687      FilePrefix "rte"
2688    </EAL>
2689    <Event "link_status">
2690      SendEventsOnUpdate true
2691      EnabledPortMask 0xffff
2692      PortName "interface1"
2693      PortName "interface2"
2694      SendNotification false
2695    </Event>
2696    <Event "keep_alive">
2697      SendEventsOnUpdate true
2698      LCoreMask "0xf"
2699      KeepAliveShmName "/dpdk_keepalive_shm_name"
2700      SendNotification false
2701    </Event>
2702  </Plugin>
2703
2704 B<Options:>
2705
2706
2707 =head3 The EAL block
2708
2709 =over 4
2710
2711 =item B<Coremask> I<Mask>
2712
2713 =item B<Memorychannels> I<Channels>
2714
2715 Number of memory channels per processor socket.
2716
2717 =item B<FilePrefix> I<File>
2718
2719 The prefix text used for hugepage filenames. The filename will be set to
2720 /var/run/.<prefix>_config where prefix is what is passed in by the user.
2721
2722 =back
2723
2724 =head3 The Event block
2725
2726 The B<Event> block defines configuration for specific event. It accepts a
2727 single argument which specifies the name of the event.
2728
2729 =head4 Link Status event
2730
2731 =over 4
2732
2733 =item B<SendEventOnUpdate> I<true|false>
2734
2735 If set to true link status value will be dispatched only when it is
2736 different from previously read value. This is an optional argument - default
2737 value is true.
2738
2739 =item B<EnabledPortMask> I<Mask>
2740
2741 A hexidecimal bit mask of the DPDK ports which should be enabled. A mask
2742 of 0x0 means that all ports will be disabled. A bitmask of all F's means
2743 that all ports will be enabled. This is an optional argument - by default
2744 all ports are enabled.
2745
2746 =item B<PortName> I<Name>
2747
2748 A string containing an optional name for the enabled DPDK ports. Each PortName
2749 option should contain only one port name; specify as many PortName options as
2750 desired. Default naming convention will be used if PortName is blank. If there
2751 are less PortName options than there are enabled ports, the default naming
2752 convention will be used for the additional ports.
2753
2754 =item B<SendNotification> I<true|false>
2755
2756 If set to true, link status notifications are sent, instead of link status
2757 being collected as a statistic. This is an optional argument - default
2758 value is false.
2759
2760 =back
2761
2762 =head4 Keep Alive event
2763
2764 =over 4
2765
2766 =item B<SendEventOnUpdate> I<true|false>
2767
2768 If set to true keep alive value will be dispatched only when it is
2769 different from previously read value. This is an optional argument - default
2770 value is true.
2771
2772 =item B<LCoreMask> I<Mask>
2773
2774 An hexadecimal bit mask of the logical cores to monitor keep alive state.
2775
2776 =item B<KeepAliveShmName> I<Name>
2777
2778 Shared memory name identifier that is used by secondary process to monitor
2779 the keep alive cores state.
2780
2781 =item B<SendNotification> I<true|false>
2782
2783 If set to true, keep alive notifications are sent, instead of keep alive
2784 information being collected as a statistic. This is an optional
2785 argument - default value is false.
2786
2787 =back
2788
2789 =head2 Plugin C<dpdkstat>
2790
2791 The I<dpdkstat plugin> collects information about DPDK interfaces using the
2792 extended NIC stats API in DPDK.
2793
2794 B<Synopsis:>
2795
2796  <Plugin "dpdkstat">
2797    <EAL>
2798      Coremask "0x4"
2799      MemoryChannels "4"
2800      FilePrefix "rte"
2801      SocketMemory "1024"
2802      LogLevel "7"
2803      RteDriverLibPath "/usr/lib/dpdk-pmd"
2804    </EAL>
2805    SharedMemObj "dpdk_collectd_stats_0"
2806    EnabledPortMask 0xffff
2807    PortName "interface1"
2808    PortName "interface2"
2809  </Plugin>
2810
2811 B<Options:>
2812
2813 =head3 The EAL block
2814
2815 =over 4
2816
2817 =item B<Coremask> I<Mask>
2818
2819 A string containing an hexadecimal bit mask of the cores to run on. Note that
2820 core numbering can change between platforms and should be determined beforehand.
2821
2822 =item B<Memorychannels> I<Channels>
2823
2824 A string containing a number of memory channels per processor socket.
2825
2826 =item B<FilePrefix> I<File>
2827
2828 The prefix text used for hugepage filenames. The filename will be set to
2829 /var/run/.<prefix>_config where prefix is what is passed in by the user.
2830
2831 =item B<SocketMemory> I<MB>
2832
2833 A string containing amount of Memory to allocate from hugepages on specific
2834 sockets in MB. This is an optional value.
2835
2836 =item B<LogLevel> I<LogLevel_number>
2837
2838 A string containing log level number. This parameter is optional.
2839 If parameter is not present then default value "7" - (INFO) is used.
2840 Value "8" - (DEBUG) can be set to enable debug traces.
2841
2842 =item B<RteDriverLibPath> I<Path>
2843
2844 A string containing path to shared pmd driver lib or path to directory,
2845 where shared pmd driver libs are available. This parameter is optional.
2846 This parameter enable loading of shared pmd driver libs from defined path.
2847 E.g.: "/usr/lib/dpdk-pmd/librte_pmd_i40e.so"
2848 or    "/usr/lib/dpdk-pmd"
2849
2850 =back
2851
2852 =over 3
2853
2854 =item B<SharedMemObj> I<Mask>
2855
2856 A string containing the name of the shared memory object that should be used to
2857 share stats from the DPDK secondary process to the collectd dpdkstat plugin.
2858 Defaults to dpdk_collectd_stats if no other value is configured.
2859
2860 =item B<EnabledPortMask> I<Mask>
2861
2862 A hexidecimal bit mask of the DPDK ports which should be enabled. A mask
2863 of 0x0 means that all ports will be disabled. A bitmask of all Fs means
2864 that all ports will be enabled. This is an optional argument - default
2865 is all ports enabled.
2866
2867 =item B<PortName> I<Name>
2868
2869 A string containing an optional name for the enabled DPDK ports. Each PortName
2870 option should contain only one port name; specify as many PortName options as
2871 desired. Default naming convention will be used if PortName is blank. If there
2872 are less PortName options than there are enabled ports, the default naming
2873 convention will be used for the additional ports.
2874
2875 =back
2876
2877 =head2 Plugin C<email>
2878
2879 =over 4
2880
2881 =item B<SocketFile> I<Path>
2882
2883 Sets the socket-file which is to be created.
2884
2885 =item B<SocketGroup> I<Group>
2886
2887 If running as root change the group of the UNIX-socket after it has been
2888 created. Defaults to B<collectd>.
2889
2890 =item B<SocketPerms> I<Permissions>
2891
2892 Change the file permissions of the UNIX-socket after it has been created. The
2893 permissions must be given as a numeric, octal value as you would pass to
2894 L<chmod(1)>. Defaults to B<0770>.
2895
2896 =item B<MaxConns> I<Number>
2897
2898 Sets the maximum number of connections that can be handled in parallel. Since
2899 this many threads will be started immediately setting this to a very high
2900 value will waste valuable resources. Defaults to B<5> and will be forced to be
2901 at most B<16384> to prevent typos and dumb mistakes.
2902
2903 =back
2904
2905 =head2 Plugin C<ethstat>
2906
2907 The I<ethstat plugin> collects information about network interface cards (NICs)
2908 by talking directly with the underlying kernel driver using L<ioctl(2)>.
2909
2910 B<Synopsis:>
2911
2912  <Plugin "ethstat">
2913    Interface "eth0"
2914    Map "rx_csum_offload_errors" "if_rx_errors" "checksum_offload"
2915    Map "multicast" "if_multicast"
2916  </Plugin>
2917
2918 B<Options:>
2919
2920 =over 4
2921
2922 =item B<Interface> I<Name>
2923
2924 Collect statistical information about interface I<Name>.
2925
2926 =item B<Map> I<Name> I<Type> [I<TypeInstance>]
2927
2928 By default, the plugin will submit values as type C<derive> and I<type
2929 instance> set to I<Name>, the name of the metric as reported by the driver. If
2930 an appropriate B<Map> option exists, the given I<Type> and, optionally,
2931 I<TypeInstance> will be used.
2932
2933 =item B<MappedOnly> B<true>|B<false>
2934
2935 When set to B<true>, only metrics that can be mapped to a I<type> will be
2936 collected, all other metrics will be ignored. Defaults to B<false>.
2937
2938 =back
2939
2940 =head2 Plugin C<exec>
2941
2942 Please make sure to read L<collectd-exec(5)> before using this plugin. It
2943 contains valuable information on when the executable is executed and the
2944 output that is expected from it.
2945
2946 =over 4
2947
2948 =item B<Exec> I<User>[:[I<Group>]] I<Executable> [I<E<lt>argE<gt>> [I<E<lt>argE<gt>> ...]]
2949
2950 =item B<NotificationExec> I<User>[:[I<Group>]] I<Executable> [I<E<lt>argE<gt>> [I<E<lt>argE<gt>> ...]]
2951
2952 Execute the executable I<Executable> as user I<User>. If the user name is
2953 followed by a colon and a group name, the effective group is set to that group.
2954 The real group and saved-set group will be set to the default group of that
2955 user. If no group is given the effective group ID will be the same as the real
2956 group ID.
2957
2958 Please note that in order to change the user and/or group the daemon needs
2959 superuser privileges. If the daemon is run as an unprivileged user you must
2960 specify the same user/group here. If the daemon is run with superuser
2961 privileges, you must supply a non-root user here.
2962
2963 The executable may be followed by optional arguments that are passed to the
2964 program. Please note that due to the configuration parsing numbers and boolean
2965 values may be changed. If you want to be absolutely sure that something is
2966 passed as-is please enclose it in quotes.
2967
2968 The B<Exec> and B<NotificationExec> statements change the semantics of the
2969 programs executed, i.E<nbsp>e. the data passed to them and the response
2970 expected from them. This is documented in great detail in L<collectd-exec(5)>.
2971
2972 =back
2973
2974 =head2 Plugin C<fhcount>
2975
2976 The C<fhcount> plugin provides statistics about used, unused and total number of
2977 file handles on Linux.
2978
2979 The I<fhcount plugin> provides the following configuration options:
2980
2981 =over 4
2982
2983 =item B<ValuesAbsolute> B<true>|B<false>
2984
2985 Enables or disables reporting of file handles usage in absolute numbers,
2986 e.g. file handles used. Defaults to B<true>.
2987
2988 =item B<ValuesPercentage> B<false>|B<true>
2989
2990 Enables or disables reporting of file handles usage in percentages, e.g.
2991 percent of file handles used. Defaults to B<false>.
2992
2993 =back
2994
2995 =head2 Plugin C<filecount>
2996
2997 The C<filecount> plugin counts the number of files in a certain directory (and
2998 its subdirectories) and their combined size. The configuration is very straight
2999 forward:
3000
3001   <Plugin "filecount">
3002     <Directory "/var/qmail/queue/mess">
3003       Instance "qmail-message"
3004     </Directory>
3005     <Directory "/var/qmail/queue/todo">
3006       Instance "qmail-todo"
3007     </Directory>
3008     <Directory "/var/lib/php5">
3009       Instance "php5-sessions"
3010       Name "sess_*"
3011     </Directory>
3012   </Plugin>
3013
3014 The example above counts the number of files in QMail's queue directories and
3015 the number of PHP5 sessions. Jfiy: The "todo" queue holds the messages that
3016 QMail has not yet looked at, the "message" queue holds the messages that were
3017 classified into "local" and "remote".
3018
3019 As you can see, the configuration consists of one or more C<Directory> blocks,
3020 each of which specifies a directory in which to count the files. Within those
3021 blocks, the following options are recognized:
3022
3023 =over 4
3024
3025 =item B<Plugin> I<Plugin>
3026
3027 Use I<Plugin> as the plugin name when submitting values.
3028 Defaults to B<filecount>.
3029
3030 =item B<Instance> I<Instance>
3031
3032 Sets the plugin instance to I<Instance>. If not given, the instance is set to
3033 the directory name with all slashes replaced by underscores and all leading
3034 underscores removed. Empty value is allowed.
3035
3036 =item B<Name> I<Pattern>
3037
3038 Only count files that match I<Pattern>, where I<Pattern> is a shell-like
3039 wildcard as understood by L<fnmatch(3)>. Only the B<filename> is checked
3040 against the pattern, not the entire path. In case this makes it easier for you:
3041 This option has been named after the B<-name> parameter to L<find(1)>.
3042
3043 =item B<MTime> I<Age>
3044
3045 Count only files of a specific age: If I<Age> is greater than zero, only files
3046 that haven't been touched in the last I<Age> seconds are counted. If I<Age> is
3047 a negative number, this is inversed. For example, if B<-60> is specified, only
3048 files that have been modified in the last minute will be counted.
3049
3050 The number can also be followed by a "multiplier" to easily specify a larger
3051 timespan. When given in this notation, the argument must in quoted, i.E<nbsp>e.
3052 must be passed as string. So the B<-60> could also be written as B<"-1m"> (one
3053 minute). Valid multipliers are C<s> (second), C<m> (minute), C<h> (hour), C<d>
3054 (day), C<w> (week), and C<y> (year). There is no "month" multiplier. You can
3055 also specify fractional numbers, e.E<nbsp>g. B<"0.5d"> is identical to
3056 B<"12h">.
3057
3058 =item B<Size> I<Size>
3059
3060 Count only files of a specific size. When I<Size> is a positive number, only
3061 files that are at least this big are counted. If I<Size> is a negative number,
3062 this is inversed, i.E<nbsp>e. only files smaller than the absolute value of
3063 I<Size> are counted.
3064
3065 As with the B<MTime> option, a "multiplier" may be added. For a detailed
3066 description see above. Valid multipliers here are C<b> (byte), C<k> (kilobyte),
3067 C<m> (megabyte), C<g> (gigabyte), C<t> (terabyte), and C<p> (petabyte). Please
3068 note that there are 1000 bytes in a kilobyte, not 1024.
3069
3070 =item B<Recursive> I<true>|I<false>
3071
3072 Controls whether or not to recurse into subdirectories. Enabled by default.
3073
3074 =item B<IncludeHidden> I<true>|I<false>
3075
3076 Controls whether or not to include "hidden" files and directories in the count.
3077 "Hidden" files and directories are those, whose name begins with a dot.
3078 Defaults to I<false>, i.e. by default hidden files and directories are ignored.
3079
3080 =item B<RegularOnly> I<true>|I<false>
3081
3082 Controls whether or not to include only regular files in the count.
3083 Defaults to I<true>, i.e. by default non regular files are ignored.
3084
3085 =item B<FilesSizeType> I<Type>
3086
3087 Sets the type used to dispatch files combined size. Empty value ("") disables
3088 reporting. Defaults to B<bytes>.
3089
3090 =item B<FilesCountType> I<Type>
3091
3092 Sets the type used to dispatch number of files. Empty value ("") disables
3093 reporting. Defaults to B<files>.
3094
3095 =item B<TypeInstance> I<Instance>
3096
3097 Sets the I<type instance> used to dispatch values. Defaults to an empty string
3098 (no plugin instance).
3099
3100 =back
3101
3102 =head2 Plugin C<GenericJMX>
3103
3104 The I<GenericJMX plugin> is written in I<Java> and therefore documented in
3105 L<collectd-java(5)>.
3106
3107 =head2 Plugin C<gmond>
3108
3109 The I<gmond> plugin received the multicast traffic sent by B<gmond>, the
3110 statistics collection daemon of Ganglia. Mappings for the standard "metrics"
3111 are built-in, custom mappings may be added via B<Metric> blocks, see below.
3112
3113 Synopsis:
3114
3115  <Plugin "gmond">
3116    MCReceiveFrom "239.2.11.71" "8649"
3117    <Metric "swap_total">
3118      Type "swap"
3119      TypeInstance "total"
3120      DataSource "value"
3121    </Metric>
3122    <Metric "swap_free">
3123      Type "swap"
3124      TypeInstance "free"
3125      DataSource "value"
3126    </Metric>
3127  </Plugin>
3128
3129 The following metrics are built-in:
3130
3131 =over 4
3132
3133 =item *
3134
3135 load_one, load_five, load_fifteen
3136
3137 =item *
3138
3139 cpu_user, cpu_system, cpu_idle, cpu_nice, cpu_wio
3140
3141 =item *
3142
3143 mem_free, mem_shared, mem_buffers, mem_cached, mem_total
3144
3145 =item *
3146
3147 bytes_in, bytes_out
3148
3149 =item *
3150
3151 pkts_in, pkts_out
3152
3153 =back
3154
3155 Available configuration options:
3156
3157 =over 4
3158
3159 =item B<MCReceiveFrom> I<MCGroup> [I<Port>]
3160
3161 Sets sets the multicast group and UDP port to which to subscribe.
3162
3163 Default: B<239.2.11.71>E<nbsp>/E<nbsp>B<8649>
3164
3165 =item E<lt>B<Metric> I<Name>E<gt>
3166
3167 These blocks add a new metric conversion to the internal table. I<Name>, the
3168 string argument to the B<Metric> block, is the metric name as used by Ganglia.
3169
3170 =over 4
3171
3172 =item B<Type> I<Type>
3173
3174 Type to map this metric to. Required.
3175
3176 =item B<TypeInstance> I<Instance>
3177
3178 Type-instance to use. Optional.
3179
3180 =item B<DataSource> I<Name>
3181
3182 Data source to map this metric to. If the configured type has exactly one data
3183 source, this is optional. Otherwise the option is required.
3184
3185 =back
3186
3187 =back
3188
3189 =head2 Plugin C<gps>
3190
3191 The C<gps plugin> connects to gpsd on the host machine.
3192 The host, port, timeout and pause are configurable.
3193
3194 This is useful if you run an NTP server using a GPS for source and you want to
3195 monitor it.
3196
3197 Mind your GPS must send $--GSA for having the data reported!
3198
3199 The following elements are collected:
3200
3201 =over 4
3202
3203 =item B<satellites>
3204
3205 Number of satellites used for fix (type instance "used") and in view (type
3206 instance "visible"). 0 means no GPS satellites are visible.
3207
3208 =item B<dilution_of_precision>
3209
3210 Vertical and horizontal dilution (type instance "horizontal" or "vertical").
3211 It should be between 0 and 3.
3212 Look at the documentation of your GPS to know more.
3213
3214 =back
3215
3216 Synopsis:
3217
3218  LoadPlugin gps
3219  <Plugin "gps">
3220    # Connect to localhost on gpsd regular port:
3221    Host "127.0.0.1"
3222    Port "2947"
3223    # 15 ms timeout
3224    Timeout 0.015
3225    # PauseConnect of 5 sec. between connection attempts.
3226    PauseConnect 5
3227  </Plugin>
3228
3229 Available configuration options:
3230
3231 =over 4
3232
3233 =item B<Host> I<Host>
3234
3235 The host on which gpsd daemon runs. Defaults to B<localhost>.
3236
3237 =item B<Port> I<Port>
3238
3239 Port to connect to gpsd on the host machine. Defaults to B<2947>.
3240
3241 =item B<Timeout> I<Seconds>
3242
3243 Timeout in seconds (default 0.015 sec).
3244
3245 The GPS data stream is fetch by the plugin form the daemon.
3246 It waits for data to be available, if none arrives it times out
3247 and loop for another reading.
3248 Mind to put a low value gpsd expects value in the micro-seconds area
3249 (recommended is 500 us) since the waiting function is blocking.
3250 Value must be between 500 us and 5 sec., if outside that range the
3251 default value is applied.
3252
3253 This only applies from gpsd release-2.95.
3254
3255 =item B<PauseConnect> I<Seconds>
3256
3257 Pause to apply between attempts of connection to gpsd in seconds (default 5 sec).
3258
3259 =back
3260
3261 =head2 Plugin C<gpu_nvidia>
3262
3263 Efficiently collects various statistics from the system's NVIDIA GPUs using the
3264 NVML library. Currently collected are fan speed, core temperature, percent
3265 load, percent memory used, compute and memory frequencies, and power
3266 consumption.
3267
3268 =over 4
3269
3270 =item B<GPUIndex>
3271
3272 If one or more of these options is specified, only GPUs at that index (as
3273 determined by nvidia-utils through I<nvidia-smi>) have statistics collected.
3274 If no instance of this option is specified, all GPUs are monitored.
3275
3276 =item B<IgnoreSelected>
3277
3278 If set to true, all detected GPUs B<except> the ones at indices specified by
3279 B<GPUIndex> entries are collected. For greater clarity, setting IgnoreSelected
3280 without any GPUIndex directives will result in B<no> statistics being
3281 collected.
3282
3283 =back
3284
3285 =head2 Plugin C<grpc>
3286
3287 The I<grpc> plugin provides an RPC interface to submit values to or query
3288 values from collectd based on the open source gRPC framework. It exposes an
3289 end-point for dispatching values to the daemon.
3290
3291 The B<gRPC> homepage can be found at L<https://grpc.io/>.
3292
3293 =over 4
3294
3295 =item B<Server> I<Host> I<Port>
3296
3297 The B<Server> statement sets the address of a server to which to send metrics
3298 via the C<DispatchValues> function.
3299
3300 The argument I<Host> may be a hostname, an IPv4 address, or an IPv6 address.
3301
3302 Optionally, B<Server> may be specified as a configuration block which supports
3303 the following options:
3304
3305 =over 4
3306
3307 =item B<EnableSSL> B<false>|B<true>
3308
3309 Whether to require SSL for outgoing connections. Default: false.
3310
3311 =item B<SSLCACertificateFile> I<Filename>
3312
3313 =item B<SSLCertificateFile> I<Filename>
3314
3315 =item B<SSLCertificateKeyFile> I<Filename>
3316
3317 Filenames specifying SSL certificate and key material to be used with SSL
3318 connections.
3319
3320 =back
3321
3322 =item B<Listen> I<Host> I<Port>
3323
3324 The B<Listen> statement sets the network address to bind to. When multiple
3325 statements are specified, the daemon will bind to all of them. If none are
3326 specified, it defaults to B<0.0.0.0:50051>.
3327
3328 The argument I<Host> may be a hostname, an IPv4 address, or an IPv6 address.
3329
3330 Optionally, B<Listen> may be specified as a configuration block which
3331 supports the following options:
3332
3333 =over 4
3334
3335 =item B<EnableSSL> I<true>|I<false>
3336
3337 Whether to enable SSL for incoming connections. Default: false.
3338
3339 =item B<SSLCACertificateFile> I<Filename>
3340
3341 =item B<SSLCertificateFile> I<Filename>
3342
3343 =item B<SSLCertificateKeyFile> I<Filename>
3344
3345 Filenames specifying SSL certificate and key material to be used with SSL
3346 connections.
3347
3348 =item B<VerifyPeer> B<true>|B<false>
3349
3350 When enabled, a valid client certificate is required to connect to the server.
3351 When disabled, a client certifiacte is not requested and any unsolicited client
3352 certificate is accepted.
3353 Enabled by default.
3354
3355 =back
3356
3357 =back
3358
3359 =head2 Plugin C<hddtemp>
3360
3361 To get values from B<hddtemp> collectd connects to B<localhost> (127.0.0.1),
3362 port B<7634/tcp>. The B<Host> and B<Port> options can be used to change these
3363 default values, see below. C<hddtemp> has to be running to work correctly. If
3364 C<hddtemp> is not running timeouts may appear which may interfere with other
3365 statistics..
3366
3367 The B<hddtemp> homepage can be found at
3368 L<http://www.guzu.net/linux/hddtemp.php>.
3369
3370 =over 4
3371
3372 =item B<Host> I<Hostname>
3373
3374 Hostname to connect to. Defaults to B<127.0.0.1>.
3375
3376 =item B<Port> I<Port>
3377
3378 TCP-Port to connect to. Defaults to B<7634>.
3379
3380 =back
3381
3382 =head2 Plugin C<hugepages>
3383
3384 To collect B<hugepages> information, collectd reads directories
3385 "/sys/devices/system/node/*/hugepages" and
3386 "/sys/kernel/mm/hugepages".
3387 Reading of these directories can be disabled by the following
3388 options (default is enabled).
3389
3390 =over 4
3391
3392 =item B<ReportPerNodeHP> B<true>|B<false>
3393
3394 If enabled, information will be collected from the hugepage
3395 counters in "/sys/devices/system/node/*/hugepages".
3396 This is used to check the per-node hugepage statistics on
3397 a NUMA system.
3398
3399 =item B<ReportRootHP> B<true>|B<false>
3400
3401 If enabled, information will be collected from the hugepage
3402 counters in "/sys/kernel/mm/hugepages".
3403 This can be used on both NUMA and non-NUMA systems to check
3404 the overall hugepage statistics.
3405
3406 =item B<ValuesPages> B<true>|B<false>
3407
3408 Whether to report hugepages metrics in number of pages.
3409 Defaults to B<true>.
3410
3411 =item B<ValuesBytes> B<false>|B<true>
3412
3413 Whether to report hugepages metrics in bytes.
3414 Defaults to B<false>.
3415
3416 =item B<ValuesPercentage> B<false>|B<true>
3417
3418 Whether to report hugepages metrics as percentage.
3419 Defaults to B<false>.
3420
3421 =back
3422
3423 =head2 Plugin C<intel_pmu>
3424
3425 The I<intel_pmu> plugin collects performance counters data on Intel CPUs using
3426 Linux perf interface. All events are reported on a per core basis.
3427
3428 B<Synopsis:>
3429
3430   <Plugin intel_pmu>
3431     ReportHardwareCacheEvents true
3432     ReportKernelPMUEvents true
3433     ReportSoftwareEvents true
3434     EventList "/var/cache/pmu/GenuineIntel-6-2D-core.json"
3435     HardwareEvents "L2_RQSTS.CODE_RD_HIT,L2_RQSTS.CODE_RD_MISS" "L2_RQSTS.ALL_CODE_RD"
3436     Cores "0-3" "4,6" "[12-15]"
3437   </Plugin>
3438
3439 B<Options:>
3440
3441 =over 4
3442
3443 =item B<ReportHardwareCacheEvents> B<false>|B<true>
3444
3445 Enable or disable measuring of hardware CPU cache events:
3446   - L1-dcache-loads
3447   - L1-dcache-load-misses
3448   - L1-dcache-stores
3449   - L1-dcache-store-misses
3450   - L1-dcache-prefetches
3451   - L1-dcache-prefetch-misses
3452   - L1-icache-loads
3453   - L1-icache-load-misses
3454   - L1-icache-prefetches
3455   - L1-icache-prefetch-misses
3456   - LLC-loads
3457   - LLC-load-misses
3458   - LLC-stores
3459   - LLC-store-misses
3460   - LLC-prefetches
3461   - LLC-prefetch-misses
3462   - dTLB-loads
3463   - dTLB-load-misses
3464   - dTLB-stores
3465   - dTLB-store-misses
3466   - dTLB-prefetches
3467   - dTLB-prefetch-misses
3468   - iTLB-loads
3469   - iTLB-load-misses
3470   - branch-loads
3471   - branch-load-misses
3472
3473 =item B<ReportKernelPMUEvents> B<false>|B<true>
3474
3475 Enable or disable measuring of the following events:
3476   - cpu-cycles
3477   - instructions
3478   - cache-references
3479   - cache-misses
3480   - branches
3481   - branch-misses
3482   - bus-cycles
3483
3484 =item B<ReportSoftwareEvents> B<false>|B<true>
3485
3486 Enable or disable measuring of software events provided by kernel:
3487   - cpu-clock
3488   - task-clock
3489   - context-switches
3490   - cpu-migrations
3491   - page-faults
3492   - minor-faults
3493   - major-faults
3494   - alignment-faults
3495   - emulation-faults
3496
3497 =item B<EventList> I<filename>
3498
3499 JSON performance counter event list file name. To be able to monitor all Intel
3500 CPU specific events JSON event list file should be downloaded. Use the pmu-tools
3501 event_download.py script to download event list for current CPU.
3502
3503 =item B<HardwareEvents> I<events>
3504
3505 This field is a list of event names or groups of comma separated event names.
3506 This option requires B<EventList> option to be configured.
3507
3508 =item B<Cores> I<cores groups>
3509
3510 All events are reported on a per core basis. Monitoring of the events can be
3511 configured for a group of cores (aggregated statistics). This field defines
3512 groups of cores on which to monitor supported events. The field is represented
3513 as list of strings with core group values. Each string represents a list of
3514 cores in a group. If a group is enclosed in square brackets each core is added
3515 individually to a separate group (that is statistics are not aggregated).
3516 Allowed formats are:
3517     0,1,2,3
3518     0-10,20-18
3519     1,3,5-8,10,0x10-12
3520     [4-15,32-63]
3521
3522 If an empty string is provided as value for this field default cores
3523 configuration is applied - that is separate group is created for each core.
3524
3525 =back
3526
3527 =head2 Plugin C<intel_rdt>
3528
3529 The I<intel_rdt> plugin collects information provided by monitoring features of
3530 Intel Resource Director Technology (Intel(R) RDT) like Cache Monitoring
3531 Technology (CMT), Memory Bandwidth Monitoring (MBM). These features provide
3532 information about utilization of shared resources. CMT monitors last level cache
3533 occupancy (LLC). MBM supports two types of events reporting local and remote
3534 memory bandwidth. Local memory bandwidth (MBL) reports the bandwidth of
3535 accessing memory associated with the local socket. Remote memory bandwidth (MBR)
3536 reports the bandwidth of accessing the remote socket. Also this technology
3537 allows to monitor instructions per clock (IPC).
3538 Monitor events are hardware dependant. Monitoring capabilities are detected on
3539 plugin initialization and only supported events are monitored.
3540
3541 B<Note:> I<intel_rdt> plugin is using model-specific registers (MSRs), which
3542 require an additional capability to be enabled if collectd is run as a service.
3543 Please refer to I<contrib/systemd.collectd.service> file for more details.
3544
3545 B<Synopsis:>
3546
3547   <Plugin "intel_rdt">
3548     Cores "0-2" "3,4,6" "8-10,15"
3549     Processes "sshd,qemu-system-x86" "bash"
3550   </Plugin>
3551
3552 B<Options:>
3553
3554 =over 4
3555
3556 =item B<Interval> I<seconds>
3557
3558 The interval within which to retrieve statistics on monitored events in seconds.
3559 For milliseconds divide the time by 1000 for example if the desired interval
3560 is 50ms, set interval to 0.05. Due to limited capacity of counters it is not
3561 recommended to set interval higher than 1 sec.
3562
3563 =item B<Cores> I<cores groups>
3564
3565 Monitoring of the events can be configured for group of cores
3566 (aggregated statistics). This field defines groups of cores on which to monitor
3567 supported events. The field is represented as list of strings with core group
3568 values. Each string represents a list of cores in a group. Allowed formats are:
3569     0,1,2,3
3570     0-10,20-18
3571     1,3,5-8,10,0x10-12
3572
3573 If an empty string is provided as value for this field default cores
3574 configuration is applied - a separate group is created for each core.
3575
3576 =item B<Processes> I<process names groups>
3577
3578 Monitoring of the events can be configured for group of processes
3579 (aggregated statistics). This field defines groups of processes on which to
3580 monitor supported events. The field is represented as list of strings with
3581 process names group values. Each string represents a list of processes in a
3582 group. Allowed format is:
3583     sshd,bash,qemu
3584
3585 =back
3586
3587 B<Note:> By default global interval is used to retrieve statistics on monitored
3588 events. To configure a plugin specific interval use B<Interval> option of the
3589 intel_rdt <LoadPlugin> block. For milliseconds divide the time by 1000 for
3590 example if the desired interval is 50ms, set interval to 0.05.
3591 Due to limited capacity of counters it is not recommended to set interval higher
3592 than 1 sec.
3593
3594 =head2 Plugin C<interface>
3595
3596 =over 4
3597
3598 =item B<Interface> I<Interface>
3599
3600 Select this interface. By default these interfaces will then be collected. For
3601 a more detailed description see B<IgnoreSelected> below.
3602
3603 See F</"IGNORELISTS"> for details.
3604
3605 =item B<IgnoreSelected> I<true>|I<false>
3606
3607 If no configuration is given, the B<interface>-plugin will collect data from
3608 all interfaces. This may not be practical, especially for loopback- and
3609 similar interfaces. Thus, you can use the B<Interface>-option to pick the
3610 interfaces you're interested in. Sometimes, however, it's easier/preferred
3611 to collect all interfaces I<except> a few ones. This option enables you to
3612 do that: By setting B<IgnoreSelected> to I<true> the effect of
3613 B<Interface> is inverted: All selected interfaces are ignored and all
3614 other interfaces are collected.
3615
3616 It is possible to use regular expressions to match interface names, if the
3617 name is surrounded by I</.../> and collectd was compiled with support for
3618 regexps. This is useful if there's a need to collect (or ignore) data
3619 for a group of interfaces that are similarly named, without the need to
3620 explicitly list all of them (especially useful if the list is dynamic).
3621 Example:
3622
3623  Interface "lo"
3624  Interface "/^veth/"
3625  Interface "/^tun[0-9]+/"
3626  IgnoreSelected "true"
3627
3628 This will ignore the loopback interface, all interfaces with names starting
3629 with I<veth> and all interfaces with names starting with I<tun> followed by
3630 at least one digit.
3631
3632 =item B<ReportInactive> I<true>|I<false>
3633
3634 When set to I<false>, only interfaces with non-zero traffic will be
3635 reported. Note that the check is done by looking into whether a
3636 package was sent at any time from boot and the corresponding counter
3637 is non-zero. So, if the interface has been sending data in the past
3638 since boot, but not during the reported time-interval, it will still
3639 be reported.
3640
3641 The default value is I<true> and results in collection of the data
3642 from all interfaces that are selected by B<Interface> and
3643 B<IgnoreSelected> options.
3644
3645 =item B<UniqueName> I<true>|I<false>
3646
3647 Interface name is not unique on Solaris (KSTAT), interface name is unique
3648 only within a module/instance. Following tuple is considered unique:
3649    (ks_module, ks_instance, ks_name)
3650 If this option is set to true, interface name contains above three fields
3651 separated by an underscore. For more info on KSTAT, visit
3652 L<http://docs.oracle.com/cd/E23824_01/html/821-1468/kstat-3kstat.html#REFMAN3Ekstat-3kstat>
3653
3654 This option is only available on Solaris.
3655
3656 =back
3657
3658 =head2 Plugin C<ipmi>
3659
3660 The B<ipmi plugin> allows to monitor server platform status using the Intelligent
3661 Platform Management Interface (IPMI). Local and remote interfaces are supported.
3662
3663 The plugin configuration consists of one or more B<Instance> blocks which
3664 specify one I<ipmi> connection each. Each block requires one unique string
3665 argument as the instance name. If instances are not configured, an instance with
3666 the default option values will be created.
3667
3668 For backwards compatibility, any option other than B<Instance> block will trigger
3669 legacy config handling and it will be treated as an option within B<Instance>
3670 block. This support will go away in the next major version of Collectd.
3671
3672 Within the B<Instance> blocks, the following options are allowed:
3673
3674 =over 4
3675
3676 =item B<Address> I<Address>
3677
3678 Hostname or IP to connect to. If not specified, plugin will try to connect to
3679 local management controller (BMC).
3680
3681 =item B<Username> I<Username>
3682
3683 =item B<Password> I<Password>
3684
3685 The username and the password to use for the connection to remote BMC.
3686
3687 =item B<AuthType> I<MD5>|I<rmcp+>
3688
3689 Forces the authentication type to use for the connection to remote BMC.
3690 By default most secure type is seleted.
3691
3692 =item B<Host> I<Hostname>
3693
3694 Sets the B<host> field of dispatched values. Defaults to the global hostname
3695 setting.
3696
3697 =item B<Sensor> I<Sensor>
3698
3699 Selects sensors to collect or to ignore, depending on B<IgnoreSelected>.
3700
3701 See F</"IGNORELISTS"> for details.
3702
3703 =item B<IgnoreSelected> I<true>|I<false>
3704
3705 If no configuration if given, the B<ipmi> plugin will collect data from all
3706 sensors found of type "temperature", "voltage", "current" and "fanspeed".
3707 This option enables you to do that: By setting B<IgnoreSelected> to I<true>
3708 the effect of B<Sensor> is inverted: All selected sensors are ignored and
3709 all other sensors are collected.
3710
3711 =item B<NotifySensorAdd> I<true>|I<false>
3712
3713 If a sensor appears after initialization time of a minute a notification
3714 is sent.
3715
3716 =item B<NotifySensorRemove> I<true>|I<false>
3717
3718 If a sensor disappears a notification is sent.
3719
3720 =item B<NotifySensorNotPresent> I<true>|I<false>
3721
3722 If you have for example dual power supply and one of them is (un)plugged then
3723 a notification is sent.
3724
3725 =item B<NotifyIPMIConnectionState> I<true>|I<false>
3726
3727 If a IPMI connection state changes after initialization time of a minute
3728 a notification is sent. Defaults to B<false>.
3729
3730 =item B<SELEnabled> I<true>|I<false>
3731
3732 If system event log (SEL) is enabled, plugin will listen for sensor threshold
3733 and discrete events. When event is received the notification is sent.
3734 SEL event filtering can be configured using B<SELSensor> and B<SELIgnoreSelected>
3735 config options.
3736 Defaults to B<false>.
3737
3738 =item B<SELSensor> I<SELSensor>
3739
3740 Selects sensors to get events from or to ignore, depending on B<SELIgnoreSelected>.
3741
3742 See F</"IGNORELISTS"> for details.
3743
3744 =item B<SELIgnoreSelected> I<true>|I<false>
3745
3746 If no configuration is given, the B<ipmi> plugin will pass events from all
3747 sensors. This option enables you to do that: By setting B<SELIgnoreSelected>
3748 to I<true> the effect of B<SELSensor> is inverted: All events from selected
3749 sensors are ignored and all events from other sensors are passed.
3750
3751 =item B<SELClearEvent> I<true>|I<false>
3752
3753 If SEL clear event is enabled, plugin will delete event from SEL list after
3754 it is received and successfully handled. In this case other tools that are
3755 subscribed for SEL events will receive an empty event.
3756 Defaults to B<false>.
3757
3758 =back
3759
3760 =head2 Plugin C<iptables>
3761
3762 =over 4
3763
3764 =item B<Chain> I<Table> I<Chain> [I<Comment|Number> [I<Name>]]
3765
3766 =item B<Chain6> I<Table> I<Chain> [I<Comment|Number> [I<Name>]]
3767
3768 Select the iptables/ip6tables filter rules to count packets and bytes from.
3769
3770 If only I<Table> and I<Chain> are given, this plugin will collect the counters
3771 of all rules which have a comment-match. The comment is then used as
3772 type-instance.
3773
3774 If I<Comment> or I<Number> is given, only the rule with the matching comment or
3775 the I<n>th rule will be collected. Again, the comment (or the number) will be
3776 used as the type-instance.
3777
3778 If I<Name> is supplied, it will be used as the type-instance instead of the
3779 comment or the number.
3780
3781 =back
3782
3783 =head2 Plugin C<irq>
3784
3785 =over 4
3786
3787 =item B<Irq> I<Irq>
3788
3789 Select this irq. By default these irqs will then be collected. For a more
3790 detailed description see B<IgnoreSelected> below.
3791
3792 See F</"IGNORELISTS"> for details.
3793
3794 =item B<IgnoreSelected> I<true>|I<false>
3795
3796 If no configuration if given, the B<irq>-plugin will collect data from all
3797 irqs. This may not be practical, especially if no interrupts happen. Thus, you
3798 can use the B<Irq>-option to pick the interrupt you're interested in.
3799 Sometimes, however, it's easier/preferred to collect all interrupts I<except> a
3800 few ones. This option enables you to do that: By setting B<IgnoreSelected> to
3801 I<true> the effect of B<Irq> is inverted: All selected interrupts are ignored
3802 and all other interrupts are collected.
3803
3804 =back
3805
3806 =head2 Plugin C<java>
3807
3808 The I<Java> plugin makes it possible to write extensions for collectd in Java.
3809 This section only discusses the syntax and semantic of the configuration
3810 options. For more in-depth information on the I<Java> plugin, please read
3811 L<collectd-java(5)>.
3812
3813 Synopsis:
3814
3815  <Plugin "java">
3816    JVMArg "-verbose:jni"
3817    JVMArg "-Djava.class.path=/opt/collectd/lib/collectd/bindings/java"
3818    LoadPlugin "org.collectd.java.Foobar"
3819    <Plugin "org.collectd.java.Foobar">
3820      # To be parsed by the plugin
3821    </Plugin>
3822  </Plugin>
3823
3824 Available configuration options:
3825
3826 =over 4
3827
3828 =item B<JVMArg> I<Argument>
3829
3830 Argument that is to be passed to the I<Java Virtual Machine> (JVM). This works
3831 exactly the way the arguments to the I<java> binary on the command line work.
3832 Execute C<javaE<nbsp>--help> for details.
3833
3834 Please note that B<all> these options must appear B<before> (i.E<nbsp>e. above)
3835 any other options! When another option is found, the JVM will be started and
3836 later options will have to be ignored!
3837
3838 =item B<LoadPlugin> I<JavaClass>
3839
3840 Instantiates a new I<JavaClass> object. The constructor of this object very
3841 likely then registers one or more callback methods with the server.
3842
3843 See L<collectd-java(5)> for details.
3844
3845 When the first such option is found, the virtual machine (JVM) is created. This
3846 means that all B<JVMArg> options must appear before (i.E<nbsp>e. above) all
3847 B<LoadPlugin> options!
3848
3849 =item B<Plugin> I<Name>
3850
3851 The entire block is passed to the Java plugin as an
3852 I<org.collectd.api.OConfigItem> object.
3853
3854 For this to work, the plugin has to register a configuration callback first,
3855 see L<collectd-java(5)/"config callback">. This means, that the B<Plugin> block
3856 must appear after the appropriate B<LoadPlugin> block. Also note, that I<Name>
3857 depends on the (Java) plugin registering the callback and is completely
3858 independent from the I<JavaClass> argument passed to B<LoadPlugin>.
3859
3860 =back
3861
3862 =head2 Plugin C<load>
3863
3864 The I<Load plugin> collects the system load. These numbers give a rough overview
3865 over the utilization of a machine. The system load is defined as the number of
3866 runnable tasks in the run-queue and is provided by many operating systems as a
3867 one, five or fifteen minute average.
3868
3869 The following configuration options are available:
3870
3871 =over 4
3872
3873 =item B<ReportRelative> B<false>|B<true>
3874
3875 When enabled, system load divided by number of available CPU cores is reported
3876 for intervals 1 min, 5 min and 15 min. Defaults to false.
3877
3878 =back
3879
3880
3881 =head2 Plugin C<logfile>
3882
3883 =over 4
3884
3885 =item B<LogLevel> B<debug|info|notice|warning|err>
3886
3887 Sets the log-level. If, for example, set to B<notice>, then all events with
3888 severity B<notice>, B<warning>, or B<err> will be written to the logfile.
3889
3890 Please note that B<debug> is only available if collectd has been compiled with
3891 debugging support.
3892
3893 =item B<File> I<File>
3894
3895 Sets the file to write log messages to. The special strings B<stdout> and
3896 B<stderr> can be used to write to the standard output and standard error
3897 channels, respectively. This, of course, only makes much sense when I<collectd>
3898 is running in foreground- or non-daemon-mode.
3899
3900 =item B<Timestamp> B<true>|B<false>
3901
3902 Prefix all lines printed by the current time. Defaults to B<true>.
3903
3904 =item B<PrintSeverity> B<true>|B<false>
3905
3906 When enabled, all lines are prefixed by the severity of the log message, for
3907 example "warning". Defaults to B<false>.
3908
3909 =back
3910
3911 B<Note>: There is no need to notify the daemon after moving or removing the
3912 log file (e.E<nbsp>g. when rotating the logs). The plugin reopens the file
3913 for each line it writes.
3914
3915 =head2 Plugin C<log_logstash>
3916
3917 The I<log logstash plugin> behaves like the logfile plugin but formats
3918 messages as JSON events for logstash to parse and input.
3919
3920 =over 4
3921
3922 =item B<LogLevel> B<debug|info|notice|warning|err>
3923
3924 Sets the log-level. If, for example, set to B<notice>, then all events with
3925 severity B<notice>, B<warning>, or B<err> will be written to the logfile.
3926
3927 Please note that B<debug> is only available if collectd has been compiled with
3928 debugging support.
3929
3930 =item B<File> I<File>
3931
3932 Sets the file to write log messages to. The special strings B<stdout> and
3933 B<stderr> can be used to write to the standard output and standard error
3934 channels, respectively. This, of course, only makes much sense when I<collectd>
3935 is running in foreground- or non-daemon-mode.
3936
3937 =back
3938
3939 B<Note>: There is no need to notify the daemon after moving or removing the
3940 log file (e.E<nbsp>g. when rotating the logs). The plugin reopens the file
3941 for each line it writes.
3942
3943 =head2 Plugin C<lpar>
3944
3945 The I<LPAR plugin> reads CPU statistics of I<Logical Partitions>, a
3946 virtualization technique for IBM POWER processors. It takes into account CPU
3947 time stolen from or donated to a partition, in addition to the usual user,
3948 system, I/O statistics.
3949
3950 The following configuration options are available:
3951
3952 =over 4
3953
3954 =item B<CpuPoolStats> B<false>|B<true>
3955
3956 When enabled, statistics about the processor pool are read, too. The partition
3957 needs to have pool authority in order to be able to acquire this information.
3958 Defaults to false.
3959
3960 =item B<ReportBySerial> B<false>|B<true>
3961
3962 If enabled, the serial of the physical machine the partition is currently
3963 running on is reported as I<hostname> and the logical hostname of the machine
3964 is reported in the I<plugin instance>. Otherwise, the logical hostname will be
3965 used (just like other plugins) and the I<plugin instance> will be empty.
3966 Defaults to false.
3967
3968 =back
3969
3970 =head2 Plugin C<lua>
3971
3972 This plugin embeds a Lua interpreter into collectd and provides an interface
3973 to collectd's plugin system. See L<collectd-lua(5)> for its documentation.
3974
3975
3976 =head2 Plugin C<mbmon>
3977
3978 The C<mbmon plugin> uses mbmon to retrieve temperature, voltage, etc.
3979
3980 Be default collectd connects to B<localhost> (127.0.0.1), port B<411/tcp>. The
3981 B<Host> and B<Port> options can be used to change these values, see below.
3982 C<mbmon> has to be running to work correctly. If C<mbmon> is not running
3983 timeouts may appear which may interfere with other statistics..
3984
3985 C<mbmon> must be run with the -r option ("print TAG and Value format");
3986 Debian's F</etc/init.d/mbmon> script already does this, other people
3987 will need to ensure that this is the case.
3988
3989 =over 4
3990
3991 =item B<Host> I<Hostname>
3992
3993 Hostname to connect to. Defaults to B<127.0.0.1>.
3994
3995 =item B<Port> I<Port>
3996
3997 TCP-Port to connect to. Defaults to B<411>.
3998
3999 =back
4000
4001 =head2 Plugin C<mcelog>
4002
4003 The C<mcelog plugin> uses mcelog to retrieve machine check exceptions.
4004
4005 By default the plugin connects to B<"/var/run/mcelog-client"> to check if the
4006 mcelog server is running. When the server is running, the plugin will tail the
4007 specified logfile to retrieve machine check exception information and send a
4008 notification with the details from the logfile. The plugin will use the mcelog
4009 client protocol to retrieve memory related machine check exceptions. Note that
4010 for memory exceptions, notifications are only sent when there is a change in
4011 the number of corrected/uncorrected memory errors.
4012
4013 =head3 The Memory block
4014
4015 Note: these options cannot be used in conjunction with the logfile options, they are mutually
4016 exclusive.
4017
4018 =over 3
4019
4020 =item B<McelogClientSocket> I<Path>
4021 Connect to the mcelog client socket using the UNIX domain socket at I<Path>.
4022 Defaults to B<"/var/run/mcelog-client">.
4023
4024 =item B<PersistentNotification> B<true>|B<false>
4025 Override default configuration to only send notifications when sent when there
4026 is a change in the number of corrected/uncorrected memory errors. When set to
4027 true notifications will be sent for every read cycle. Default is false. Does
4028 not affect the stats being dispatched.
4029
4030 =back
4031
4032 =over 4
4033
4034 =item B<McelogLogfile> I<Path>
4035
4036 The mcelog file to parse. Defaults to B<"/var/log/mcelog">. Note: this option
4037 cannot be used in conjunction with the memory block options, they are mutually
4038 exclusive.
4039
4040 =back
4041
4042 =head2 Plugin C<md>
4043
4044 The C<md plugin> collects information from Linux Software-RAID devices (md).
4045
4046 All reported values are of the type C<md_disks>. Reported type instances are
4047 I<active>, I<failed> (present but not operational), I<spare> (hot stand-by) and
4048 I<missing> (physically absent) disks.
4049
4050 =over 4
4051
4052 =item B<Device> I<Device>
4053
4054 Select md devices based on device name. The I<device name> is the basename of
4055 the device, i.e. the name of the block device without the leading C</dev/>.
4056 See B<IgnoreSelected> for more details.
4057
4058 See F</"IGNORELISTS"> for details.
4059
4060 =item B<IgnoreSelected> B<true>|B<false>
4061
4062 Invert device selection: If set to B<true>, all md devices B<except> those
4063 listed using B<Device> are collected. If B<false> (the default), only those
4064 listed are collected. If no configuration is given, the B<md> plugin will
4065 collect data from all md devices.
4066
4067 =back
4068
4069 =head2 Plugin C<memcachec>
4070
4071 The C<memcachec plugin> connects to a memcached server, queries one or more
4072 given I<pages> and parses the returned data according to user specification.
4073 The I<matches> used are the same as the matches used in the C<curl> and C<tail>
4074 plugins.
4075
4076 In order to talk to the memcached server, this plugin uses the I<libmemcached>
4077 library. Please note that there is another library with a very similar name,
4078 libmemcache (notice the missing `d'), which is not applicable.
4079
4080 Synopsis of the configuration:
4081
4082  <Plugin "memcachec">
4083    <Page "plugin_instance">
4084      Server "localhost"
4085      Key "page_key"
4086      Plugin "plugin_name"
4087      <Match>
4088        Regex "(\\d+) bytes sent"
4089        DSType CounterAdd
4090        Type "ipt_octets"
4091        Instance "type_instance"
4092      </Match>
4093    </Page>
4094  </Plugin>
4095
4096 The configuration options are:
4097
4098 =over 4
4099
4100 =item E<lt>B<Page> I<Name>E<gt>
4101
4102 Each B<Page> block defines one I<page> to be queried from the memcached server.
4103 The block requires one string argument which is used as I<plugin instance>.
4104
4105 =item B<Server> I<Address>
4106
4107 Sets the server address to connect to when querying the page. Must be inside a
4108 B<Page> block.
4109
4110 =item B<Key> I<Key>
4111
4112 When connected to the memcached server, asks for the page I<Key>.
4113
4114 =item B<Plugin> I<Plugin>
4115
4116 Use I<Plugin> as the plugin name when submitting values.
4117 Defaults to C<memcachec>.
4118
4119 =item E<lt>B<Match>E<gt>
4120
4121 Match blocks define which strings to look for and how matches substrings are
4122 interpreted. For a description of match blocks, please see L<"Plugin tail">.
4123
4124 =back
4125
4126 =head2 Plugin C<memcached>
4127
4128 The B<memcached plugin> connects to a memcached server and queries statistics
4129 about cache utilization, memory and bandwidth used.
4130 L<http://memcached.org/>
4131
4132  <Plugin "memcached">
4133    <Instance "name">
4134      #Host "memcache.example.com"
4135      Address "127.0.0.1"
4136      Port 11211
4137    </Instance>
4138  </Plugin>
4139
4140 The plugin configuration consists of one or more B<Instance> blocks which
4141 specify one I<memcached> connection each. Within the B<Instance> blocks, the
4142 following options are allowed:
4143
4144 =over 4
4145
4146 =item B<Host> I<Hostname>
4147
4148 Sets the B<host> field of dispatched values. Defaults to the global hostname
4149 setting.
4150 For backwards compatibility, values are also dispatched with the global
4151 hostname when B<Host> is set to B<127.0.0.1> or B<localhost> and B<Address> is
4152 not set.
4153
4154 =item B<Address> I<Address>
4155
4156 Hostname or IP to connect to. For backwards compatibility, defaults to the
4157 value of B<Host> or B<127.0.0.1> if B<Host> is unset.
4158
4159 =item B<Port> I<Port>
4160
4161 TCP port to connect to. Defaults to B<11211>.
4162
4163 =item B<Socket> I<Path>
4164
4165 Connect to I<memcached> using the UNIX domain socket at I<Path>. If this
4166 setting is given, the B<Address> and B<Port> settings are ignored.
4167
4168 =back
4169
4170 =head2 Plugin C<mic>
4171
4172 The B<mic plugin> gathers CPU statistics, memory usage and temperatures from
4173 Intel's Many Integrated Core (MIC) systems.
4174
4175 B<Synopsis:>
4176
4177  <Plugin mic>
4178    ShowCPU true
4179    ShowCPUCores true
4180    ShowMemory true
4181
4182    ShowTemperatures true
4183    Temperature vddg
4184    Temperature vddq
4185    IgnoreSelectedTemperature true
4186
4187    ShowPower true
4188    Power total0
4189    Power total1
4190    IgnoreSelectedPower true
4191  </Plugin>
4192
4193 The following options are valid inside the B<PluginE<nbsp>mic> block:
4194
4195 =over 4
4196
4197 =item B<ShowCPU> B<true>|B<false>
4198
4199 If enabled (the default) a sum of the CPU usage across all cores is reported.
4200
4201 =item B<ShowCPUCores> B<true>|B<false>
4202
4203 If enabled (the default) per-core CPU usage is reported.
4204
4205 =item B<ShowMemory> B<true>|B<false>
4206
4207 If enabled (the default) the physical memory usage of the MIC system is
4208 reported.
4209
4210 =item B<ShowTemperatures> B<true>|B<false>
4211
4212 If enabled (the default) various temperatures of the MIC system are reported.
4213
4214 =item B<Temperature> I<Name>
4215
4216 This option controls which temperatures are being reported. Whether matching
4217 temperatures are being ignored or I<only> matching temperatures are reported
4218 depends on the B<IgnoreSelectedTemperature> setting below. By default I<all>
4219 temperatures are reported.
4220
4221 =item B<IgnoreSelectedTemperature> B<false>|B<true>
4222
4223 Controls the behavior of the B<Temperature> setting above. If set to B<false>
4224 (the default) only temperatures matching a B<Temperature> option are reported
4225 or, if no B<Temperature> option is specified, all temperatures are reported. If
4226 set to B<true>, matching temperatures are I<ignored> and all other temperatures
4227 are reported.
4228
4229 Known temperature names are:
4230
4231 =over 4
4232
4233 =item die
4234
4235 Die of the CPU
4236
4237 =item devmem
4238
4239 Device Memory
4240
4241 =item fin
4242
4243 Fan In
4244
4245 =item fout
4246
4247 Fan Out
4248
4249 =item vccp
4250
4251 Voltage ccp
4252
4253 =item vddg
4254
4255 Voltage ddg
4256
4257 =item vddq
4258
4259 Voltage ddq
4260
4261 =back
4262
4263 =item B<ShowPower> B<true>|B<false>
4264
4265 If enabled (the default) various temperatures of the MIC system are reported.
4266
4267 =item B<Power> I<Name>
4268
4269 This option controls which power readings are being reported. Whether matching
4270 power readings are being ignored or I<only> matching power readings are reported
4271 depends on the B<IgnoreSelectedPower> setting below. By default I<all>
4272 power readings are reported.
4273
4274 =item B<IgnoreSelectedPower> B<false>|B<true>
4275
4276 Controls the behavior of the B<Power> setting above. If set to B<false>
4277 (the default) only power readings matching a B<Power> option are reported
4278 or, if no B<Power> option is specified, all power readings are reported. If
4279 set to B<true>, matching power readings are I<ignored> and all other power readings
4280 are reported.
4281
4282 Known power names are:
4283
4284 =over 4
4285
4286 =item total0
4287
4288 Total power utilization averaged over Time Window 0 (uWatts).
4289
4290 =item total1
4291
4292 Total power utilization averaged over Time Window 0 (uWatts).
4293
4294 =item inst
4295
4296 Instantaneous power (uWatts).
4297
4298 =item imax
4299
4300 Max instantaneous power (uWatts).
4301
4302 =item pcie
4303
4304 PCI-E connector power (uWatts).
4305
4306 =item c2x3
4307
4308 2x3 connector power (uWatts).
4309
4310 =item c2x4
4311
4312 2x4 connector power (uWatts).
4313
4314 =item vccp
4315
4316 Core rail (uVolts).
4317
4318 =item vddg
4319
4320 Uncore rail (uVolts).
4321
4322 =item vddq
4323
4324 Memory subsystem rail (uVolts).
4325
4326 =back
4327
4328 =back
4329
4330 =head2 Plugin C<memory>
4331
4332 The I<memory plugin> provides the following configuration options:
4333
4334 =over 4
4335
4336 =item B<ValuesAbsolute> B<true>|B<false>
4337
4338 Enables or disables reporting of physical memory usage in absolute numbers,
4339 i.e. bytes. Defaults to B<true>.
4340
4341 =item B<ValuesPercentage> B<false>|B<true>
4342
4343 Enables or disables reporting of physical memory usage in percentages, e.g.
4344 percent of physical memory used. Defaults to B<false>.
4345
4346 This is useful for deploying I<collectd> in a heterogeneous environment in
4347 which the sizes of physical memory vary.
4348
4349 =back
4350
4351 =head2 Plugin C<modbus>
4352
4353 The B<modbus plugin> connects to a Modbus "slave" via Modbus/TCP or Modbus/RTU and
4354 reads register values. It supports reading single registers (unsigned 16E<nbsp>bit
4355 values), large integer values (unsigned 32E<nbsp>bit and 64E<nbsp>bit values) and
4356 floating point values (two registers interpreted as IEEE floats in big endian
4357 notation).
4358
4359 B<Synopsis:>
4360
4361  <Data "voltage-input-1">
4362    RegisterBase 0
4363    RegisterType float
4364    RegisterCmd ReadHolding
4365    Type voltage
4366    Instance "input-1"
4367    #Scale 1.0
4368    #Shift 0.0
4369  </Data>
4370
4371  <Data "voltage-input-2">
4372    RegisterBase 2
4373    RegisterType float
4374    RegisterCmd ReadHolding
4375    Type voltage
4376    Instance "input-2"
4377  </Data>
4378
4379  <Data "supply-temperature-1">
4380    RegisterBase 0
4381    RegisterType Int16
4382    RegisterCmd ReadHolding
4383    Type temperature
4384    Instance "temp-1"
4385  </Data>
4386
4387  <Host "modbus.example.com">
4388    Address "192.168.0.42"
4389    Port    "502"
4390    Interval 60
4391
4392    <Slave 1>
4393      Instance "power-supply"
4394      Collect  "voltage-input-1"
4395      Collect  "voltage-input-2"
4396    </Slave>
4397  </Host>
4398
4399  <Host "localhost">
4400    Device "/dev/ttyUSB0"
4401    Baudrate 38400
4402    Interval 20
4403
4404    <Slave 1>
4405      Instance "temperature"
4406      Collect  "supply-temperature-1"
4407    </Slave>
4408  </Host>
4409
4410 =over 4
4411
4412 =item E<lt>B<Data> I<Name>E<gt> blocks
4413
4414 Data blocks define a mapping between register numbers and the "types" used by
4415 I<collectd>.
4416
4417 Within E<lt>DataE<nbsp>/E<gt> blocks, the following options are allowed:
4418
4419 =over 4
4420
4421 =item B<RegisterBase> I<Number>
4422
4423 Configures the base register to read from the device. If the option
4424 B<RegisterType> has been set to B<Uint32> or B<Float>, this and the next
4425 register will be read (the register number is increased by one).
4426
4427 =item B<RegisterType> B<Int16>|B<Int32>|B<Int64>|B<Uint16>|B<Uint32>|B<UInt64>|B<Float>|B<Int32LE>|B<Uint32LE>|B<FloatLE>
4428
4429 Specifies what kind of data is returned by the device. This defaults to
4430 B<Uint16>.  If the type is B<Int32>, B<Int32LE>, B<Uint32>, B<Uint32LE>,
4431 B<Float> or B<FloatLE>, two 16E<nbsp>bit registers at B<RegisterBase>
4432 and B<RegisterBase+1> will be read and the data is combined into one
4433 32E<nbsp>value. For B<Int32>, B<Uint32> and B<Float> the most significant
4434 16E<nbsp>bits are in the register at B<RegisterBase> and the least
4435 significant 16E<nbsp>bits are in the register at B<RegisterBase+1>.
4436 For B<Int32LE>, B<Uint32LE>, or B<Float32LE>, the high and low order
4437 registers are swapped with the most significant 16E<nbsp>bits in
4438 the B<RegisterBase+1> and the least significant 16E<nbsp>bits in
4439 B<RegisterBase>. If the type is B<Int64> or B<UInt64>, four 16E<nbsp>bit
4440 registers at B<RegisterBase>, B<RegisterBase+1>, B<RegisterBase+2> and
4441 B<RegisterBase+3> will be read and the data combined into one
4442 64E<nbsp>value.
4443
4444 =item B<RegisterCmd> B<ReadHolding>|B<ReadInput>
4445
4446 Specifies register type to be collected from device. Works only with libmodbus
4447 2.9.2 or higher. Defaults to B<ReadHolding>.
4448
4449 =item B<Type> I<Type>
4450
4451 Specifies the "type" (data set) to use when dispatching the value to
4452 I<collectd>. Currently, only data sets with exactly one data source are
4453 supported.
4454
4455 =item B<Instance> I<Instance>
4456
4457 Sets the type instance to use when dispatching the value to I<Instance>. If
4458 unset, an empty string (no type instance) is used.
4459
4460 =item B<Scale> I<Value>
4461
4462 The values taken from device are multiplied by I<Value>. The field is optional
4463 and the default is B<1.0>.
4464
4465 =item B<Shift> I<Value>
4466
4467 I<Value> is added to values from device after they have been multiplied by
4468 B<Scale> value. The field is optional and the default value is B<0.0>.
4469
4470 =back
4471
4472 =item E<lt>B<Host> I<Name>E<gt> blocks
4473
4474 Host blocks are used to specify to which hosts to connect and what data to read
4475 from their "slaves". The string argument I<Name> is used as hostname when
4476 dispatching the values to I<collectd>.
4477
4478 Within E<lt>HostE<nbsp>/E<gt> blocks, the following options are allowed:
4479
4480 =over 4
4481
4482 =item B<Address> I<Hostname>
4483
4484 For Modbus/TCP, specifies the node name (the actual network address) used to
4485 connect to the host. This may be an IP address or a hostname. Please note that
4486 the used I<libmodbus> library only supports IPv4 at the moment.
4487
4488 =item B<Port> I<Service>
4489
4490 for Modbus/TCP, specifies the port used to connect to the host. The port can
4491 either be given as a number or as a service name. Please note that the
4492 I<Service> argument must be a string, even if ports are given in their numerical
4493 form. Defaults to "502".
4494
4495 =item B<Device> I<Devicenode>
4496
4497 For Modbus/RTU, specifies the path to the serial device being used.
4498
4499 =item B<Baudrate> I<Baudrate>
4500
4501 For Modbus/RTU, specifies the baud rate of the serial device.
4502 Note, connections currently support only 8/N/1.
4503
4504 =item B<UARTType> I<UARTType>
4505
4506 For Modbus/RTU, specifies the type of the serial device.
4507 RS232, RS422 and RS485 are supported. Defaults to RS232.
4508 Available only on Linux systems with libmodbus>=2.9.4.
4509
4510 =item B<Interval> I<Interval>
4511
4512 Sets the interval (in seconds) in which the values will be collected from this
4513 host. By default the global B<Interval> setting will be used.
4514
4515 =item E<lt>B<Slave> I<ID>E<gt>
4516
4517 Over each connection, multiple Modbus devices may be reached. The slave ID
4518 is used to specify which device should be addressed. For each device you want
4519 to query, one B<Slave> block must be given.
4520
4521 Within E<lt>SlaveE<nbsp>/E<gt> blocks, the following options are allowed:
4522
4523 =over 4
4524
4525 =item B<Instance> I<Instance>
4526
4527 Specify the plugin instance to use when dispatching the values to I<collectd>.
4528 By default "slave_I<ID>" is used.
4529
4530 =item B<Collect> I<DataName>
4531
4532 Specifies which data to retrieve from the device. I<DataName> must be the same
4533 string as the I<Name> argument passed to a B<Data> block. You can specify this
4534 option multiple times to collect more than one value from a slave. At least one
4535 B<Collect> option is mandatory.
4536
4537 =back
4538
4539 =back
4540
4541 =back
4542
4543 =head2 Plugin C<mqtt>
4544
4545 The I<MQTT plugin> can send metrics to MQTT (B<Publish> blocks) and receive
4546 values from MQTT (B<Subscribe> blocks).
4547
4548 B<Synopsis:>
4549
4550  <Plugin mqtt>
4551    <Publish "name">
4552      Host "mqtt.example.com"
4553      Prefix "collectd"
4554    </Publish>
4555    <Subscribe "name">
4556      Host "mqtt.example.com"
4557      Topic "collectd/#"
4558    </Subscribe>
4559  </Plugin>
4560
4561 The plugin's configuration is in B<Publish> and/or B<Subscribe> blocks,
4562 configuring the sending and receiving direction respectively. The plugin will
4563 register a write callback named C<mqtt/I<name>> where I<name> is the string
4564 argument given to the B<Publish> block. Both types of blocks share many but not
4565 all of the following options. If an option is valid in only one of the blocks,
4566 it will be mentioned explicitly.
4567
4568 B<Options:>
4569
4570 =over 4
4571
4572 =item B<Host> I<Hostname>
4573
4574 Hostname of the MQTT broker to connect to.
4575
4576 =item B<Port> I<Service>
4577
4578 Port number or service name of the MQTT broker to connect to.
4579
4580 =item B<User> I<UserName>
4581
4582 Username used when authenticating to the MQTT broker.
4583
4584 =item B<Password> I<Password>
4585
4586 Password used when authenticating to the MQTT broker.
4587
4588 =item B<ClientId> I<ClientId>
4589
4590 MQTT client ID to use. Defaults to the hostname used by I<collectd>.
4591
4592 =item B<QoS> [B<0>-B<2>]
4593
4594 Sets the I<Quality of Service>, with the values C<0>, C<1> and C<2> meaning:
4595
4596 =over 4
4597
4598 =item B<0>
4599
4600 At most once
4601
4602 =item B<1>
4603
4604 At least once
4605
4606 =item B<2>
4607
4608 Exactly once
4609
4610 =back
4611
4612 In B<Publish> blocks, this option determines the QoS flag set on outgoing
4613 messages and defaults to B<0>. In B<Subscribe> blocks, determines the maximum
4614 QoS setting the client is going to accept and defaults to B<2>. If the QoS flag
4615 on a message is larger than the maximum accepted QoS of a subscriber, the
4616 message's QoS will be downgraded.
4617
4618 =item B<Prefix> I<Prefix> (Publish only)
4619
4620 This plugin will use one topic per I<value list> which will looks like a path.
4621 I<Prefix> is used as the first path element and defaults to B<collectd>.
4622
4623 An example topic name would be:
4624
4625  collectd/cpu-0/cpu-user
4626
4627 =item B<Retain> B<false>|B<true> (Publish only)
4628
4629 Controls whether the MQTT broker will retain (keep a copy of) the last message
4630 sent to each topic and deliver it to new subscribers. Defaults to B<false>.
4631
4632 =item B<StoreRates> B<true>|B<false> (Publish only)
4633
4634 Controls whether C<DERIVE> and C<COUNTER> metrics are converted to a I<rate>
4635 before sending. Defaults to B<true>.
4636
4637 =item B<CleanSession> B<true>|B<false> (Subscribe only)
4638
4639 Controls whether the MQTT "cleans" the session up after the subscriber
4640 disconnects or if it maintains the subscriber's subscriptions and all messages
4641 that arrive while the subscriber is disconnected. Defaults to B<true>.
4642
4643 =item B<Topic> I<TopicName> (Subscribe only)
4644
4645 Configures the topic(s) to subscribe to. You can use the single level C<+> and
4646 multi level C<#> wildcards. Defaults to B<collectd/#>, i.e. all topics beneath
4647 the B<collectd> branch.
4648
4649 =item B<CACert> I<file>
4650
4651 Path to the PEM-encoded CA certificate file. Setting this option enables TLS
4652 communication with the MQTT broker, and as such, B<Port> should be the TLS-enabled
4653 port of the MQTT broker.
4654 This option enables the use of TLS.
4655
4656 =item B<CertificateFile> I<file>
4657
4658 Path to the PEM-encoded certificate file to use as client certificate when
4659 connecting to the MQTT broker.
4660 Only valid if B<CACert> and B<CertificateKeyFile> are also set.
4661
4662 =item B<CertificateKeyFile> I<file>
4663
4664 Path to the unencrypted PEM-encoded key file corresponding to B<CertificateFile>.
4665 Only valid if B<CACert> and B<CertificateFile> are also set.
4666
4667 =item B<TLSProtocol> I<protocol>
4668
4669 If configured, this specifies the string protocol version (e.g. C<tlsv1>,
4670 C<tlsv1.2>) to use for the TLS connection to the broker. If not set a default
4671 version is used which depends on the version of OpenSSL the Mosquitto library
4672 was linked against.
4673 Only valid if B<CACert> is set.
4674
4675 =item B<CipherSuite> I<ciphersuite>
4676
4677 A string describing the ciphers available for use. See L<ciphers(1)> and the
4678 C<openssl ciphers> utility for more information. If unset, the default ciphers
4679 will be used.
4680 Only valid if B<CACert> is set.
4681
4682 =back
4683
4684 =head2 Plugin C<mysql>
4685
4686 The C<mysql plugin> requires B<mysqlclient> to be installed. It connects to
4687 one or more databases when started and keeps the connection up as long as
4688 possible. When the connection is interrupted for whatever reason it will try
4689 to re-connect. The plugin will complain loudly in case anything goes wrong.
4690
4691 This plugin issues the MySQL C<SHOW STATUS> / C<SHOW GLOBAL STATUS> command
4692 and collects information about MySQL network traffic, executed statements,
4693 requests, the query cache and threads by evaluating the
4694 C<Bytes_{received,sent}>, C<Com_*>, C<Handler_*>, C<Qcache_*> and C<Threads_*>
4695 return values. Please refer to the B<MySQL reference manual>, I<5.1.6. Server
4696 Status Variables> for an explanation of these values.
4697
4698 Optionally, master and slave statistics may be collected in a MySQL
4699 replication setup. In that case, information about the synchronization state
4700 of the nodes are collected by evaluating the C<Position> return value of the
4701 C<SHOW MASTER STATUS> command and the C<Seconds_Behind_Master>,
4702 C<Read_Master_Log_Pos> and C<Exec_Master_Log_Pos> return values of the
4703 C<SHOW SLAVE STATUS> command. See the B<MySQL reference manual>,
4704 I<12.5.5.21 SHOW MASTER STATUS Syntax> and
4705 I<12.5.5.31 SHOW SLAVE STATUS Syntax> for details.
4706
4707 Synopsis:
4708
4709   <Plugin mysql>
4710     <Database foo>
4711       Host "hostname"
4712       User "username"
4713       Password "password"
4714       Port "3306"
4715       MasterStats true
4716       ConnectTimeout 10
4717       SSLKey "/path/to/key.pem"
4718       SSLCert "/path/to/cert.pem"
4719       SSLCA "/path/to/ca.pem"
4720       SSLCAPath "/path/to/cas/"
4721       SSLCipher "DHE-RSA-AES256-SHA"
4722     </Database>
4723
4724     <Database bar>
4725       Alias "squeeze"
4726       Host "localhost"
4727       Socket "/var/run/mysql/mysqld.sock"
4728       SlaveStats true
4729       SlaveNotifications true
4730     </Database>
4731
4732    <Database galera>
4733       Alias "galera"
4734       Host "localhost"
4735       Socket "/var/run/mysql/mysqld.sock"
4736       WsrepStats true
4737    </Database>
4738   </Plugin>
4739
4740 A B<Database> block defines one connection to a MySQL database. It accepts a
4741 single argument which specifies the name of the database. None of the other
4742 options are required. MySQL will use default values as documented in the
4743 "mysql_real_connect()" and "mysql_ssl_set()" sections in the
4744 B<MySQL reference manual>.
4745
4746 =over 4
4747
4748 =item B<Alias> I<Alias>
4749
4750 Alias to use as sender instead of hostname when reporting. This may be useful
4751 when having cryptic hostnames.
4752
4753 =item B<Host> I<Hostname>
4754
4755 Hostname of the database server. Defaults to B<localhost>.
4756
4757 =item B<User> I<Username>
4758
4759 Username to use when connecting to the database. The user does not have to be
4760 granted any privileges (which is synonym to granting the C<USAGE> privilege),
4761 unless you want to collectd replication statistics (see B<MasterStats> and
4762 B<SlaveStats> below). In this case, the user needs the C<REPLICATION CLIENT>
4763 (or C<SUPER>) privileges. Else, any existing MySQL user will do.
4764
4765 =item B<Password> I<Password>
4766
4767 Password needed to log into the database.
4768
4769 =item B<Database> I<Database>
4770
4771 Select this database. Defaults to I<no database> which is a perfectly reasonable
4772 option for what this plugin does.
4773
4774 =item B<Port> I<Port>
4775
4776 TCP-port to connect to. The port must be specified in its numeric form, but it
4777 must be passed as a string nonetheless. For example:
4778
4779   Port "3306"
4780
4781 If B<Host> is set to B<localhost> (the default), this setting has no effect.
4782 See the documentation for the C<mysql_real_connect> function for details.
4783
4784 =item B<Socket> I<Socket>
4785
4786 Specifies the path to the UNIX domain socket of the MySQL server. This option
4787 only has any effect, if B<Host> is set to B<localhost> (the default).
4788 Otherwise, use the B<Port> option above. See the documentation for the
4789 C<mysql_real_connect> function for details.
4790
4791 =item B<InnodbStats> I<true|false>
4792
4793 If enabled, metrics about the InnoDB storage engine are collected.
4794 Disabled by default.
4795
4796 =item B<MasterStats> I<true|false>
4797
4798 =item B<SlaveStats> I<true|false>
4799
4800 Enable the collection of master / slave statistics in a replication setup. In
4801 order to be able to get access to these statistics, the user needs special
4802 privileges. See the B<User> documentation above. Defaults to B<false>.
4803
4804 =item B<SlaveNotifications> I<true|false>
4805
4806 If enabled, the plugin sends a notification if the replication slave I/O and /
4807 or SQL threads are not running. Defaults to B<false>.
4808
4809 =item B<WsrepStats> I<true|false>
4810
4811  Enable the collection of wsrep plugin statistics, used in Master-Master
4812  replication setups like in MySQL Galera/Percona XtraDB Cluster.
4813  User needs only privileges to execute 'SHOW GLOBAL STATUS'
4814
4815 =item B<ConnectTimeout> I<Seconds>
4816
4817 Sets the connect timeout for the MySQL client.
4818
4819 =item B<SSLKey> I<Path>
4820
4821 If provided, the X509 key in PEM format.
4822
4823 =item B<SSLCert> I<Path>
4824
4825 If provided, the X509 cert in PEM format.
4826
4827 =item B<SSLCA> I<Path>
4828
4829 If provided, the CA file in PEM format (check OpenSSL docs).
4830
4831 =item B<SSLCAPath> I<Path>
4832
4833 If provided, the CA directory (check OpenSSL docs).
4834
4835 =item B<SSLCipher> I<String>
4836
4837 If provided, the SSL cipher to use.
4838
4839 =back
4840
4841 =head2 Plugin C<netapp>
4842
4843 The netapp plugin can collect various performance and capacity information
4844 from a NetApp filer using the NetApp API.
4845
4846 Please note that NetApp has a wide line of products and a lot of different
4847 software versions for each of these products. This plugin was developed for a
4848 NetApp FAS3040 running OnTap 7.2.3P8 and tested on FAS2050 7.3.1.1L1,
4849 FAS3140 7.2.5.1 and FAS3020 7.2.4P9. It I<should> work for most combinations of
4850 model and software version but it is very hard to test this.
4851 If you have used this plugin with other models and/or software version, feel
4852 free to send us a mail to tell us about the results, even if it's just a short
4853 "It works".
4854
4855 To collect these data collectd will log in to the NetApp via HTTP(S) and HTTP
4856 basic authentication.
4857
4858 B<Do not use a regular user for this!> Create a special collectd user with just
4859 the minimum of capabilities needed. The user only needs the "login-http-admin"
4860 capability as well as a few more depending on which data will be collected.
4861 Required capabilities are documented below.
4862
4863 =head3 Synopsis
4864
4865  <Plugin "netapp">
4866    <Host "netapp1.example.com">
4867     Protocol      "https"
4868     Address       "10.0.0.1"
4869     Port          443
4870     User          "username"
4871     Password      "aef4Aebe"
4872     Interval      30
4873
4874     <WAFL>
4875       Interval 30
4876       GetNameCache   true
4877       GetDirCache    true
4878       GetBufferCache true
4879       GetInodeCache  true
4880     </WAFL>
4881
4882     <Disks>
4883       Interval 30
4884       GetBusy true
4885     </Disks>
4886
4887     <VolumePerf>
4888       Interval 30
4889       GetIO      "volume0"
4890       IgnoreSelectedIO      false
4891       GetOps     "volume0"
4892       IgnoreSelectedOps     false
4893       GetLatency "volume0"
4894       IgnoreSelectedLatency false
4895     </VolumePerf>
4896
4897     <VolumeUsage>
4898       Interval 30
4899       GetCapacity "vol0"
4900       GetCapacity "vol1"
4901       IgnoreSelectedCapacity false
4902       GetSnapshot "vol1"
4903       GetSnapshot "vol3"
4904       IgnoreSelectedSnapshot false
4905     </VolumeUsage>
4906
4907     <Quota>
4908       Interval 60
4909     </Quota>
4910
4911     <Snapvault>
4912       Interval 30
4913     </Snapvault>
4914
4915     <System>
4916       Interval 30
4917       GetCPULoad     true
4918       GetInterfaces  true
4919       GetDiskOps     true
4920       GetDiskIO      true
4921     </System>
4922
4923     <VFiler vfilerA>
4924       Interval 60
4925
4926       SnapVault true
4927       # ...
4928     </VFiler>
4929    </Host>
4930  </Plugin>
4931
4932 The netapp plugin accepts the following configuration options:
4933
4934 =over 4
4935
4936 =item B<Host> I<Name>
4937
4938 A host block defines one NetApp filer. It will appear in collectd with the name
4939 you specify here which does not have to be its real name nor its hostname (see
4940 the B<Address> option below).
4941
4942 =item B<VFiler> I<Name>
4943
4944 A B<VFiler> block may only be used inside a host block. It accepts all the
4945 same options as the B<Host> block (except for cascaded B<VFiler> blocks) and
4946 will execute all NetApp API commands in the context of the specified
4947 VFiler(R). It will appear in collectd with the name you specify here which
4948 does not have to be its real name. The VFiler name may be specified using the
4949 B<VFilerName> option. If this is not specified, it will default to the name
4950 you specify here.
4951
4952 The VFiler block inherits all connection related settings from the surrounding
4953 B<Host> block (which appear before the B<VFiler> block) but they may be
4954 overwritten inside the B<VFiler> block.
4955
4956 This feature is useful, for example, when using a VFiler as SnapVault target
4957 (supported since OnTap 8.1). In that case, the SnapVault statistics are not
4958 available in the host filer (vfiler0) but only in the respective VFiler
4959 context.
4960
4961 =item B<Protocol> B<httpd>|B<http>
4962
4963 The protocol collectd will use to query this host.
4964
4965 Optional
4966
4967 Type: string
4968
4969 Default: https
4970
4971 Valid options: http, https
4972
4973 =item B<Address> I<Address>
4974
4975 The hostname or IP address of the host.
4976
4977 Optional
4978
4979 Type: string
4980
4981 Default: The "host" block's name.
4982
4983 =item B<Port> I<Port>
4984
4985 The TCP port to connect to on the host.
4986
4987 Optional
4988
4989 Type: integer
4990
4991 Default: 80 for protocol "http", 443 for protocol "https"
4992
4993 =item B<User> I<User>
4994
4995 =item B<Password> I<Password>
4996
4997 The username and password to use to login to the NetApp.
4998
4999 Mandatory
5000
5001 Type: string
5002
5003 =item B<VFilerName> I<Name>
5004
5005 The name of the VFiler in which context to execute API commands. If not
5006 specified, the name provided to the B<VFiler> block will be used instead.
5007
5008 Optional
5009
5010 Type: string
5011
5012 Default: name of the B<VFiler> block
5013
5014 B<Note:> This option may only be used inside B<VFiler> blocks.
5015
5016 =item B<Interval> I<Interval>
5017
5018 B<TODO>
5019
5020 =back
5021
5022 The following options decide what kind of data will be collected. You can
5023 either use them as a block and fine tune various parameters inside this block,
5024 use them as a single statement to just accept all default values, or omit it to
5025 not collect any data.
5026
5027 The following options are valid inside all blocks:
5028
5029 =over 4
5030
5031 =item B<Interval> I<Seconds>
5032
5033 Collect the respective statistics every I<Seconds> seconds. Defaults to the
5034 host specific setting.
5035
5036 =back
5037
5038 =head3 The System block
5039
5040 This will collect various performance data about the whole system.
5041
5042 B<Note:> To get this data the collectd user needs the
5043 "api-perf-object-get-instances" capability.
5044
5045 =over 4
5046
5047 =item B<Interval> I<Seconds>
5048
5049 Collect disk statistics every I<Seconds> seconds.
5050
5051 =item B<GetCPULoad> B<true>|B<false>
5052
5053 If you set this option to true the current CPU usage will be read. This will be
5054 the average usage between all CPUs in your NetApp without any information about
5055 individual CPUs.
5056
5057 B<Note:> These are the same values that the NetApp CLI command "sysstat"
5058 returns in the "CPU" field.
5059
5060 Optional
5061
5062 Type: boolean
5063
5064 Default: true
5065
5066 Result: Two value lists of type "cpu", and type instances "idle" and "system".
5067
5068 =item B<GetInterfaces> B<true>|B<false>
5069
5070 If you set this option to true the current traffic of the network interfaces
5071 will be read. This will be the total traffic over all interfaces of your NetApp
5072 without any information about individual interfaces.
5073
5074 B<Note:> This is the same values that the NetApp CLI command "sysstat" returns
5075 in the "Net kB/s" field.
5076
5077 B<Or is it?>
5078
5079 Optional
5080
5081 Type: boolean
5082
5083 Default: true
5084
5085 Result: One value list of type "if_octects".
5086
5087 =item B<GetDiskIO> B<true>|B<false>
5088
5089 If you set this option to true the current IO throughput will be read. This
5090 will be the total IO of your NetApp without any information about individual
5091 disks, volumes or aggregates.
5092
5093 B<Note:> This is the same values that the NetApp CLI command "sysstat" returns
5094 in the "DiskE<nbsp>kB/s" field.
5095
5096 Optional
5097
5098 Type: boolean
5099
5100 Default: true
5101
5102 Result: One value list of type "disk_octets".
5103
5104 =item B<GetDiskOps> B<true>|B<false>
5105
5106 If you set this option to true the current number of HTTP, NFS, CIFS, FCP,
5107 iSCSI, etc. operations will be read. This will be the total number of
5108 operations on your NetApp without any information about individual volumes or
5109 aggregates.
5110
5111 B<Note:> These are the same values that the NetApp CLI command "sysstat"
5112 returns in the "NFS", "CIFS", "HTTP", "FCP" and "iSCSI" fields.
5113
5114 Optional
5115
5116 Type: boolean
5117
5118 Default: true
5119
5120 Result: A variable number of value lists of type "disk_ops_complex". Each type
5121 of operation will result in one value list with the name of the operation as
5122 type instance.
5123
5124 =back
5125
5126 =head3 The WAFL block
5127
5128 This will collect various performance data about the WAFL file system. At the
5129 moment this just means cache performance.
5130
5131 B<Note:> To get this data the collectd user needs the
5132 "api-perf-object-get-instances" capability.
5133
5134 B<Note:> The interface to get these values is classified as "Diagnostics" by
5135 NetApp. This means that it is not guaranteed to be stable even between minor
5136 releases.
5137
5138 =over 4
5139
5140 =item B<Interval> I<Seconds>
5141
5142 Collect disk statistics every I<Seconds> seconds.
5143
5144 =item B<GetNameCache> B<true>|B<false>
5145
5146 Optional
5147
5148 Type: boolean
5149
5150 Default: true
5151
5152 Result: One value list of type "cache_ratio" and type instance
5153 "name_cache_hit".
5154
5155 =item B<GetDirCache> B<true>|B<false>
5156
5157 Optional
5158
5159 Type: boolean
5160
5161 Default: true
5162
5163 Result: One value list of type "cache_ratio" and type instance "find_dir_hit".
5164
5165 =item B<GetInodeCache> B<true>|B<false>
5166
5167 Optional
5168
5169 Type: boolean
5170
5171 Default: true
5172
5173 Result: One value list of type "cache_ratio" and type instance
5174 "inode_cache_hit".
5175
5176 =item B<GetBufferCache> B<true>|B<false>
5177
5178 B<Note:> This is the same value that the NetApp CLI command "sysstat" returns
5179 in the "Cache hit" field.
5180
5181 Optional
5182
5183 Type: boolean
5184
5185 Default: true
5186
5187 Result: One value list of type "cache_ratio" and type instance "buf_hash_hit".
5188
5189 =back
5190
5191 =head3 The Disks block
5192
5193 This will collect performance data about the individual disks in the NetApp.
5194
5195 B<Note:> To get this data the collectd user needs the
5196 "api-perf-object-get-instances" capability.
5197
5198 =over 4
5199
5200 =item B<Interval> I<Seconds>
5201
5202 Collect disk statistics every I<Seconds> seconds.
5203
5204 =item B<GetBusy> B<true>|B<false>
5205
5206 If you set this option to true the busy time of all disks will be calculated
5207 and the value of the busiest disk in the system will be written.
5208
5209 B<Note:> This is the same values that the NetApp CLI command "sysstat" returns
5210 in the "Disk util" field. Probably.
5211
5212 Optional
5213
5214 Type: boolean
5215
5216 Default: true
5217
5218 Result: One value list of type "percent" and type instance "disk_busy".
5219
5220 =back
5221
5222 =head3 The VolumePerf block
5223
5224 This will collect various performance data about the individual volumes.
5225
5226 You can select which data to collect about which volume using the following
5227 options. They follow the standard ignorelist semantic.
5228
5229 B<Note:> To get this data the collectd user needs the
5230 I<api-perf-object-get-instances> capability.
5231
5232 =over 4
5233
5234 =item B<Interval> I<Seconds>
5235
5236 Collect volume performance data every I<Seconds> seconds.
5237
5238 =item B<GetIO> I<Volume>
5239
5240 =item B<GetOps> I<Volume>
5241
5242 =item B<GetLatency> I<Volume>
5243
5244 Select the given volume for IO, operations or latency statistics collection.
5245 The argument is the name of the volume without the C</vol/> prefix.
5246
5247 Since the standard ignorelist functionality is used here, you can use a string
5248 starting and ending with a slash to specify regular expression matching: To
5249 match the volumes "vol0", "vol2" and "vol7", you can use this regular
5250 expression:
5251
5252   GetIO "/^vol[027]$/"
5253
5254 If no regular expression is specified, an exact match is required. Both,
5255 regular and exact matching are case sensitive.
5256
5257 If no volume was specified at all for either of the three options, that data
5258 will be collected for all available volumes.
5259
5260 See F</"IGNORELISTS"> for details.
5261
5262 =item B<IgnoreSelectedIO> B<true>|B<false>
5263
5264 =item B<IgnoreSelectedOps> B<true>|B<false>
5265
5266 =item B<IgnoreSelectedLatency> B<true>|B<false>
5267
5268 When set to B<true>, the volumes selected for IO, operations or latency
5269 statistics collection will be ignored and the data will be collected for all
5270 other volumes.
5271
5272 When set to B<false>, data will only be collected for the specified volumes and
5273 all other volumes will be ignored.
5274
5275 If no volumes have been specified with the above B<Get*> options, all volumes
5276 will be collected regardless of the B<IgnoreSelected*> option.
5277
5278 Defaults to B<false>
5279
5280 =back
5281
5282 =head3 The VolumeUsage block
5283
5284 This will collect capacity data about the individual volumes.
5285
5286 B<Note:> To get this data the collectd user needs the I<api-volume-list-info>
5287 capability.
5288
5289 =over 4
5290
5291 =item B<Interval> I<Seconds>
5292
5293 Collect volume usage statistics every I<Seconds> seconds.
5294
5295 =item B<GetCapacity> I<VolumeName>
5296
5297 The current capacity of the volume will be collected. This will result in two
5298 to four value lists, depending on the configuration of the volume. All data
5299 sources are of type "df_complex" with the name of the volume as
5300 plugin_instance.
5301
5302 There will be type_instances "used" and "free" for the number of used and
5303 available bytes on the volume.  If the volume has some space reserved for
5304 snapshots, a type_instance "snap_reserved" will be available.  If the volume
5305 has SIS enabled, a type_instance "sis_saved" will be available. This is the
5306 number of bytes saved by the SIS feature.
5307
5308 B<Note:> The current NetApp API has a bug that results in this value being
5309 reported as a 32E<nbsp>bit number. This plugin tries to guess the correct
5310 number which works most of the time.  If you see strange values here, bug
5311 NetApp support to fix this.
5312
5313 Repeat this option to specify multiple volumes.
5314
5315 =item B<IgnoreSelectedCapacity> B<true>|B<false>
5316
5317 Specify whether to collect only the volumes selected by the B<GetCapacity>
5318 option or to ignore those volumes. B<IgnoreSelectedCapacity> defaults to
5319 B<false>. However, if no B<GetCapacity> option is specified at all, all
5320 capacities will be selected anyway.
5321
5322 =item B<GetSnapshot> I<VolumeName>
5323
5324 Select volumes from which to collect snapshot information.
5325
5326 Usually, the space used for snapshots is included in the space reported as
5327 "used". If snapshot information is collected as well, the space used for
5328 snapshots is subtracted from the used space.
5329
5330 To make things even more interesting, it is possible to reserve space to be
5331 used for snapshots. If the space required for snapshots is less than that
5332 reserved space, there is "reserved free" and "reserved used" space in addition
5333 to "free" and "used". If the space required for snapshots exceeds the reserved
5334 space, that part allocated in the normal space is subtracted from the "used"
5335 space again.
5336
5337 Repeat this option to specify multiple volumes.
5338
5339 =item B<IgnoreSelectedSnapshot>
5340
5341 Specify whether to collect only the volumes selected by the B<GetSnapshot>
5342 option or to ignore those volumes. B<IgnoreSelectedSnapshot> defaults to
5343 B<false>. However, if no B<GetSnapshot> option is specified at all, all
5344 capacities will be selected anyway.
5345
5346 =back
5347
5348 =head3 The Quota block
5349
5350 This will collect (tree) quota statistics (used disk space and number of used
5351 files). This mechanism is useful to get usage information for single qtrees.
5352 In case the quotas are not used for any other purpose, an entry similar to the
5353 following in C</etc/quotas> would be sufficient:
5354
5355   /vol/volA/some_qtree tree - - - - -
5356
5357 After adding the entry, issue C<quota on -w volA> on the NetApp filer.
5358
5359 =over 4
5360
5361 =item B<Interval> I<Seconds>
5362
5363 Collect SnapVault(R) statistics every I<Seconds> seconds.
5364
5365 =back
5366
5367 =head3 The SnapVault block
5368
5369 This will collect statistics about the time and traffic of SnapVault(R)
5370 transfers.
5371
5372 =over 4
5373
5374 =item B<Interval> I<Seconds>
5375
5376 Collect SnapVault(R) statistics every I<Seconds> seconds.
5377
5378 =back
5379
5380 =head2 Plugin C<netlink>
5381
5382 The C<netlink> plugin uses a netlink socket to query the Linux kernel about
5383 statistics of various interface and routing aspects.
5384
5385 =over 4
5386
5387 =item B<Interface> I<Interface>
5388
5389 =item B<VerboseInterface> I<Interface>
5390
5391 Instruct the plugin to collect interface statistics. This is basically the same
5392 as the statistics provided by the C<interface> plugin (see above) but
5393 potentially much more detailed.
5394
5395 When configuring with B<Interface> only the basic statistics will be collected,
5396 namely octets, packets, and errors. These statistics are collected by
5397 the C<interface> plugin, too, so using both at the same time is no benefit.
5398
5399 When configured with B<VerboseInterface> all counters B<except> the basic ones
5400 will be collected, so that no data needs to be collected twice if you use the
5401 C<interface> plugin.
5402 This includes dropped packets, received multicast packets, collisions and a
5403 whole zoo of differentiated RX and TX errors. You can try the following command
5404 to get an idea of what awaits you:
5405
5406   ip -s -s link list
5407
5408 If I<Interface> is B<All>, all interfaces will be selected.
5409
5410 =item B<QDisc> I<Interface> [I<QDisc>]
5411
5412 =item B<Class> I<Interface> [I<Class>]
5413
5414 =item B<Filter> I<Interface> [I<Filter>]
5415
5416 Collect the octets and packets that pass a certain qdisc, class or filter.
5417
5418 QDiscs and classes are identified by their type and handle (or classid).
5419 Filters don't necessarily have a handle, therefore the parent's handle is used.
5420 The notation used in collectd differs from that used in tc(1) in that it
5421 doesn't skip the major or minor number if it's zero and doesn't print special
5422 ids by their name. So, for example, a qdisc may be identified by
5423 C<pfifo_fast-1:0> even though the minor number of B<all> qdiscs is zero and
5424 thus not displayed by tc(1).
5425
5426 If B<QDisc>, B<Class>, or B<Filter> is given without the second argument,
5427 i.E<nbsp>.e. without an identifier, all qdiscs, classes, or filters that are
5428 associated with that interface will be collected.
5429
5430 Since a filter itself doesn't necessarily have a handle, the parent's handle is
5431 used. This may lead to problems when more than one filter is attached to a
5432 qdisc or class. This isn't nice, but we don't know how this could be done any
5433 better. If you have a idea, please don't hesitate to tell us.
5434
5435 As with the B<Interface> option you can specify B<All> as the interface,
5436 meaning all interfaces.
5437
5438 Here are some examples to help you understand the above text more easily:
5439
5440   <Plugin netlink>
5441     VerboseInterface "All"
5442     QDisc "eth0" "pfifo_fast-1:0"
5443     QDisc "ppp0"
5444     Class "ppp0" "htb-1:10"
5445     Filter "ppp0" "u32-1:0"
5446   </Plugin>
5447
5448 See F</"IGNORELISTS"> for details.
5449
5450 =item B<IgnoreSelected>
5451
5452 The behavior is the same as with all other similar plugins: If nothing is
5453 selected at all, everything is collected. If some things are selected using the
5454 options described above, only these statistics are collected. If you set
5455 B<IgnoreSelected> to B<true>, this behavior is inverted, i.E<nbsp>e. the
5456 specified statistics will not be collected.
5457
5458 =back
5459
5460 =head2 Plugin C<network>
5461
5462 The Network plugin sends data to a remote instance of collectd, receives data
5463 from a remote instance, or both at the same time. Data which has been received
5464 from the network is usually not transmitted again, but this can be activated, see
5465 the B<Forward> option below.
5466
5467 The default IPv6 multicast group is C<ff18::efc0:4a42>. The default IPv4
5468 multicast group is C<239.192.74.66>. The default I<UDP> port is B<25826>.
5469
5470 Both, B<Server> and B<Listen> can be used as single option or as block. When
5471 used as block, given options are valid for this socket only. The following
5472 example will export the metrics twice: Once to an "internal" server (without
5473 encryption and signing) and one to an external server (with cryptographic
5474 signature):
5475
5476  <Plugin "network">
5477    # Export to an internal server
5478    # (demonstrates usage without additional options)
5479    Server "collectd.internal.tld"
5480
5481    # Export to an external server
5482    # (demonstrates usage with signature options)
5483    <Server "collectd.external.tld">
5484      SecurityLevel "sign"
5485      Username "myhostname"
5486      Password "ohl0eQue"
5487    </Server>
5488  </Plugin>
5489
5490 =over 4
5491
5492 =item B<E<lt>Server> I<Host> [I<Port>]B<E<gt>>
5493
5494 The B<Server> statement/block sets the server to send datagrams to. The
5495 statement may occur multiple times to send each datagram to multiple
5496 destinations.
5497
5498 The argument I<Host> may be a hostname, an IPv4 address or an IPv6 address. The
5499 optional second argument specifies a port number or a service name. If not
5500 given, the default, B<25826>, is used.
5501
5502 The following options are recognized within B<Server> blocks:
5503
5504 =over 4
5505
5506 =item B<SecurityLevel> B<Encrypt>|B<Sign>|B<None>
5507
5508 Set the security you require for network communication. When the security level
5509 has been set to B<Encrypt>, data sent over the network will be encrypted using
5510 I<AES-256>. The integrity of encrypted packets is ensured using I<SHA-1>. When
5511 set to B<Sign>, transmitted data is signed using the I<HMAC-SHA-256> message
5512 authentication code. When set to B<None>, data is sent without any security.
5513
5514 This feature is only available if the I<network> plugin was linked with
5515 I<libgcrypt>.
5516
5517 =item B<Username> I<Username>
5518
5519 Sets the username to transmit. This is used by the server to lookup the
5520 password. See B<AuthFile> below. All security levels except B<None> require
5521 this setting.
5522
5523 This feature is only available if the I<network> plugin was linked with
5524 I<libgcrypt>.
5525
5526 =item B<Password> I<Password>
5527
5528 Sets a password (shared secret) for this socket. All security levels except
5529 B<None> require this setting.
5530
5531 This feature is only available if the I<network> plugin was linked with
5532 I<libgcrypt>.
5533
5534 =item B<Interface> I<Interface name>
5535
5536 Set the outgoing interface for IP packets. This applies at least
5537 to IPv6 packets and if possible to IPv4. If this option is not applicable,
5538 undefined or a non-existent interface name is specified, the default
5539 behavior is to let the kernel choose the appropriate interface. Be warned
5540 that the manual selection of an interface for unicast traffic is only
5541 necessary in rare cases.
5542
5543 =item B<BindAddress> I<IP Address>
5544
5545 Set the outgoing IP address for IP packets. This option can be used instead of
5546 the I<Interface> option to explicitly define the IP address which will be used
5547 to send Packets to the remote server. 
5548
5549 =item B<ResolveInterval> I<Seconds>
5550
5551 Sets the interval at which to re-resolve the DNS for the I<Host>. This is
5552 useful to force a regular DNS lookup to support a high availability setup. If
5553 not specified, re-resolves are never attempted.
5554
5555 =back
5556
5557 =item B<E<lt>Listen> I<Host> [I<Port>]B<E<gt>>
5558
5559 The B<Listen> statement sets the interfaces to bind to. When multiple
5560 statements are found the daemon will bind to multiple interfaces.
5561
5562 The argument I<Host> may be a hostname, an IPv4 address or an IPv6 address. If
5563 the argument is a multicast address the daemon will join that multicast group.
5564 The optional second argument specifies a port number or a service name. If not
5565 given, the default, B<25826>, is used.
5566
5567 The following options are recognized within C<E<lt>ListenE<gt>> blocks:
5568
5569 =over 4
5570
5571 =item B<SecurityLevel> B<Encrypt>|B<Sign>|B<None>
5572
5573 Set the security you require for network communication. When the security level
5574 has been set to B<Encrypt>, only encrypted data will be accepted. The integrity
5575 of encrypted packets is ensured using I<SHA-1>. When set to B<Sign>, only
5576 signed and encrypted data is accepted. When set to B<None>, all data will be
5577 accepted. If an B<AuthFile> option was given (see below), encrypted data is
5578 decrypted if possible.
5579
5580 This feature is only available if the I<network> plugin was linked with
5581 I<libgcrypt>.
5582
5583 =item B<AuthFile> I<Filename>
5584
5585 Sets a file in which usernames are mapped to passwords. These passwords are
5586 used to verify signatures and to decrypt encrypted network packets. If
5587 B<SecurityLevel> is set to B<None>, this is optional. If given, signed data is
5588 verified and encrypted packets are decrypted. Otherwise, signed data is
5589 accepted without checking the signature and encrypted data cannot be decrypted.
5590 For the other security levels this option is mandatory.
5591
5592 The file format is very simple: Each line consists of a username followed by a
5593 colon and any number of spaces followed by the password. To demonstrate, an
5594 example file could look like this:
5595
5596   user0: foo
5597   user1: bar
5598
5599 Each time a packet is received, the modification time of the file is checked
5600 using L<stat(2)>. If the file has been changed, the contents is re-read. While
5601 the file is being read, it is locked using L<fcntl(2)>.
5602
5603 =item B<Interface> I<Interface name>
5604
5605 Set the incoming interface for IP packets explicitly. This applies at least
5606 to IPv6 packets and if possible to IPv4. If this option is not applicable,
5607 undefined or a non-existent interface name is specified, the default
5608 behavior is, to let the kernel choose the appropriate interface. Thus incoming
5609 traffic gets only accepted, if it arrives on the given interface.
5610
5611 =back
5612
5613 =item B<TimeToLive> I<1-255>
5614
5615 Set the time-to-live of sent packets. This applies to all, unicast and
5616 multicast, and IPv4 and IPv6 packets. The default is to not change this value.
5617 That means that multicast packets will be sent with a TTL of C<1> (one) on most
5618 operating systems.
5619
5620 =item B<MaxPacketSize> I<1024-65535>
5621
5622 Set the maximum size for datagrams received over the network. Packets larger
5623 than this will be truncated. Defaults to 1452E<nbsp>bytes, which is the maximum
5624 payload size that can be transmitted in one Ethernet frame using IPv6E<nbsp>/
5625 UDP.
5626
5627 On the server side, this limit should be set to the largest value used on
5628 I<any> client. Likewise, the value on the client must not be larger than the
5629 value on the server, or data will be lost.
5630
5631 B<Compatibility:> Versions prior to I<versionE<nbsp>4.8> used a fixed sized
5632 buffer of 1024E<nbsp>bytes. Versions I<4.8>, I<4.9> and I<4.10> used a default
5633 value of 1024E<nbsp>bytes to avoid problems when sending data to an older
5634 server.
5635
5636 =item B<Forward> I<true|false>
5637
5638 If set to I<true>, write packets that were received via the network plugin to
5639 the sending sockets. This should only be activated when the B<Listen>- and
5640 B<Server>-statements differ. Otherwise packets may be send multiple times to
5641 the same multicast group. While this results in more network traffic than
5642 necessary it's not a huge problem since the plugin has a duplicate detection,
5643 so the values will not loop.
5644
5645 =item B<ReportStats> B<true>|B<false>
5646
5647 The network plugin cannot only receive and send statistics, it can also create
5648 statistics about itself. Collectd data included the number of received and
5649 sent octets and packets, the length of the receive queue and the number of
5650 values handled. When set to B<true>, the I<Network plugin> will make these
5651 statistics available. Defaults to B<false>.
5652
5653 =back
5654
5655 =head2 Plugin C<nfs>
5656
5657 The I<nfs plugin> collects information about the usage of the Network File
5658 System (NFS). It counts the number of procedure calls for each procedure,
5659 grouped by version and whether the system runs as server or client.
5660
5661 It is possibly to omit metrics for a specific NFS version by setting one or
5662 more of the following options to B<false> (all of them default to B<true>).
5663
5664 =over 4
5665
5666 =item B<ReportV2> B<true>|B<false>
5667
5668 =item B<ReportV3> B<true>|B<false>
5669
5670 =item B<ReportV4> B<true>|B<false>
5671
5672 =back
5673
5674 =head2 Plugin C<nginx>
5675
5676 This plugin collects the number of connections and requests handled by the
5677 C<nginx daemon> (speak: engineE<nbsp>X), a HTTP and mail server/proxy. It
5678 queries the page provided by the C<ngx_http_stub_status_module> module, which
5679 isn't compiled by default. Please refer to
5680 L<http://wiki.codemongers.com/NginxStubStatusModule> for more information on
5681 how to compile and configure nginx and this module.
5682
5683 The following options are accepted by the C<nginx plugin>:
5684
5685 =over 4
5686
5687 =item B<URL> I<http://host/nginx_status>
5688
5689 Sets the URL of the C<ngx_http_stub_status_module> output.
5690
5691 =item B<User> I<Username>
5692
5693 Optional user name needed for authentication.
5694
5695 =item B<Password> I<Password>
5696
5697 Optional password needed for authentication.
5698
5699 =item B<VerifyPeer> B<true|false>
5700
5701 Enable or disable peer SSL certificate verification. See
5702 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
5703
5704 =item B<VerifyHost> B<true|false>
5705
5706 Enable or disable peer host name verification. If enabled, the plugin checks
5707 if the C<Common Name> or a C<Subject Alternate Name> field of the SSL
5708 certificate matches the host name provided by the B<URL> option. If this
5709 identity check fails, the connection is aborted. Obviously, only works when
5710 connecting to a SSL enabled server. Enabled by default.
5711
5712 =item B<CACert> I<File>
5713
5714 File that holds one or more SSL certificates. If you want to use HTTPS you will
5715 possibly need this option. What CA certificates come bundled with C<libcurl>
5716 and are checked by default depends on the distribution you use.
5717
5718 =item B<Timeout> I<Milliseconds>
5719
5720 The B<Timeout> option sets the overall timeout for HTTP requests to B<URL>, in
5721 milliseconds. By default, the configured B<Interval> is used to set the
5722 timeout.
5723
5724 =back
5725
5726 =head2 Plugin C<notify_desktop>
5727
5728 This plugin sends a desktop notification to a notification daemon, as defined
5729 in the Desktop Notification Specification. To actually display the
5730 notifications, B<notification-daemon> is required and B<collectd> has to be
5731 able to access the X server (i.E<nbsp>e., the C<DISPLAY> and C<XAUTHORITY>
5732 environment variables have to be set correctly) and the D-Bus message bus.
5733
5734 The Desktop Notification Specification can be found at
5735 L<http://www.galago-project.org/specs/notification/>.
5736
5737 =over 4
5738
5739 =item B<OkayTimeout> I<timeout>
5740
5741 =item B<WarningTimeout> I<timeout>
5742
5743 =item B<FailureTimeout> I<timeout>
5744
5745 Set the I<timeout>, in milliseconds, after which to expire the notification
5746 for C<OKAY>, C<WARNING> and C<FAILURE> severities respectively. If zero has
5747 been specified, the displayed notification will not be closed at all - the
5748 user has to do so herself. These options default to 5000. If a negative number
5749 has been specified, the default is used as well.
5750
5751 =back
5752
5753 =head2 Plugin C<notify_email>
5754
5755 The I<notify_email> plugin uses the I<ESMTP> library to send notifications to a
5756 configured email address.
5757
5758 I<libESMTP> is available from L<http://www.stafford.uklinux.net/libesmtp/>.
5759
5760 Available configuration options:
5761
5762 =over 4
5763
5764 =item B<From> I<Address>
5765
5766 Email address from which the emails should appear to come from.
5767
5768 Default: C<root@localhost>
5769
5770 =item B<Recipient> I<Address>
5771
5772 Configures the email address(es) to which the notifications should be mailed.
5773 May be repeated to send notifications to multiple addresses.
5774
5775 At least one B<Recipient> must be present for the plugin to work correctly.
5776
5777 =item B<SMTPServer> I<Hostname>
5778
5779 Hostname of the SMTP server to connect to.
5780
5781 Default: C<localhost>
5782
5783 =item B<SMTPPort> I<Port>
5784
5785 TCP port to connect to.
5786
5787 Default: C<25>
5788
5789 =item B<SMTPUser> I<Username>
5790
5791 Username for ASMTP authentication. Optional.
5792
5793 =item B<SMTPPassword> I<Password>
5794
5795 Password for ASMTP authentication. Optional.
5796
5797 =item B<Subject> I<Subject>
5798
5799 Subject-template to use when sending emails. There must be exactly two
5800 string-placeholders in the subject, given in the standard I<printf(3)> syntax,
5801 i.E<nbsp>e. C<%s>. The first will be replaced with the severity, the second
5802 with the hostname.
5803
5804 Default: C<Collectd notify: %s@%s>
5805
5806 =back
5807
5808 =head2 Plugin C<notify_nagios>
5809
5810 The I<notify_nagios> plugin writes notifications to Nagios' I<command file> as
5811 a I<passive service check result>.
5812
5813 Available configuration options:
5814
5815 =over 4
5816
5817 =item B<CommandFile> I<Path>
5818
5819 Sets the I<command file> to write to. Defaults to F</usr/local/nagios/var/rw/nagios.cmd>.
5820
5821 =back
5822
5823 =head2 Plugin C<ntpd>
5824
5825 The C<ntpd> plugin collects per-peer ntp data such as time offset and time
5826 dispersion.
5827
5828 For talking to B<ntpd>, it mimics what the B<ntpdc> control program does on
5829 the wire - using B<mode 7> specific requests. This mode is deprecated with
5830 newer B<ntpd> releases (4.2.7p230 and later). For the C<ntpd> plugin to work
5831 correctly with them, the ntp daemon must be explicitly configured to
5832 enable B<mode 7> (which is disabled by default). Refer to the I<ntp.conf(5)>
5833 manual page for details.
5834
5835 Available configuration options for the C<ntpd> plugin:
5836
5837 =over 4
5838
5839 =item B<Host> I<Hostname>
5840
5841 Hostname of the host running B<ntpd>. Defaults to B<localhost>.
5842
5843 =item B<Port> I<Port>
5844
5845 UDP-Port to connect to. Defaults to B<123>.
5846
5847 =item B<ReverseLookups> B<true>|B<false>
5848
5849 Sets whether or not to perform reverse lookups on peers. Since the name or
5850 IP-address may be used in a filename it is recommended to disable reverse
5851 lookups. The default is to do reverse lookups to preserve backwards
5852 compatibility, though.
5853
5854 =item B<IncludeUnitID> B<true>|B<false>
5855
5856 When a peer is a refclock, include the unit ID in the I<type instance>.
5857 Defaults to B<false> for backward compatibility.
5858
5859 If two refclock peers use the same driver and this is B<false>, the plugin will
5860 try to write simultaneous measurements from both to the same type instance.
5861 This will result in error messages in the log and only one set of measurements
5862 making it through.
5863
5864 =back
5865
5866 =head2 Plugin C<nut>
5867
5868 =over 4
5869
5870 =item B<UPS> I<upsname>B<@>I<hostname>[B<:>I<port>]
5871
5872 Add a UPS to collect data from. The format is identical to the one accepted by
5873 L<upsc(8)>.
5874
5875 =item B<ForceSSL> B<true>|B<false>
5876
5877 Stops connections from falling back to unsecured if an SSL connection
5878 cannot be established. Defaults to false if undeclared.
5879
5880 =item B<VerifyPeer> I<true>|I<false>
5881
5882 If set to true, requires a CAPath be provided. Will use the CAPath to find
5883 certificates to use as Trusted Certificates to validate a upsd server certificate.
5884 If validation of the upsd server certificate fails, the connection will not be
5885 established. If ForceSSL is undeclared or set to false, setting VerifyPeer to true
5886 will override and set ForceSSL to true.
5887
5888 =item B<CAPath> I/path/to/certs/folder
5889
5890 If VerifyPeer is set to true, this is required. Otherwise this is ignored.
5891 The folder pointed at must contain certificate(s) named according to their hash.
5892 Ex: XXXXXXXX.Y where X is the hash value of a cert and Y is 0. If name collisions
5893 occur because two different certs have the same hash value, Y can be  incremented
5894 in order to avoid conflict. To create a symbolic link to a certificate the following
5895 command can be used from within the directory where the cert resides:
5896
5897 C<ln -s some.crt ./$(openssl x509 -hash -noout -in some.crt).0>
5898
5899 Alternatively, the package openssl-perl provides a command C<c_rehash> that will
5900 generate links like the one described above for ALL certs in a given folder.
5901 Example usage:
5902 C<c_rehash /path/to/certs/folder>
5903
5904 =item B<ConnectTimeout> I<Milliseconds>
5905
5906 The B<ConnectTimeout> option sets the connect timeout, in milliseconds.
5907 By default, the configured B<Interval> is used to set the timeout.
5908
5909 =back
5910
5911 =head2 Plugin C<olsrd>
5912
5913 The I<olsrd> plugin connects to the TCP port opened by the I<txtinfo> plugin of
5914 the Optimized Link State Routing daemon and reads information about the current
5915 state of the meshed network.
5916
5917 The following configuration options are understood:
5918
5919 =over 4
5920
5921 =item B<Host> I<Host>
5922
5923 Connect to I<Host>. Defaults to B<"localhost">.
5924
5925 =item B<Port> I<Port>
5926
5927 Specifies the port to connect to. This must be a string, even if you give the
5928 port as a number rather than a service name. Defaults to B<"2006">.
5929
5930 =item B<CollectLinks> B<No>|B<Summary>|B<Detail>
5931
5932 Specifies what information to collect about links, i.E<nbsp>e. direct
5933 connections of the daemon queried. If set to B<No>, no information is
5934 collected. If set to B<Summary>, the number of links and the average of all
5935 I<link quality> (LQ) and I<neighbor link quality> (NLQ) values is calculated.
5936 If set to B<Detail> LQ and NLQ are collected per link.
5937
5938 Defaults to B<Detail>.
5939
5940 =item B<CollectRoutes> B<No>|B<Summary>|B<Detail>
5941
5942 Specifies what information to collect about routes of the daemon queried. If
5943 set to B<No>, no information is collected. If set to B<Summary>, the number of
5944 routes and the average I<metric> and I<ETX> is calculated. If set to B<Detail>
5945 metric and ETX are collected per route.
5946
5947 Defaults to B<Summary>.
5948
5949 =item B<CollectTopology> B<No>|B<Summary>|B<Detail>
5950
5951 Specifies what information to collect about the global topology. If set to
5952 B<No>, no information is collected. If set to B<Summary>, the number of links
5953 in the entire topology and the average I<link quality> (LQ) is calculated.
5954 If set to B<Detail> LQ and NLQ are collected for each link in the entire topology.
5955
5956 Defaults to B<Summary>.
5957
5958 =back
5959
5960 =head2 Plugin C<onewire>
5961
5962 B<EXPERIMENTAL!> See notes below.
5963
5964 The C<onewire> plugin uses the B<owcapi> library from the B<owfs> project
5965 L<http://owfs.org/> to read sensors connected via the onewire bus.
5966
5967 It can be used in two possible modes - standard or advanced.
5968
5969 In the standard mode only temperature sensors (sensors with the family code
5970 C<10>, C<22> and C<28> - e.g. DS1820, DS18S20, DS1920) can be read. If you have
5971 other sensors you would like to have included, please send a sort request to
5972 the mailing list. You can select sensors to be read or to be ignored depending
5973 on the option B<IgnoreSelected>). When no list is provided the whole bus is
5974 walked and all sensors are read.
5975
5976 Hubs (the DS2409 chips) are working, but read the note, why this plugin is
5977 experimental, below.
5978
5979 In the advanced mode you can configure any sensor to be read (only numerical
5980 value) using full OWFS path (e.g. "/uncached/10.F10FCA000800/temperature").
5981 In this mode you have to list all the sensors. Neither default bus walk nor
5982 B<IgnoreSelected> are used here. Address and type (file) is extracted from
5983 the path automatically and should produce compatible structure with the "standard"
5984 mode (basically the path is expected as for example
5985 "/uncached/10.F10FCA000800/temperature" where it would extract address part
5986 "F10FCA000800" and the rest after the slash is considered the type - here
5987 "temperature").
5988 There are two advantages to this mode - you can access virtually any sensor
5989 (not just temperature), select whether to use cached or directly read values
5990 and it is slighlty faster. The downside is more complex configuration.
5991
5992 The two modes are distinguished automatically by the format of the address.
5993 It is not possible to mix the two modes. Once a full path is detected in any
5994 B<Sensor> then the whole addressing (all sensors) is considered to be this way
5995 (and as standard addresses will fail parsing they will be ignored).
5996
5997 =over 4
5998
5999 =item B<Device> I<Device>
6000
6001 Sets the device to read the values from. This can either be a "real" hardware
6002 device, such as a serial port or an USB port, or the address of the
6003 L<owserver(1)> socket, usually B<localhost:4304>.
6004
6005 Though the documentation claims to automatically recognize the given address
6006 format, with versionE<nbsp>2.7p4 we had to specify the type explicitly. So
6007 with that version, the following configuration worked for us:
6008
6009   <Plugin onewire>
6010     Device "-s localhost:4304"
6011   </Plugin>
6012
6013 This directive is B<required> and does not have a default value.
6014
6015 =item B<Sensor> I<Sensor>
6016
6017 In the standard mode selects sensors to collect or to ignore
6018 (depending on B<IgnoreSelected>, see below). Sensors are specified without
6019 the family byte at the beginning, so you have to use for example C<F10FCA000800>,
6020 and B<not> include the leading C<10.> family byte and point.
6021 When no B<Sensor> is configured the whole Onewire bus is walked and all supported
6022 sensors (see above) are read.
6023
6024 In the advanced mode the B<Sensor> specifies full OWFS path - e.g.
6025 C</uncached/10.F10FCA000800/temperature> (or when cached values are OK
6026 C</10.F10FCA000800/temperature>). B<IgnoreSelected> is not used.
6027
6028 As there can be multiple devices on the bus you can list multiple sensor (use
6029 multiple B<Sensor> elements).
6030
6031 See F</"IGNORELISTS"> for details.
6032
6033 =item B<IgnoreSelected> I<true>|I<false>
6034
6035 If no configuration is given, the B<onewire> plugin will collect data from all
6036 sensors found. This may not be practical, especially if sensors are added and
6037 removed regularly. Sometimes, however, it's easier/preferred to collect only
6038 specific sensors or all sensors I<except> a few specified ones. This option
6039 enables you to do that: By setting B<IgnoreSelected> to I<true> the effect of
6040 B<Sensor> is inverted: All selected interfaces are ignored and all other
6041 interfaces are collected.
6042
6043 Used only in the standard mode - see above.
6044
6045 =item B<Interval> I<Seconds>
6046
6047 Sets the interval in which all sensors should be read. If not specified, the
6048 global B<Interval> setting is used.
6049
6050 =back
6051
6052 B<EXPERIMENTAL!> The C<onewire> plugin is experimental, because it doesn't yet
6053 work with big setups. It works with one sensor being attached to one
6054 controller, but as soon as you throw in a couple more senors and maybe a hub
6055 or two, reading all values will take more than ten seconds (the default
6056 interval). We will probably add some separate thread for reading the sensors
6057 and some cache or something like that, but it's not done yet. We will try to
6058 maintain backwards compatibility in the future, but we can't promise. So in
6059 short: If it works for you: Great! But keep in mind that the config I<might>
6060 change, though this is unlikely. Oh, and if you want to help improving this
6061 plugin, just send a short notice to the mailing list. ThanksE<nbsp>:)
6062
6063 =head2 Plugin C<openldap>
6064
6065 To use the C<openldap> plugin you first need to configure the I<OpenLDAP>
6066 server correctly. The backend database C<monitor> needs to be loaded and
6067 working. See slapd-monitor(5) for the details.
6068
6069 The configuration of the C<openldap> plugin consists of one or more B<Instance>
6070 blocks. Each block requires one string argument as the instance name. For
6071 example:
6072
6073  <Plugin "openldap">
6074    <Instance "foo">
6075      URL "ldap://localhost/"
6076    </Instance>
6077    <Instance "bar">
6078      URL "ldaps://localhost/"
6079    </Instance>
6080  </Plugin>
6081
6082 The instance name will be used as the I<plugin instance>. To emulate the old
6083 (versionE<nbsp>4) behavior, you can use an empty string (""). In order for the
6084 plugin to work correctly, each instance name must be unique. This is not
6085 enforced by the plugin and it is your responsibility to ensure it is.
6086
6087 The following options are accepted within each B<Instance> block:
6088
6089 =over 4
6090
6091 =item B<URL> I<ldap://host/binddn>
6092
6093 Sets the URL to use to connect to the I<OpenLDAP> server. This option is
6094 I<mandatory>.
6095
6096 =item B<BindDN> I<BindDN>
6097
6098 Name in the form of an LDAP distinguished name intended to be used for
6099 authentication. Defaults to empty string to establish an anonymous authorization.
6100
6101 =item B<Password> I<Password>
6102
6103 Password for simple bind authentication. If this option is not set,
6104 unauthenticated bind operation is used.
6105
6106 =item B<StartTLS> B<true|false>
6107
6108 Defines whether TLS must be used when connecting to the I<OpenLDAP> server.
6109 Disabled by default.
6110
6111 =item B<VerifyHost> B<true|false>
6112
6113 Enables or disables peer host name verification. If enabled, the plugin checks
6114 if the C<Common Name> or a C<Subject Alternate Name> field of the SSL
6115 certificate matches the host name provided by the B<URL> option. If this
6116 identity check fails, the connection is aborted. Enabled by default.
6117
6118 =item B<CACert> I<File>
6119
6120 File that holds one or more SSL certificates. If you want to use TLS/SSL you
6121 may possibly need this option. What CA certificates are checked by default
6122 depends on the distribution you use and can be changed with the usual ldap
6123 client configuration mechanisms. See ldap.conf(5) for the details.
6124
6125 =item B<Timeout> I<Seconds>
6126
6127 Sets the timeout value for ldap operations, in seconds. By default, the
6128 configured B<Interval> is used to set the timeout. Use B<-1> to disable
6129 (infinite timeout).
6130
6131 =item B<Version> I<Version>
6132
6133 An integer which sets the LDAP protocol version number to use when connecting
6134 to the I<OpenLDAP> server. Defaults to B<3> for using I<LDAPv3>.
6135
6136 =back
6137
6138 =head2 Plugin C<openvpn>
6139
6140 The OpenVPN plugin reads a status file maintained by OpenVPN and gathers
6141 traffic statistics about connected clients.
6142
6143 To set up OpenVPN to write to the status file periodically, use the
6144 B<--status> option of OpenVPN.
6145
6146 So, in a nutshell you need:
6147
6148   openvpn $OTHER_OPTIONS \
6149     --status "/var/run/openvpn-status" 10
6150
6151 Available options:
6152
6153 =over 4
6154
6155 =item B<StatusFile> I<File>
6156
6157 Specifies the location of the status file.
6158
6159 =item B<ImprovedNamingSchema> B<true>|B<false>
6160
6161 When enabled, the filename of the status file will be used as plugin instance
6162 and the client's "common name" will be used as type instance. This is required
6163 when reading multiple status files. Enabling this option is recommended, but to
6164 maintain backwards compatibility this option is disabled by default.
6165
6166 =item B<CollectCompression> B<true>|B<false>
6167
6168 Sets whether or not statistics about the compression used by OpenVPN should be
6169 collected. This information is only available in I<single> mode. Enabled by
6170 default.
6171
6172 =item B<CollectIndividualUsers> B<true>|B<false>
6173
6174 Sets whether or not traffic information is collected for each connected client
6175 individually. If set to false, currently no traffic data is collected at all
6176 because aggregating this data in a save manner is tricky. Defaults to B<true>.
6177
6178 =item B<CollectUserCount> B<true>|B<false>
6179
6180 When enabled, the number of currently connected clients or users is collected.
6181 This is especially interesting when B<CollectIndividualUsers> is disabled, but
6182 can be configured independently from that option. Defaults to B<false>.
6183
6184 =back
6185
6186 =head2 Plugin C<oracle>
6187
6188 The "oracle" plugin uses the Oracle® Call Interface I<(OCI)> to connect to an
6189 Oracle® Database and lets you execute SQL statements there. It is very similar
6190 to the "dbi" plugin, because it was written around the same time. See the "dbi"
6191 plugin's documentation above for details.
6192
6193   <Plugin oracle>
6194     <Query "out_of_stock">
6195       Statement "SELECT category, COUNT(*) AS value FROM products WHERE in_stock = 0 GROUP BY category"
6196       <Result>
6197         Type "gauge"
6198         # InstancePrefix "foo"
6199         InstancesFrom "category"
6200         ValuesFrom "value"
6201       </Result>
6202     </Query>
6203     <Database "product_information">
6204       #Plugin "warehouse"
6205       ConnectID "db01"
6206       Username "oracle"
6207       Password "secret"
6208       Query "out_of_stock"
6209     </Database>
6210   </Plugin>
6211
6212 =head3 B<Query> blocks
6213
6214 The Query blocks are handled identically to the Query blocks of the "dbi"
6215 plugin. Please see its documentation above for details on how to specify
6216 queries.
6217
6218 =head3 B<Database> blocks
6219
6220 Database blocks define a connection to a database and which queries should be
6221 sent to that database. Each database needs a "name" as string argument in the
6222 starting tag of the block. This name will be used as "PluginInstance" in the
6223 values submitted to the daemon. Other than that, that name is not used.
6224
6225 =over 4
6226
6227 =item B<Plugin> I<Plugin>
6228
6229 Use I<Plugin> as the plugin name when submitting query results from
6230 this B<Database>. Defaults to C<oracle>.
6231
6232 =item B<ConnectID> I<ID>
6233
6234 Defines the "database alias" or "service name" to connect to. Usually, these
6235 names are defined in the file named C<$ORACLE_HOME/network/admin/tnsnames.ora>.
6236
6237 =item B<Host> I<Host>
6238
6239 Hostname to use when dispatching values for this database. Defaults to using
6240 the global hostname of the I<collectd> instance.
6241
6242 =item B<Username> I<Username>
6243
6244 Username used for authentication.
6245
6246 =item B<Password> I<Password>
6247
6248 Password used for authentication.
6249
6250 =item B<Query> I<QueryName>
6251
6252 Associates the query named I<QueryName> with this database connection. The
6253 query needs to be defined I<before> this statement, i.E<nbsp>e. all query
6254 blocks you want to refer to must be placed above the database block you want to
6255 refer to them from.
6256
6257 =back
6258
6259 =head2 Plugin C<ovs_events>
6260
6261 The I<ovs_events> plugin monitors the link status of I<Open vSwitch> (OVS)
6262 connected interfaces, dispatches the values to collectd and sends the
6263 notification whenever the link state change occurs. This plugin uses OVS
6264 database to get a link state change notification.
6265
6266 B<Synopsis:>
6267
6268  <Plugin "ovs_events">
6269    Port 6640
6270    Address "127.0.0.1"
6271    Socket "/var/run/openvswitch/db.sock"
6272    Interfaces "br0" "veth0"
6273    SendNotification true
6274    DispatchValues false
6275  </Plugin>
6276
6277 The plugin provides the following configuration options:
6278
6279 =over 4
6280
6281 =item B<Address> I<node>
6282
6283 The address of the OVS DB server JSON-RPC interface used by the plugin. To
6284 enable the interface, OVS DB daemon should be running with C<--remote=ptcp:>
6285 option. See L<ovsdb-server(1)> for more details. The option may be either
6286 network hostname, IPv4 numbers-and-dots notation or IPv6 hexadecimal string
6287 format. Defaults to C<localhost>.
6288
6289 =item B<Port> I<service>
6290
6291 TCP-port to connect to. Either a service name or a port number may be given.
6292 Defaults to B<6640>.
6293
6294 =item B<Socket> I<path>
6295
6296 The UNIX domain socket path of OVS DB server JSON-RPC interface used by the
6297 plugin. To enable the interface, the OVS DB daemon should be running with
6298 C<--remote=punix:> option. See L<ovsdb-server(1)> for more details. If this
6299 option is set, B<Address> and B<Port> options are ignored.
6300
6301 =item B<Interfaces> [I<ifname> ...]
6302
6303 List of interface names to be monitored by this plugin. If this option is not
6304 specified or is empty then all OVS connected interfaces on all bridges are
6305 monitored.
6306
6307 Default: empty (all interfaces on all bridges are monitored)
6308
6309 =item B<SendNotification> I<true|false>
6310
6311 If set to true, OVS link notifications (interface status and OVS DB connection
6312 terminate) are sent to collectd. Default value is true.
6313
6314 =item B<DispatchValues> I<true|false>
6315
6316 Dispatch the OVS DB interface link status value with configured plugin interval.
6317 Defaults to false. Please note, if B<SendNotification> and B<DispatchValues>
6318 options are false, no OVS information will be provided by the plugin.
6319
6320 =back
6321
6322 B<Note:> By default, the global interval setting is used within which to
6323 retrieve the OVS link status. To configure a plugin-specific interval, please
6324 use B<Interval> option of the OVS B<LoadPlugin> block settings. For milliseconds
6325 simple divide the time by 1000 for example if the desired interval is 50ms, set
6326 interval to 0.05.
6327
6328 =head2 Plugin C<ovs_stats>
6329
6330 The I<ovs_stats> plugin collects statistics of OVS connected interfaces.
6331 This plugin uses OVSDB management protocol (RFC7047) monitor mechanism to get
6332 statistics from OVSDB
6333
6334 B<Synopsis:>
6335
6336  <Plugin "ovs_stats">
6337    Port 6640
6338    Address "127.0.0.1"
6339    Socket "/var/run/openvswitch/db.sock"
6340    Bridges "br0" "br_ext"
6341    InterfaceStats false
6342  </Plugin>
6343
6344 The plugin provides the following configuration options:
6345
6346 =over 4
6347
6348 =item B<Address> I<node>
6349
6350 The address of the OVS DB server JSON-RPC interface used by the plugin. To
6351 enable the interface, OVS DB daemon should be running with C<--remote=ptcp:>
6352 option. See L<ovsdb-server(1)> for more details. The option may be either
6353 network hostname, IPv4 numbers-and-dots notation or IPv6 hexadecimal string
6354 format. Defaults to C<localhost>.
6355
6356 =item B<Port> I<service>
6357
6358 TCP-port to connect to. Either a service name or a port number may be given.
6359 Defaults to B<6640>.
6360
6361 =item B<Socket> I<path>
6362
6363 The UNIX domain socket path of OVS DB server JSON-RPC interface used by the
6364 plugin. To enable the interface, the OVS DB daemon should be running with
6365 C<--remote=punix:> option. See L<ovsdb-server(1)> for more details. If this
6366 option is set, B<Address> and B<Port> options are ignored.
6367
6368 =item B<Bridges> [I<brname> ...]
6369
6370 List of OVS bridge names to be monitored by this plugin. If this option is
6371 omitted or is empty then all OVS bridges will be monitored.
6372
6373 Default: empty (monitor all bridges)
6374
6375 =item B<InterfaceStats> B<false>|B<true>
6376
6377 Indicates that the plugin should gather statistics for individual interfaces
6378 in addition to ports.  This can be useful when monitoring an OVS setup with
6379 bond ports, where you might wish to know individual statistics for the
6380 interfaces included in the bonds.  Defaults to B<false>.
6381
6382 =back
6383
6384 =head2 Plugin C<pcie_errors>
6385
6386 The I<pcie_errors> plugin collects PCI Express errors from Device Status in Capability
6387 structure and from Advanced Error Reporting Extended Capability where available.
6388 At every read it polls config space of PCI Express devices and dispatches
6389 notification for every error that is set. It checks for new errors at every read.
6390 The device is indicated in plugin_instance according to format "domain:bus:dev.fn".
6391 Errors are divided into categories indicated by type_instance: "correctable", and
6392 for uncorrectable errors "non_fatal" or "fatal".
6393 Fatal errors are reported as I<NOTIF_FAILURE> and all others as I<NOTIF_WARNING>.
6394
6395 B<Synopsis:>
6396
6397   <Plugin "pcie_errors">
6398     Source "sysfs"
6399     AccessDir "/sys/bus/pci"
6400     ReportMasked false
6401     PersistentNotifications false
6402   </Plugin>
6403
6404 B<Options:>
6405
6406 =over 4
6407
6408 =item B<Source> B<sysfs>|B<proc>
6409
6410 Use B<sysfs> or B<proc> to read data from /sysfs or /proc.
6411 The default value is B<sysfs>.
6412
6413 =item B<AccessDir> I<dir>
6414
6415 Directory used to access device config space. It is optional and defaults to
6416 /sys/bus/pci for B<sysfs> and to /proc/bus/pci for B<proc>.
6417
6418 =item B<ReportMasked> B<false>|B<true>
6419
6420 If true plugin will notify about errors that are set to masked in Error Mask register.
6421 Such errors are not reported to the PCI Express Root Complex. Defaults to B<false>.
6422
6423 =item B<PersistentNotifications> B<false>|B<true>
6424
6425 If false plugin will dispatch notification only on set/clear of error.
6426 The ones already reported will be ignored. Defaults to B<false>.
6427
6428 =back
6429
6430 =head2 Plugin C<perl>
6431
6432 This plugin embeds a Perl-interpreter into collectd and provides an interface
6433 to collectd's plugin system. See L<collectd-perl(5)> for its documentation.
6434
6435 =head2 Plugin C<pinba>
6436
6437 The I<Pinba plugin> receives profiling information from I<Pinba>, an extension
6438 for the I<PHP> interpreter. At the end of executing a script, i.e. after a
6439 PHP-based webpage has been delivered, the extension will send a UDP packet
6440 containing timing information, peak memory usage and so on. The plugin will
6441 wait for such packets, parse them and account the provided information, which
6442 is then dispatched to the daemon once per interval.
6443
6444 Synopsis:
6445
6446  <Plugin pinba>
6447    Address "::0"
6448    Port "30002"
6449    # Overall statistics for the website.
6450    <View "www-total">
6451      Server "www.example.com"
6452    </View>
6453    # Statistics for www-a only
6454    <View "www-a">
6455      Host "www-a.example.com"
6456      Server "www.example.com"
6457    </View>
6458    # Statistics for www-b only
6459    <View "www-b">
6460      Host "www-b.example.com"
6461      Server "www.example.com"
6462    </View>
6463  </Plugin>
6464
6465 The plugin provides the following configuration options:
6466
6467 =over 4
6468
6469 =item B<Address> I<Node>
6470
6471 Configures the address used to open a listening socket. By default, plugin will
6472 bind to the I<any> address C<::0>.
6473
6474 =item B<Port> I<Service>
6475
6476 Configures the port (service) to bind to. By default the default Pinba port
6477 "30002" will be used. The option accepts service names in addition to port
6478 numbers and thus requires a I<string> argument.
6479
6480 =item E<lt>B<View> I<Name>E<gt> block
6481
6482 The packets sent by the Pinba extension include the hostname of the server, the
6483 server name (the name of the virtual host) and the script that was executed.
6484 Using B<View> blocks it is possible to separate the data into multiple groups
6485 to get more meaningful statistics. Each packet is added to all matching groups,
6486 so that a packet may be accounted for more than once.
6487
6488 =over 4
6489
6490 =item B<Host> I<Host>
6491
6492 Matches the hostname of the system the webserver / script is running on. This
6493 will contain the result of the L<gethostname(2)> system call. If not
6494 configured, all hostnames will be accepted.
6495
6496 =item B<Server> I<Server>
6497
6498 Matches the name of the I<virtual host>, i.e. the contents of the
6499 C<$_SERVER["SERVER_NAME"]> variable when within PHP. If not configured, all
6500 server names will be accepted.
6501
6502 =item B<Script> I<Script>
6503
6504 Matches the name of the I<script name>, i.e. the contents of the
6505 C<$_SERVER["SCRIPT_NAME"]> variable when within PHP. If not configured, all
6506 script names will be accepted.
6507
6508 =back
6509
6510 =back
6511
6512 =head2 Plugin C<ping>
6513
6514 The I<Ping> plugin starts a new thread which sends ICMP "ping" packets to the
6515 configured hosts periodically and measures the network latency. Whenever the
6516 C<read> function of the plugin is called, it submits the average latency, the
6517 standard deviation and the drop rate for each host.
6518
6519 Available configuration options:
6520
6521 =over 4
6522
6523 =item B<Host> I<IP-address>
6524
6525 Host to ping periodically. This option may be repeated several times to ping
6526 multiple hosts.
6527
6528 =item B<Interval> I<Seconds>
6529
6530 Sets the interval in which to send ICMP echo packets to the configured hosts.
6531 This is B<not> the interval in which metrics are read from the plugin but the
6532 interval in which the hosts are "pinged". Therefore, the setting here should be
6533 smaller than or equal to the global B<Interval> setting. Fractional times, such
6534 as "1.24" are allowed.
6535
6536 Default: B<1.0>
6537
6538 =item B<Timeout> I<Seconds>
6539
6540 Time to wait for a response from the host to which an ICMP packet had been
6541 sent. If a reply was not received after I<Seconds> seconds, the host is assumed
6542 to be down or the packet to be dropped. This setting must be smaller than the
6543 B<Interval> setting above for the plugin to work correctly. Fractional
6544 arguments are accepted.
6545
6546 Default: B<0.9>
6547
6548 =item B<TTL> I<0-255>
6549
6550 Sets the Time-To-Live of generated ICMP packets.
6551
6552 =item B<Size> I<size>
6553
6554 Sets the size of the data payload in ICMP packet to specified I<size> (it
6555 will be filled with regular ASCII pattern). If not set, default 56 byte
6556 long string is used so that the packet size of an ICMPv4 packet is exactly
6557 64 bytes, similar to the behaviour of normal ping(1) command.
6558
6559 =item B<SourceAddress> I<host>
6560
6561 Sets the source address to use. I<host> may either be a numerical network
6562 address or a network hostname.
6563
6564 =item B<AddressFamily> I<af>
6565
6566 Sets the address family to use. I<af> may be "any", "ipv4" or "ipv6". This
6567 option will be ignored if you set a B<SourceAddress>.
6568
6569 =item B<Device> I<name>
6570
6571 Sets the outgoing network device to be used. I<name> has to specify an
6572 interface name (e.E<nbsp>g. C<eth0>). This might not be supported by all
6573 operating systems.
6574
6575 =item B<MaxMissed> I<Packets>
6576
6577 Trigger a DNS resolve after the host has not replied to I<Packets> packets. This
6578 enables the use of dynamic DNS services (like dyndns.org) with the ping plugin.
6579
6580 Default: B<-1> (disabled)
6581
6582 =back
6583
6584 =head2 Plugin C<postgresql>
6585
6586 The C<postgresql> plugin queries statistics from PostgreSQL databases. It
6587 keeps a persistent connection to all configured databases and tries to
6588 reconnect if the connection has been interrupted. A database is configured by
6589 specifying a B<Database> block as described below. The default statistics are
6590 collected from PostgreSQL's B<statistics collector> which thus has to be
6591 enabled for this plugin to work correctly. This should usually be the case by
6592 default. See the section "The Statistics Collector" of the B<PostgreSQL
6593 Documentation> for details.
6594
6595 By specifying custom database queries using a B<Query> block as described
6596 below, you may collect any data that is available from some PostgreSQL
6597 database. This way, you are able to access statistics of external daemons
6598 which are available in a PostgreSQL database or use future or special
6599 statistics provided by PostgreSQL without the need to upgrade your collectd
6600 installation.
6601
6602 Starting with version 5.2, the C<postgresql> plugin supports writing data to
6603 PostgreSQL databases as well. This has been implemented in a generic way. You
6604 need to specify an SQL statement which will then be executed by collectd in
6605 order to write the data (see below for details). The benefit of that approach
6606 is that there is no fixed database layout. Rather, the layout may be optimized
6607 for the current setup.
6608
6609 The B<PostgreSQL Documentation> manual can be found at
6610 L<http://www.postgresql.org/docs/manuals/>.
6611
6612   <Plugin postgresql>
6613     <Query magic>
6614       Statement "SELECT magic FROM wizard WHERE host = $1;"
6615       Param hostname
6616       <Result>
6617         Type gauge
6618         InstancePrefix "magic"
6619         ValuesFrom magic
6620       </Result>
6621     </Query>
6622
6623     <Query rt36_tickets>
6624       Statement "SELECT COUNT(type) AS count, type \
6625                         FROM (SELECT CASE \
6626                                      WHEN resolved = 'epoch' THEN 'open' \
6627                                      ELSE 'resolved' END AS type \
6628                                      FROM tickets) type \
6629                         GROUP BY type;"
6630       <Result>
6631         Type counter
6632         InstancePrefix "rt36_tickets"
6633         InstancesFrom "type"
6634         ValuesFrom "count"
6635       </Result>
6636     </Query>
6637
6638     <Writer sqlstore>
6639       Statement "SELECT collectd_insert($1, $2, $3, $4, $5, $6, $7, $8, $9);"
6640       StoreRates true
6641     </Writer>
6642
6643     <Database foo>
6644       Plugin "kingdom"
6645       Host "hostname"
6646       Port "5432"
6647       User "username"
6648       Password "secret"
6649       SSLMode "prefer"
6650       KRBSrvName "kerberos_service_name"
6651       Query magic
6652     </Database>
6653
6654     <Database bar>
6655       Interval 300
6656       Service "service_name"
6657       Query backends # predefined
6658       Query rt36_tickets
6659     </Database>
6660
6661     <Database qux>
6662       # ...
6663       Writer sqlstore
6664       CommitInterval 10
6665     </Database>
6666   </Plugin>
6667
6668 The B<Query> block defines one database query which may later be used by a
6669 database definition. It accepts a single mandatory argument which specifies
6670 the name of the query. The names of all queries have to be unique (see the
6671 B<MinVersion> and B<MaxVersion> options below for an exception to this
6672 rule).
6673
6674 In each B<Query> block, there is one or more B<Result> blocks. Multiple
6675 B<Result> blocks may be used to extract multiple values from a single query.
6676
6677 The following configuration options are available to define the query:
6678
6679 =over 4
6680
6681 =item B<Statement> I<sql query statement>
6682
6683 Specify the I<sql query statement> which the plugin should execute. The string
6684 may contain the tokens B<$1>, B<$2>, etc. which are used to reference the
6685 first, second, etc. parameter. The value of the parameters is specified by the
6686 B<Param> configuration option - see below for details. To include a literal
6687 B<$> character followed by a number, surround it with single quotes (B<'>).
6688
6689 Any SQL command which may return data (such as C<SELECT> or C<SHOW>) is
6690 allowed. Note, however, that only a single command may be used. Semicolons are
6691 allowed as long as a single non-empty command has been specified only.
6692
6693 The returned lines will be handled separately one after another.
6694
6695 =item B<Param> I<hostname>|I<database>|I<instance>|I<username>|I<interval>
6696
6697 Specify the parameters which should be passed to the SQL query. The parameters
6698 are referred to in the SQL query as B<$1>, B<$2>, etc. in the same order as
6699 they appear in the configuration file. The value of the parameter is
6700 determined depending on the value of the B<Param> option as follows:
6701
6702 =over 4
6703
6704 =item I<hostname>
6705
6706 The configured hostname of the database connection. If a UNIX domain socket is
6707 used, the parameter expands to "localhost".
6708
6709 =item I<database>
6710
6711 The name of the database of the current connection.
6712
6713 =item I<instance>
6714
6715 The name of the database plugin instance. See the B<Instance> option of the
6716 database specification below for details.
6717
6718 =item I<username>
6719
6720 The username used to connect to the database.
6721
6722 =item I<interval>
6723
6724 The interval with which this database is queried (as specified by the database
6725 specific or global B<Interval> options).
6726
6727 =back
6728
6729 Please note that parameters are only supported by PostgreSQL's protocol
6730 version 3 and above which was introduced in version 7.4 of PostgreSQL.
6731
6732 =item B<PluginInstanceFrom> I<column>
6733
6734 Specify how to create the "PluginInstance" for reporting this query results.
6735 Only one column is supported. You may concatenate fields and string values in
6736 the query statement to get the required results.
6737
6738 =item B<MinVersion> I<version>
6739
6740 =item B<MaxVersion> I<version>
6741
6742 Specify the minimum or maximum version of PostgreSQL that this query should be
6743 used with. Some statistics might only be available with certain versions of
6744 PostgreSQL. This allows you to specify multiple queries with the same name but
6745 which apply to different versions, thus allowing you to use the same
6746 configuration in a heterogeneous environment.
6747
6748 The I<version> has to be specified as the concatenation of the major, minor
6749 and patch-level versions, each represented as two-decimal-digit numbers. For
6750 example, version 8.2.3 will become 80203.
6751
6752 =back
6753
6754 The B<Result> block defines how to handle the values returned from the query.
6755 It defines which column holds which value and how to dispatch that value to
6756 the daemon.
6757
6758 =over 4
6759
6760 =item B<Type> I<type>
6761
6762 The I<type> name to be used when dispatching the values. The type describes
6763 how to handle the data and where to store it. See L<types.db(5)> for more
6764 details on types and their configuration. The number and type of values (as
6765 selected by the B<ValuesFrom> option) has to match the type of the given name.
6766
6767 This option is mandatory.
6768
6769 =item B<InstancePrefix> I<prefix>
6770
6771 =item B<InstancesFrom> I<column0> [I<column1> ...]
6772
6773 Specify how to create the "TypeInstance" for each data set (i.E<nbsp>e. line).
6774 B<InstancePrefix> defines a static prefix that will be prepended to all type
6775 instances. B<InstancesFrom> defines the column names whose values will be used
6776 to create the type instance. Multiple values will be joined together using the
6777 hyphen (C<->) as separation character.
6778
6779 The plugin itself does not check whether or not all built instances are
6780 different. It is your responsibility to assure that each is unique.
6781
6782 Both options are optional. If none is specified, the type instance will be
6783 empty.
6784
6785 =item B<ValuesFrom> I<column0> [I<column1> ...]
6786
6787 Names the columns whose content is used as the actual data for the data sets
6788 that are dispatched to the daemon. How many such columns you need is
6789 determined by the B<Type> setting as explained above. If you specify too many
6790 or not enough columns, the plugin will complain about that and no data will be
6791 submitted to the daemon.
6792
6793 The actual data type, as seen by PostgreSQL, is not that important as long as
6794 it represents numbers. The plugin will automatically cast the values to the
6795 right type if it know how to do that. For that, it uses the L<strtoll(3)> and
6796 L<strtod(3)> functions, so anything supported by those functions is supported
6797 by the plugin as well.
6798
6799 This option is required inside a B<Result> block and may be specified multiple
6800 times. If multiple B<ValuesFrom> options are specified, the columns are read
6801 in the given order.
6802
6803 =back
6804
6805 The following predefined queries are available (the definitions can be found
6806 in the F<postgresql_default.conf> file which, by default, is available at
6807 C<I<prefix>/share/collectd/>):
6808
6809 =over 4
6810
6811 =item B<backends>
6812
6813 This query collects the number of backends, i.E<nbsp>e. the number of
6814 connected clients.
6815
6816 =item B<transactions>
6817
6818 This query collects the numbers of committed and rolled-back transactions of
6819 the user tables.
6820
6821 =item B<queries>
6822
6823 This query collects the numbers of various table modifications (i.E<nbsp>e.
6824 insertions, updates, deletions) of the user tables.
6825
6826 =item B<query_plans>
6827
6828 This query collects the numbers of various table scans and returned tuples of
6829 the user tables.
6830
6831 =item B<table_states>
6832
6833 This query collects the numbers of live and dead rows in the user tables.
6834
6835 =item B<disk_io>
6836
6837 This query collects disk block access counts for user tables.
6838
6839 =item B<disk_usage>
6840
6841 This query collects the on-disk size of the database in bytes.
6842
6843 =back
6844
6845 In addition, the following detailed queries are available by default. Please
6846 note that each of those queries collects information B<by table>, thus,
6847 potentially producing B<a lot> of data. For details see the description of the
6848 non-by_table queries above.
6849
6850 =over 4
6851
6852 =item B<queries_by_table>
6853
6854 =item B<query_plans_by_table>
6855
6856 =item B<table_states_by_table>
6857
6858 =item B<disk_io_by_table>
6859
6860 =back
6861
6862 The B<Writer> block defines a PostgreSQL writer backend. It accepts a single
6863 mandatory argument specifying the name of the writer. This will then be used
6864 in the B<Database> specification in order to activate the writer instance. The
6865 names of all writers have to be unique. The following options may be
6866 specified:
6867
6868 =over 4
6869
6870 =item B<Statement> I<sql statement>
6871
6872 This mandatory option specifies the SQL statement that will be executed for
6873 each submitted value. A single SQL statement is allowed only. Anything after
6874 the first semicolon will be ignored.
6875
6876 Nine parameters will be passed to the statement and should be specified as
6877 tokens B<$1>, B<$2>, through B<$9> in the statement string. The following
6878 values are made available through those parameters:
6879
6880 =over 4
6881
6882 =item B<$1>
6883
6884 The timestamp of the queried value as an RFC 3339-formatted local time.
6885
6886 =item B<$2>
6887
6888 The hostname of the queried value.
6889
6890 =item B<$3>
6891
6892 The plugin name of the queried value.
6893
6894 =item B<$4>
6895
6896 The plugin instance of the queried value. This value may be B<NULL> if there
6897 is no plugin instance.
6898
6899 =item B<$5>
6900
6901 The type of the queried value (cf. L<types.db(5)>).
6902
6903 =item B<$6>
6904
6905 The type instance of the queried value. This value may be B<NULL> if there is
6906 no type instance.
6907
6908 =item B<$7>
6909
6910 An array of names for the submitted values (i.E<nbsp>e., the name of the data
6911 sources of the submitted value-list).
6912
6913 =item B<$8>
6914
6915 An array of types for the submitted values (i.E<nbsp>e., the type of the data
6916 sources of the submitted value-list; C<counter>, C<gauge>, ...). Note, that if
6917 B<StoreRates> is enabled (which is the default, see below), all types will be
6918 C<gauge>.
6919
6920 =item B<$9>
6921
6922 An array of the submitted values. The dimensions of the value name and value
6923 arrays match.
6924
6925 =back
6926
6927 In general, it is advisable to create and call a custom function in the
6928 PostgreSQL database for this purpose. Any procedural language supported by
6929 PostgreSQL will do (see chapter "Server Programming" in the PostgreSQL manual
6930 for details).
6931
6932 =item B<StoreRates> B<false>|B<true>
6933
6934 If set to B<true> (the default), convert counter values to rates. If set to
6935 B<false> counter values are stored as is, i.E<nbsp>e. as an increasing integer
6936 number.
6937
6938 =back
6939
6940 The B<Database> block defines one PostgreSQL database for which to collect
6941 statistics. It accepts a single mandatory argument which specifies the
6942 database name. None of the other options are required. PostgreSQL will use
6943 default values as documented in the section "CONNECTING TO A DATABASE" in the
6944 L<psql(1)> manpage. However, be aware that those defaults may be influenced by
6945 the user collectd is run as and special environment variables. See the manpage
6946 for details.
6947
6948 =over 4
6949
6950 =item B<Interval> I<seconds>
6951
6952 Specify the interval with which the database should be queried. The default is
6953 to use the global B<Interval> setting.
6954
6955 =item B<CommitInterval> I<seconds>
6956
6957 This option may be used for database connections which have "writers" assigned
6958 (see above). If specified, it causes a writer to put several updates into a
6959 single transaction. This transaction will last for the specified amount of
6960 time. By default, each update will be executed in a separate transaction. Each
6961 transaction generates a fair amount of overhead which can, thus, be reduced by
6962 activating this option. The draw-back is, that data covering the specified
6963 amount of time will be lost, for example, if a single statement within the
6964 transaction fails or if the database server crashes.
6965
6966 =item B<Plugin> I<Plugin>
6967
6968 Use I<Plugin> as the plugin name when submitting query results from
6969 this B<Database>. Defaults to C<postgresql>.
6970
6971 =item B<Instance> I<name>
6972
6973 Specify the plugin instance name that should be used instead of the database
6974 name (which is the default, if this option has not been specified). This
6975 allows one to query multiple databases of the same name on the same host (e.g.
6976 when running multiple database server versions in parallel).
6977 The plugin instance name can also be set from the query result using
6978 the B<PluginInstanceFrom> option in B<Query> block.
6979
6980 =item B<Host> I<hostname>
6981
6982 Specify the hostname or IP of the PostgreSQL server to connect to. If the
6983 value begins with a slash, it is interpreted as the directory name in which to
6984 look for the UNIX domain socket.
6985
6986 This option is also used to determine the hostname that is associated with a
6987 collected data set. If it has been omitted or either begins with with a slash
6988 or equals B<localhost> it will be replaced with the global hostname definition
6989 of collectd. Any other value will be passed literally to collectd when
6990 dispatching values. Also see the global B<Hostname> and B<FQDNLookup> options.
6991
6992 =item B<Port> I<port>
6993
6994 Specify the TCP port or the local UNIX domain socket file extension of the
6995 server.
6996
6997 =item B<User> I<username>
6998
6999 Specify the username to be used when connecting to the server.
7000
7001 =item B<Password> I<password>
7002
7003 Specify the password to be used when connecting to the server.
7004
7005 =item B<ExpireDelay> I<delay>
7006
7007 Skip expired values in query output.
7008
7009 =item B<SSLMode> I<disable>|I<allow>|I<prefer>|I<require>
7010
7011 Specify whether to use an SSL connection when contacting the server. The
7012 following modes are supported:
7013
7014 =over 4
7015
7016 =item I<disable>
7017
7018 Do not use SSL at all.
7019
7020 =item I<allow>
7021
7022 First, try to connect without using SSL. If that fails, try using SSL.
7023
7024 =item I<prefer> (default)
7025
7026 First, try to connect using SSL. If that fails, try without using SSL.
7027
7028 =item I<require>
7029
7030 Use SSL only.
7031
7032 =back
7033
7034 =item B<Instance> I<name>
7035
7036 Specify the plugin instance name that should be used instead of the database
7037 name (which is the default, if this option has not been specified). This
7038 allows one to query multiple databases of the same name on the same host (e.g.
7039 when running multiple database server versions in parallel).
7040
7041 =item B<KRBSrvName> I<kerberos_service_name>
7042
7043 Specify the Kerberos service name to use when authenticating with Kerberos 5
7044 or GSSAPI. See the sections "Kerberos authentication" and "GSSAPI" of the
7045 B<PostgreSQL Documentation> for details.
7046
7047 =item B<Service> I<service_name>
7048
7049 Specify the PostgreSQL service name to use for additional parameters. That
7050 service has to be defined in F<pg_service.conf> and holds additional
7051 connection parameters. See the section "The Connection Service File" in the
7052 B<PostgreSQL Documentation> for details.
7053
7054 =item B<Query> I<query>
7055
7056 Specifies a I<query> which should be executed in the context of the database
7057 connection. This may be any of the predefined or user-defined queries. If no
7058 such option is given, it defaults to "backends", "transactions", "queries",
7059 "query_plans", "table_states", "disk_io" and "disk_usage" (unless a B<Writer>
7060 has been specified). Else, the specified queries are used only.
7061
7062 =item B<Writer> I<writer>
7063
7064 Assigns the specified I<writer> backend to the database connection. This
7065 causes all collected data to be send to the database using the settings
7066 defined in the writer configuration (see the section "FILTER CONFIGURATION"
7067 below for details on how to selectively send data to certain plugins).
7068
7069 Each writer will register a flush callback which may be used when having long
7070 transactions enabled (see the B<CommitInterval> option above). When issuing
7071 the B<FLUSH> command (see L<collectd-unixsock(5)> for details) the current
7072 transaction will be committed right away. Two different kinds of flush
7073 callbacks are available with the C<postgresql> plugin:
7074
7075 =over 4
7076
7077 =item B<postgresql>
7078
7079 Flush all writer backends.
7080
7081 =item B<postgresql->I<database>
7082
7083 Flush all writers of the specified I<database> only.
7084
7085 =back
7086
7087 =back
7088
7089 =head2 Plugin C<powerdns>
7090
7091 The C<powerdns> plugin queries statistics from an authoritative PowerDNS
7092 nameserver and/or a PowerDNS recursor. Since both offer a wide variety of
7093 values, many of which are probably meaningless to most users, but may be useful
7094 for some. So you may chose which values to collect, but if you don't, some
7095 reasonable defaults will be collected.
7096
7097   <Plugin "powerdns">
7098     <Server "server_name">
7099       Collect "latency"
7100       Collect "udp-answers" "udp-queries"
7101       Socket "/var/run/pdns.controlsocket"
7102     </Server>
7103     <Recursor "recursor_name">
7104       Collect "questions"
7105       Collect "cache-hits" "cache-misses"
7106       Socket "/var/run/pdns_recursor.controlsocket"
7107     </Recursor>
7108     LocalSocket "/opt/collectd/var/run/collectd-powerdns"
7109   </Plugin>
7110
7111 =over 4
7112
7113 =item B<Server> and B<Recursor> block
7114
7115 The B<Server> block defines one authoritative server to query, the B<Recursor>
7116 does the same for an recursing server. The possible options in both blocks are
7117 the same, though. The argument defines a name for the serverE<nbsp>/ recursor
7118 and is required.
7119
7120 =over 4
7121
7122 =item B<Collect> I<Field>
7123
7124 Using the B<Collect> statement you can select which values to collect. Here,
7125 you specify the name of the values as used by the PowerDNS servers, e.E<nbsp>g.
7126 C<dlg-only-drops>, C<answers10-100>.
7127
7128 The method of getting the values differs for B<Server> and B<Recursor> blocks:
7129 When querying the server a C<SHOW *> command is issued in any case, because
7130 that's the only way of getting multiple values out of the server at once.
7131 collectd then picks out the values you have selected. When querying the
7132 recursor, a command is generated to query exactly these values. So if you
7133 specify invalid fields when querying the recursor, a syntax error may be
7134 returned by the daemon and collectd may not collect any values at all.
7135
7136 If no B<Collect> statement is given, the following B<Server> values will be
7137 collected:
7138
7139 =over 4
7140
7141 =item latency
7142
7143 =item packetcache-hit
7144
7145 =item packetcache-miss
7146
7147 =item packetcache-size
7148
7149 =item query-cache-hit
7150
7151 =item query-cache-miss
7152
7153 =item recursing-answers
7154
7155 =item recursing-questions
7156
7157 =item tcp-answers
7158
7159 =item tcp-queries
7160
7161 =item udp-answers
7162
7163 =item udp-queries
7164
7165 =back
7166
7167 The following B<Recursor> values will be collected by default:
7168
7169 =over 4
7170
7171 =item noerror-answers
7172
7173 =item nxdomain-answers
7174
7175 =item servfail-answers
7176
7177 =item sys-msec
7178
7179 =item user-msec
7180
7181 =item qa-latency
7182
7183 =item cache-entries
7184
7185 =item cache-hits
7186
7187 =item cache-misses
7188
7189 =item questions
7190
7191 =back
7192
7193 Please note that up to that point collectd doesn't know what values are
7194 available on the server and values that are added do not need a change of the
7195 mechanism so far. However, the values must be mapped to collectd's naming
7196 scheme, which is done using a lookup table that lists all known values. If
7197 values are added in the future and collectd does not know about them, you will
7198 get an error much like this:
7199
7200   powerdns plugin: submit: Not found in lookup table: foobar = 42
7201
7202 In this case please file a bug report with the collectd team.
7203
7204 =item B<Socket> I<Path>
7205
7206 Configures the path to the UNIX domain socket to be used when connecting to the
7207 daemon. By default C<${localstatedir}/run/pdns.controlsocket> will be used for
7208 an authoritative server and C<${localstatedir}/run/pdns_recursor.controlsocket>
7209 will be used for the recursor.
7210
7211 =back
7212
7213 =item B<LocalSocket> I<Path>
7214
7215 Querying the recursor is done using UDP. When using UDP over UNIX domain
7216 sockets, the client socket needs a name in the file system, too. You can set
7217 this local name to I<Path> using the B<LocalSocket> option. The default is
7218 C<I<prefix>/var/run/collectd-powerdns>.
7219
7220 =back
7221
7222 =head2 Plugin C<processes>
7223
7224 Collects information about processes of local system.
7225
7226 By default, with no process matches configured, only general statistics is
7227 collected: the number of processes in each state and fork rate.
7228
7229 Process matches can be configured by B<Process> and B<ProcessMatch> options.
7230 These may also be a block in which further options may be specified.
7231
7232 The statistics collected for matched processes are:
7233  - size of the resident segment size (RSS)
7234  - user- and system-time used
7235  - number of processes
7236  - number of threads
7237  - number of open files (under Linux)
7238  - number of memory mapped files (under Linux)
7239  - io data (where available)
7240  - context switches (under Linux)
7241  - minor and major pagefaults
7242  - Delay Accounting information (Linux only, requires libmnl)
7243
7244 B<Synopsis:>
7245
7246  <Plugin processes>
7247    CollectFileDescriptor  true
7248    CollectContextSwitch   true
7249    CollectDelayAccounting false
7250    Process "name"
7251    ProcessMatch "name" "regex"
7252    <Process "collectd">
7253      CollectFileDescriptor  false
7254      CollectContextSwitch   false
7255      CollectDelayAccounting true
7256    </Process>
7257    <ProcessMatch "name" "regex">
7258      CollectFileDescriptor false
7259      CollectContextSwitch true
7260    </ProcessMatch>
7261  </Plugin>
7262
7263 =over 4
7264
7265 =item B<Process> I<Name>
7266
7267 Select more detailed statistics of processes matching this name.
7268
7269 Some platforms have a limit on the length of process names.
7270 I<Name> must stay below this limit.
7271
7272 =item B<ProcessMatch> I<name> I<regex>
7273
7274 Select more detailed statistics of processes matching the specified I<regex>
7275 (see L<regex(7)> for details). The statistics of all matching processes are
7276 summed up and dispatched to the daemon using the specified I<name> as an
7277 identifier. This allows one to "group" several processes together.
7278 I<name> must not contain slashes.
7279
7280 =item B<CollectContextSwitch> I<Boolean>
7281
7282 Collect the number of context switches for matched processes.
7283 Disabled by default.
7284
7285 =item B<CollectDelayAccounting> I<Boolean>
7286
7287 If enabled, collect Linux Delay Accounding information for matching processes.
7288 Delay Accounting provides the time processes wait for the CPU to become
7289 available, for I/O operations to finish, for pages to be swapped in and for
7290 freed pages to be reclaimed. The metrics are reported as "seconds per second"
7291 using the C<delay_rate> type, e.g. C<delay_rate-delay-cpu>.
7292 Disabled by default.
7293
7294 This option is only available on Linux, requires the C<libmnl> library and
7295 requires the C<CAP_NET_ADMIN> capability at runtime.
7296
7297 =item B<CollectFileDescriptor> I<Boolean>
7298
7299 Collect number of file descriptors of matched processes.
7300 Disabled by default.
7301
7302 =item B<CollectMemoryMaps> I<Boolean>
7303
7304 Collect the number of memory mapped files of the process.
7305 The limit for this number is configured via F</proc/sys/vm/max_map_count> in
7306 the Linux kernel.
7307
7308 =back
7309
7310 The B<CollectContextSwitch>, B<CollectDelayAccounting>,
7311 B<CollectFileDescriptor> and B<CollectMemoryMaps> options may be used inside
7312 B<Process> and B<ProcessMatch> blocks. When used there, these options affect
7313 reporting the corresponding processes only. Outside of B<Process> and
7314 B<ProcessMatch> blocks these options set the default value for subsequent
7315 matches.
7316
7317 =head2 Plugin C<protocols>
7318
7319 Collects a lot of information about various network protocols, such as I<IP>,
7320 I<TCP>, I<UDP>, etc.
7321
7322 Available configuration options:
7323
7324 =over 4
7325
7326 =item B<Value> I<Selector>
7327
7328 Selects whether or not to select a specific value. The string being matched is
7329 of the form "I<Protocol>:I<ValueName>", where I<Protocol> will be used as the
7330 plugin instance and I<ValueName> will be used as type instance. An example of
7331 the string being used would be C<Tcp:RetransSegs>.
7332
7333 You can use regular expressions to match a large number of values with just one
7334 configuration option. To select all "extended" I<TCP> values, you could use the
7335 following statement:
7336
7337   Value "/^TcpExt:/"
7338
7339 Whether only matched values are selected or all matched values are ignored
7340 depends on the B<IgnoreSelected>. By default, only matched values are selected.
7341 If no value is configured at all, all values will be selected.
7342
7343 See F</"IGNORELISTS"> for details.
7344
7345 =item B<IgnoreSelected> B<true>|B<false>
7346
7347 If set to B<true>, inverts the selection made by B<Value>, i.E<nbsp>e. all
7348 matching values will be ignored.
7349
7350 =back
7351
7352 =head2 Plugin C<python>
7353
7354 This plugin embeds a Python-interpreter into collectd and provides an interface
7355 to collectd's plugin system. See L<collectd-python(5)> for its documentation.
7356
7357 =head2 Plugin C<routeros>
7358
7359 The C<routeros> plugin connects to a device running I<RouterOS>, the
7360 Linux-based operating system for routers by I<MikroTik>. The plugin uses
7361 I<librouteros> to connect and reads information about the interfaces and
7362 wireless connections of the device. The configuration supports querying
7363 multiple routers:
7364
7365   <Plugin "routeros">
7366     <Router>
7367       Host "router0.example.com"
7368       User "collectd"
7369       Password "secr3t"
7370       CollectInterface true
7371       CollectCPULoad true
7372       CollectMemory true
7373     </Router>
7374     <Router>
7375       Host "router1.example.com"
7376       User "collectd"
7377       Password "5ecret"
7378       CollectInterface true
7379       CollectRegistrationTable true
7380       CollectDF true
7381       CollectDisk true
7382       CollectHealth true
7383     </Router>
7384   </Plugin>
7385
7386 As you can see above, the configuration of the I<routeros> plugin consists of
7387 one or more B<E<lt>RouterE<gt>> blocks. Within each block, the following
7388 options are understood:
7389
7390 =over 4
7391
7392 =item B<Host> I<Host>
7393
7394 Hostname or IP-address of the router to connect to.
7395
7396 =item B<Port> I<Port>
7397
7398 Port name or port number used when connecting. If left unspecified, the default
7399 will be chosen by I<librouteros>, currently "8728". This option expects a
7400 string argument, even when a numeric port number is given.
7401
7402 =item B<User> I<User>
7403
7404 Use the user name I<User> to authenticate. Defaults to "admin".
7405
7406 =item B<Password> I<Password>
7407
7408 Set the password used to authenticate.
7409
7410 =item B<CollectInterface> B<true>|B<false>
7411
7412 When set to B<true>, interface statistics will be collected for all interfaces
7413 present on the device. Defaults to B<false>.
7414
7415 =item B<CollectRegistrationTable> B<true>|B<false>
7416
7417 When set to B<true>, information about wireless LAN connections will be
7418 collected. Defaults to B<false>.
7419
7420 =item B<CollectCPULoad> B<true>|B<false>
7421
7422 When set to B<true>, information about the CPU usage will be collected. The
7423 number is a dimensionless value where zero indicates no CPU usage at all.
7424 Defaults to B<false>.
7425
7426 =item B<CollectMemory> B<true>|B<false>
7427
7428 When enabled, the amount of used and free memory will be collected. How used
7429 memory is calculated is unknown, for example whether or not caches are counted
7430 as used space.
7431 Defaults to B<false>.
7432
7433 =item B<CollectDF> B<true>|B<false>
7434
7435 When enabled, the amount of used and free disk space will be collected.
7436 Defaults to B<false>.
7437
7438 =item B<CollectDisk> B<true>|B<false>
7439
7440 When enabled, the number of sectors written and bad blocks will be collected.
7441 Defaults to B<false>.
7442
7443 =item B<CollectHealth> B<true>|B<false>
7444
7445 When enabled, the health statistics will be collected. This includes the
7446 voltage and temperature on supported hardware.
7447 Defaults to B<false>.
7448
7449 =back
7450
7451 =head2 Plugin C<redis>
7452
7453 The I<Redis plugin> connects to one or more Redis servers, gathers
7454 information about each server's state and executes user-defined queries.
7455 For each server there is a I<Node> block which configures the connection
7456 parameters and set of user-defined queries for this node.
7457
7458   <Plugin redis>
7459     <Node "example">
7460         Host "localhost"
7461         Port "6379"
7462         #Socket "/var/run/redis/redis.sock"
7463         Timeout 2000
7464         ReportCommandStats false
7465         ReportCpuUsage true
7466         <Query "LLEN myqueue">
7467           #Database 0
7468           Type "queue_length"
7469           Instance "myqueue"
7470         </Query>
7471     </Node>
7472   </Plugin>
7473
7474 =over 4
7475
7476 =item B<Node> I<Nodename>
7477
7478 The B<Node> block identifies a new Redis node, that is a new Redis instance
7479 running in an specified host and port. The name for node is a canonical
7480 identifier which is used as I<plugin instance>. It is limited to
7481 128E<nbsp>characters in length.
7482
7483 When no B<Node> is configured explicitly, plugin connects to "localhost:6379".
7484
7485 =item B<Host> I<Hostname>
7486
7487 The B<Host> option is the hostname or IP-address where the Redis instance is
7488 running on.
7489
7490 =item B<Port> I<Port>
7491
7492 The B<Port> option is the TCP port on which the Redis instance accepts
7493 connections. Either a service name of a port number may be given. Please note
7494 that numerical port numbers must be given as a string, too.
7495
7496 =item B<Socket> I<Path>
7497
7498 Connect to Redis using the UNIX domain socket at I<Path>. If this
7499 setting is given, the B<Hostname> and B<Port> settings are ignored.
7500
7501 =item B<Password> I<Password>
7502
7503 Use I<Password> to authenticate when connecting to I<Redis>.
7504
7505 =item B<Timeout> I<Milliseconds>
7506
7507 The B<Timeout> option set the socket timeout for node response. Since the Redis
7508 read function is blocking, you should keep this value as low as possible.
7509 It is expected what B<Timeout> values should be lower than B<Interval> defined
7510 globally.
7511
7512 Defaults to 2000 (2 seconds).
7513
7514 =item B<ReportCommandStats> B<false>|B<true>
7515
7516 Enables or disables reporting of statistics based on the command type, including
7517 rate of command calls and average CPU time consumed by command processing.
7518 Defaults to B<false>.
7519
7520 =item B<ReportCpuUsage> B<true>|B<false>
7521
7522 Enables or disables reporting of CPU consumption statistics.
7523 Defaults to B<true>.
7524
7525 =item B<Query> I<Querystring>
7526
7527 The B<Query> block identifies a query to execute against the redis server.
7528 There may be an arbitrary number of queries to execute. Each query should
7529 return single string or integer.
7530
7531 =item B<Type> I<Collectd type>
7532
7533 Within a query definition, a valid I<collectd type> to use as when submitting
7534 the result of the query. When not supplied, will default to B<gauge>.
7535
7536 Currently only types with one datasource are supported.
7537 See L<types.db(5)> for more details on types and their configuration.
7538
7539 =item B<Instance> I<Type instance>
7540
7541 Within a query definition, an optional type instance to use when submitting
7542 the result of the query. When not supplied will default to the escaped
7543 command, up to 128 chars.
7544
7545 =item B<Database> I<Index>
7546
7547 This index selects the Redis logical database to use for query. Defaults
7548 to C<0>.
7549
7550 =back
7551
7552 =head2 Plugin C<rrdcached>
7553
7554 The C<rrdcached> plugin uses the RRDtool accelerator daemon, L<rrdcached(1)>,
7555 to store values to RRD files in an efficient manner. The combination of the
7556 C<rrdcached> B<plugin> and the C<rrdcached> B<daemon> is very similar to the
7557 way the C<rrdtool> plugin works (see below). The added abstraction layer
7558 provides a number of benefits, though: Because the cache is not within
7559 C<collectd> anymore, it does not need to be flushed when C<collectd> is to be
7560 restarted. This results in much shorter (if any) gaps in graphs, especially
7561 under heavy load. Also, the C<rrdtool> command line utility is aware of the
7562 daemon so that it can flush values to disk automatically when needed. This
7563 allows one to integrate automated flushing of values into graphing solutions
7564 much more easily.
7565
7566 There are disadvantages, though: The daemon may reside on a different host, so
7567 it may not be possible for C<collectd> to create the appropriate RRD files
7568 anymore. And even if C<rrdcached> runs on the same host, it may run in a
7569 different base directory, so relative paths may do weird stuff if you're not
7570 careful.
7571
7572 So the B<recommended configuration> is to let C<collectd> and C<rrdcached> run
7573 on the same host, communicating via a UNIX domain socket. The B<DataDir>
7574 setting should be set to an absolute path, so that a changed base directory
7575 does not result in RRD files being createdE<nbsp>/ expected in the wrong place.
7576
7577 =over 4
7578
7579 =item B<DaemonAddress> I<Address>
7580
7581 Address of the daemon as understood by the C<rrdc_connect> function of the RRD
7582 library. See L<rrdcached(1)> for details. Example:
7583
7584   <Plugin "rrdcached">
7585     DaemonAddress "unix:/var/run/rrdcached.sock"
7586   </Plugin>
7587
7588 =item B<DataDir> I<Directory>
7589
7590 Set the base directory in which the RRD files reside. If this is a relative
7591 path, it is relative to the working base directory of the C<rrdcached> daemon!
7592 Use of an absolute path is recommended.
7593
7594 =item B<CreateFiles> B<true>|B<false>
7595
7596 Enables or disables the creation of RRD files. If the daemon is not running
7597 locally, or B<DataDir> is set to a relative path, this will not work as
7598 expected. Default is B<true>.
7599
7600 =item B<CreateFilesAsync> B<false>|B<true>
7601
7602 When enabled, new RRD files are enabled asynchronously, using a separate thread
7603 that runs in the background. This prevents writes to block, which is a problem
7604 especially when many hundreds of files need to be created at once. However,
7605 since the purpose of creating the files asynchronously is I<not> to block until
7606 the file is available, values before the file is available will be discarded.
7607 When disabled (the default) files are created synchronously, blocking for a
7608 short while, while the file is being written.
7609
7610 =item B<StepSize> I<Seconds>
7611
7612 B<Force> the stepsize of newly created RRD-files. Ideally (and per default)
7613 this setting is unset and the stepsize is set to the interval in which the data
7614 is collected. Do not use this option unless you absolutely have to for some
7615 reason. Setting this option may cause problems with the C<snmp plugin>, the
7616 C<exec plugin> or when the daemon is set up to receive data from other hosts.
7617
7618 =item B<HeartBeat> I<Seconds>
7619
7620 B<Force> the heartbeat of newly created RRD-files. This setting should be unset
7621 in which case the heartbeat is set to twice the B<StepSize> which should equal
7622 the interval in which data is collected. Do not set this option unless you have
7623 a very good reason to do so.
7624
7625 =item B<RRARows> I<NumRows>
7626
7627 The C<rrdtool plugin> calculates the number of PDPs per CDP based on the
7628 B<StepSize>, this setting and a timespan. This plugin creates RRD-files with
7629 three times five RRAs, i. e. five RRAs with the CFs B<MIN>, B<AVERAGE>, and
7630 B<MAX>. The five RRAs are optimized for graphs covering one hour, one day, one
7631 week, one month, and one year.
7632
7633 So for each timespan, it calculates how many PDPs need to be consolidated into
7634 one CDP by calculating:
7635   number of PDPs = timespan / (stepsize * rrarows)
7636
7637 Bottom line is, set this no smaller than the width of you graphs in pixels. The
7638 default is 1200.
7639
7640 =item B<RRATimespan> I<Seconds>
7641
7642 Adds an RRA-timespan, given in seconds. Use this option multiple times to have
7643 more then one RRA. If this option is never used, the built-in default of (3600,
7644 86400, 604800, 2678400, 31622400) is used.
7645
7646 For more information on how RRA-sizes are calculated see B<RRARows> above.
7647
7648 =item B<XFF> I<Factor>
7649
7650 Set the "XFiles Factor". The default is 0.1. If unsure, don't set this option.
7651 I<Factor> must be in the range C<[0.0-1.0)>, i.e. between zero (inclusive) and
7652 one (exclusive).
7653
7654 =item B<CollectStatistics> B<false>|B<true>
7655
7656 When set to B<true>, various statistics about the I<rrdcached> daemon will be
7657 collected, with "rrdcached" as the I<plugin name>. Defaults to B<false>.
7658
7659 Statistics are read via I<rrdcached>s socket using the STATS command.
7660 See L<rrdcached(1)> for details.
7661
7662 =back
7663
7664 =head2 Plugin C<rrdtool>
7665
7666 You can use the settings B<StepSize>, B<HeartBeat>, B<RRARows>, and B<XFF> to
7667 fine-tune your RRD-files. Please read L<rrdcreate(1)> if you encounter problems
7668 using these settings. If you don't want to dive into the depths of RRDtool, you
7669 can safely ignore these settings.
7670
7671 =over 4
7672
7673 =item B<DataDir> I<Directory>
7674
7675 Set the directory to store RRD files under. By default RRD files are generated
7676 beneath the daemon's working directory, i.e. the B<BaseDir>.
7677
7678 =item B<CreateFilesAsync> B<false>|B<true>
7679
7680 When enabled, new RRD files are enabled asynchronously, using a separate thread
7681 that runs in the background. This prevents writes to block, which is a problem
7682 especially when many hundreds of files need to be created at once. However,
7683 since the purpose of creating the files asynchronously is I<not> to block until
7684 the file is available, values before the file is available will be discarded.
7685 When disabled (the default) files are created synchronously, blocking for a
7686 short while, while the file is being written.
7687
7688 =item B<StepSize> I<Seconds>
7689
7690 B<Force> the stepsize of newly created RRD-files. Ideally (and per default)
7691 this setting is unset and the stepsize is set to the interval in which the data
7692 is collected. Do not use this option unless you absolutely have to for some
7693 reason. Setting this option may cause problems with the C<snmp plugin>, the
7694 C<exec plugin> or when the daemon is set up to receive data from other hosts.
7695
7696 =item B<HeartBeat> I<Seconds>
7697
7698 B<Force> the heartbeat of newly created RRD-files. This setting should be unset
7699 in which case the heartbeat is set to twice the B<StepSize> which should equal
7700 the interval in which data is collected. Do not set this option unless you have
7701 a very good reason to do so.
7702
7703 =item B<RRARows> I<NumRows>
7704
7705 The C<rrdtool plugin> calculates the number of PDPs per CDP based on the
7706 B<StepSize>, this setting and a timespan. This plugin creates RRD-files with
7707 three times five RRAs, i.e. five RRAs with the CFs B<MIN>, B<AVERAGE>, and
7708 B<MAX>. The five RRAs are optimized for graphs covering one hour, one day, one
7709 week, one month, and one year.
7710
7711 So for each timespan, it calculates how many PDPs need to be consolidated into
7712 one CDP by calculating:
7713   number of PDPs = timespan / (stepsize * rrarows)
7714
7715 Bottom line is, set this no smaller than the width of you graphs in pixels. The
7716 default is 1200.
7717
7718 =item B<RRATimespan> I<Seconds>
7719
7720 Adds an RRA-timespan, given in seconds. Use this option multiple times to have
7721 more then one RRA. If this option is never used, the built-in default of (3600,
7722 86400, 604800, 2678400, 31622400) is used.
7723
7724 For more information on how RRA-sizes are calculated see B<RRARows> above.
7725
7726 =item B<XFF> I<Factor>
7727
7728 Set the "XFiles Factor". The default is 0.1. If unsure, don't set this option.
7729 I<Factor> must be in the range C<[0.0-1.0)>, i.e. between zero (inclusive) and
7730 one (exclusive).
7731
7732 =item B<CacheFlush> I<Seconds>
7733
7734 When the C<rrdtool> plugin uses a cache (by setting B<CacheTimeout>, see below)
7735 it writes all values for a certain RRD-file if the oldest value is older than
7736 (or equal to) the number of seconds specified by B<CacheTimeout>.
7737 That check happens on new values arriwal. If some RRD-file is not updated
7738 anymore for some reason (the computer was shut down, the network is broken,
7739 etc.) some values may still be in the cache. If B<CacheFlush> is set, then
7740 every I<Seconds> seconds the entire cache is searched for entries older than
7741 B<CacheTimeout> + B<RandomTimeout> seconds. The entries found are written to
7742 disk. Since scanning the entire cache is kind of expensive and does nothing
7743 under normal circumstances, this value should not be too small. 900 seconds
7744 might be a good value, though setting this to 7200 seconds doesn't normally
7745 do much harm either.
7746
7747 Defaults to 10x B<CacheTimeout>.
7748 B<CacheFlush> must be larger than or equal to B<CacheTimeout>, otherwise the
7749 above default is used.
7750
7751 =item B<CacheTimeout> I<Seconds>
7752
7753 If this option is set to a value greater than zero, the C<rrdtool plugin> will
7754 save values in a cache, as described above. Writing multiple values at once
7755 reduces IO-operations and thus lessens the load produced by updating the files.
7756 The trade off is that the graphs kind of "drag behind" and that more memory is
7757 used.
7758
7759 =item B<WritesPerSecond> I<Updates>
7760
7761 When collecting many statistics with collectd and the C<rrdtool> plugin, you
7762 will run serious performance problems. The B<CacheFlush> setting and the
7763 internal update queue assert that collectd continues to work just fine even
7764 under heavy load, but the system may become very unresponsive and slow. This is
7765 a problem especially if you create graphs from the RRD files on the same
7766 machine, for example using the C<graph.cgi> script included in the
7767 C<contrib/collection3/> directory.
7768
7769 This setting is designed for very large setups. Setting this option to a value
7770 between 25 and 80 updates per second, depending on your hardware, will leave
7771 the server responsive enough to draw graphs even while all the cached values
7772 are written to disk. Flushed values, i.E<nbsp>e. values that are forced to disk
7773 by the B<FLUSH> command, are B<not> effected by this limit. They are still
7774 written as fast as possible, so that web frontends have up to date data when
7775 generating graphs.
7776
7777 For example: If you have 100,000 RRD files and set B<WritesPerSecond> to 30
7778 updates per second, writing all values to disk will take approximately
7779 56E<nbsp>minutes. Together with the flushing ability that's integrated into
7780 "collection3" you'll end up with a responsive and fast system, up to date
7781 graphs and basically a "backup" of your values every hour.
7782
7783 =item B<RandomTimeout> I<Seconds>
7784
7785 When set, the actual timeout for each value is chosen randomly between
7786 I<CacheTimeout>-I<RandomTimeout> and I<CacheTimeout>+I<RandomTimeout>. The
7787 intention is to avoid high load situations that appear when many values timeout
7788 at the same time. This is especially a problem shortly after the daemon starts,
7789 because all values were added to the internal cache at roughly the same time.
7790
7791 =back
7792
7793 =head2 Plugin C<sensors>
7794
7795 The I<Sensors plugin> uses B<lm_sensors> to retrieve sensor-values. This means
7796 that all the needed modules have to be loaded and lm_sensors has to be
7797 configured (most likely by editing F</etc/sensors.conf>. Read
7798 L<sensors.conf(5)> for details.
7799
7800 The B<lm_sensors> homepage can be found at
7801 L<http://secure.netroedge.com/~lm78/>.
7802
7803 =over 4
7804
7805 =item B<SensorConfigFile> I<File>
7806
7807 Read the I<lm_sensors> configuration from I<File>. When unset (recommended),
7808 the library's default will be used.
7809
7810 =item B<Sensor> I<chip-bus-address/type-feature>
7811
7812 Selects the name of the sensor which you want to collect or ignore, depending
7813 on the B<IgnoreSelected> below. For example, the option "B<Sensor>
7814 I<it8712-isa-0290/voltage-in1>" will cause collectd to gather data for the
7815 voltage sensor I<in1> of the I<it8712> on the isa bus at the address 0290.
7816
7817 See F</"IGNORELISTS"> for details.
7818
7819 =item B<IgnoreSelected> I<true>|I<false>
7820
7821 If no configuration if given, the B<sensors>-plugin will collect data from all
7822 sensors. This may not be practical, especially for uninteresting sensors.
7823 Thus, you can use the B<Sensor>-option to pick the sensors you're interested
7824 in. Sometimes, however, it's easier/preferred to collect all sensors I<except> a
7825 few ones. This option enables you to do that: By setting B<IgnoreSelected> to
7826 I<true> the effect of B<Sensor> is inverted: All selected sensors are ignored
7827 and all other sensors are collected.
7828
7829 =item B<UseLabels> I<true>|I<false>
7830
7831 Configures how sensor readings are reported. When set to I<true>, sensor
7832 readings are reported using their descriptive label (e.g. "VCore"). When set to
7833 I<false> (the default) the sensor name is used ("in0").
7834
7835 =back
7836
7837 =head2 Plugin C<sigrok>
7838
7839 The I<sigrok plugin> uses I<libsigrok> to retrieve measurements from any device
7840 supported by the L<sigrok|http://sigrok.org/> project.
7841
7842 B<Synopsis>
7843
7844  <Plugin sigrok>
7845    LogLevel 3
7846    <Device "AC Voltage">
7847       Driver "fluke-dmm"
7848       MinimumInterval 10
7849       Conn "/dev/ttyUSB2"
7850    </Device>
7851    <Device "Sound Level">
7852       Driver "cem-dt-885x"
7853       Conn "/dev/ttyUSB1"
7854    </Device>
7855  </Plugin>
7856
7857 =over 4
7858
7859 =item B<LogLevel> B<0-5>
7860
7861 The I<sigrok> logging level to pass on to the I<collectd> log, as a number
7862 between B<0> and B<5> (inclusive). These levels correspond to C<None>,
7863 C<Errors>, C<Warnings>, C<Informational>, C<Debug >and C<Spew>, respectively.
7864 The default is B<2> (C<Warnings>). The I<sigrok> log messages, regardless of
7865 their level, are always submitted to I<collectd> at its INFO log level.
7866
7867 =item E<lt>B<Device> I<Name>E<gt>
7868
7869 A sigrok-supported device, uniquely identified by this section's options. The
7870 I<Name> is passed to I<collectd> as the I<plugin instance>.
7871
7872 =item B<Driver> I<DriverName>
7873
7874 The sigrok driver to use for this device.
7875
7876 =item B<Conn> I<ConnectionSpec>
7877
7878 If the device cannot be auto-discovered, or more than one might be discovered
7879 by the driver, I<ConnectionSpec> specifies the connection string to the device.
7880 It can be of the form of a device path (e.g.E<nbsp>C</dev/ttyUSB2>), or, in
7881 case of a non-serial USB-connected device, the USB I<VendorID>B<.>I<ProductID>
7882 separated by a period (e.g.E<nbsp>C<0403.6001>). A USB device can also be
7883 specified as I<Bus>B<.>I<Address> (e.g.E<nbsp>C<1.41>).
7884
7885 =item B<SerialComm> I<SerialSpec>
7886
7887 For serial devices with non-standard port settings, this option can be used
7888 to specify them in a form understood by I<sigrok>, e.g.E<nbsp>C<9600/8n1>.
7889 This should not be necessary; drivers know how to communicate with devices they
7890 support.
7891
7892 =item B<MinimumInterval> I<Seconds>
7893
7894 Specifies the minimum time between measurement dispatches to I<collectd>, in
7895 seconds. Since some I<sigrok> supported devices can acquire measurements many
7896 times per second, it may be necessary to throttle these. For example, the
7897 I<RRD plugin> cannot process writes more than once per second.
7898
7899 The default B<MinimumInterval> is B<0>, meaning measurements received from the
7900 device are always dispatched to I<collectd>. When throttled, unused
7901 measurements are discarded.
7902
7903 =back
7904
7905 =head2 Plugin C<smart>
7906
7907 The C<smart> plugin collects SMART information from physical
7908 disks. Values collectd include temperature, power cycle count, poweron
7909 time and bad sectors. Also, all SMART attributes are collected along
7910 with the normalized current value, the worst value, the threshold and
7911 a human readable value.
7912
7913 Using the following two options you can ignore some disks or configure the
7914 collection only of specific disks.
7915
7916 =over 4
7917
7918 =item B<Disk> I<Name>
7919
7920 Select the disk I<Name>. Whether it is collected or ignored depends on the
7921 B<IgnoreSelected> setting, see below. As with other plugins that use the
7922 daemon's ignorelist functionality, a string that starts and ends with a slash
7923 is interpreted as a regular expression. Examples:
7924
7925   Disk "sdd"
7926   Disk "/hda[34]/"
7927
7928 See F</"IGNORELISTS"> for details.
7929
7930 =item B<IgnoreSelected> B<true>|B<false>
7931
7932 Sets whether selected disks, i.E<nbsp>e. the ones matches by any of the B<Disk>
7933 statements, are ignored or if all other disks are ignored. The behavior
7934 (hopefully) is intuitive: If no B<Disk> option is configured, all disks are
7935 collected. If at least one B<Disk> option is given and no B<IgnoreSelected> or
7936 set to B<false>, B<only> matching disks will be collected. If B<IgnoreSelected>
7937 is set to B<true>, all disks are collected B<except> the ones matched.
7938
7939 =item B<IgnoreSleepMode> B<true>|B<false>
7940
7941 Normally, the C<smart> plugin will ignore disks that are reported to be asleep.
7942 This option disables the sleep mode check and allows the plugin to collect data
7943 from these disks anyway. This is useful in cases where libatasmart mistakenly
7944 reports disks as asleep because it has not been updated to incorporate support
7945 for newer idle states in the ATA spec.
7946
7947 =item B<UseSerial> B<true>|B<false>
7948
7949 A disk's kernel name (e.g., sda) can change from one boot to the next. If this
7950 option is enabled, the C<smart> plugin will use the disk's serial number (e.g.,
7951 HGST_HUH728080ALE600_2EJ8VH8X) instead of the kernel name as the key for
7952 storing data. This ensures that the data for a given disk will be kept together
7953 even if the kernel name changes.
7954
7955 =back
7956
7957 =head2 Plugin C<snmp>
7958
7959 Since the configuration of the C<snmp plugin> is a little more complicated than
7960 other plugins, its documentation has been moved to an own manpage,
7961 L<collectd-snmp(5)>. Please see there for details.
7962
7963 =head2 Plugin C<snmp_agent>
7964
7965 The I<snmp_agent> plugin is an AgentX subagent that receives and handles queries
7966 from SNMP master agent and returns the data collected by read plugins.
7967 The I<snmp_agent> plugin handles requests only for OIDs specified in
7968 configuration file. To handle SNMP queries the plugin gets data from collectd
7969 and translates requested values from collectd's internal format to SNMP format.
7970 This plugin is a generic plugin and cannot work without configuration.
7971 For more details on AgentX subagent see
7972 <http://www.net-snmp.org/tutorial/tutorial-5/toolkit/demon/>
7973
7974 B<Synopsis:>
7975
7976   <Plugin snmp_agent>
7977     <Data "memAvailReal">
7978       Plugin "memory"
7979       #PluginInstance "some"
7980       Type "memory"
7981       TypeInstance "free"
7982       OIDs "1.3.6.1.4.1.2021.4.6.0"
7983     </Data>
7984     <Table "ifTable">
7985       IndexOID "IF-MIB::ifIndex"
7986       SizeOID "IF-MIB::ifNumber"
7987       <Data "ifDescr">
7988         <IndexKey>
7989           Source "PluginInstance"
7990         </IndexKey>
7991         Plugin "interface"
7992         OIDs "IF-MIB::ifDescr"
7993       </Data>
7994       <Data "ifOctets">
7995         Plugin "interface"
7996         Type "if_octets"
7997         TypeInstance ""
7998         OIDs "IF-MIB::ifInOctets" "IF-MIB::ifOutOctets"
7999       </Data>
8000     </Table>
8001     <Table "CPUAffinityTable">
8002       <Data "DomainName">
8003         <IndexKey>
8004           Source "PluginInstance"
8005         </IndexKey>
8006         Plugin "virt"
8007         OIDs "LIBVIRT-HYPERVISOR-MIB::lvhAffinityDomainName"
8008       </Data>
8009       <Data "VCPU">
8010         Plugin "virt"
8011         <IndexKey>
8012           Source "TypeInstance"
8013           Regex "^vcpu_([0-9]{1,3})-cpu_[0-9]{1,3}$"
8014           Group 1
8015         </IndexKey>
8016         OIDs "LIBVIRT-HYPERVISOR-MIB::lvhVCPUIndex"
8017       </Data>
8018       <Data "CPU">
8019         Plugin "virt"
8020         <IndexKey>
8021           Source "TypeInstance"
8022           Regex "^vcpu_[0-9]{1,3}-cpu_([0-9]{1,3})$"
8023           Group 1
8024         </IndexKey>
8025         OIDs "LIBVIRT-HYPERVISOR-MIB::lvhCPUIndex"
8026       </Data>
8027       <Data "CPUAffinity">
8028         Plugin "virt"
8029         Type "cpu_affinity"
8030         OIDs "LIBVIRT-HYPERVISOR-MIB::lvhCPUAffinity"
8031       </Data>
8032     </Table>
8033   </Plugin>
8034
8035 There are two types of blocks that can be contained in the
8036 C<E<lt>PluginE<nbsp> snmp_agentE<gt>> block: B<Data> and B<Table>:
8037
8038 =head3 B<Data> block
8039
8040 The B<Data> block defines a list OIDs that are to be handled. This block can
8041 define scalar or table OIDs. If B<Data> block is defined inside of B<Table>
8042 block it reperesents table OIDs.
8043 The following options can be set:
8044
8045 =over 4
8046
8047 =item B<IndexKey> block
8048
8049 B<IndexKey> block contains all data needed for proper index build of snmp table.
8050 In case more than
8051 one table B<Data> block has B<IndexKey> block present then multiple key index is
8052 built. If B<Data> block defines scalar data type B<IndexKey> has no effect and can
8053 be omitted.
8054
8055 =over 8
8056
8057 =item B<Source> I<String>
8058
8059 B<Source> can be set to one of the following values: "Hostname", "Plugin",
8060 "PluginInstance", "Type", "TypeInstance". This value indicates which field of
8061 corresponding collectd metric is taken as a SNMP table index.
8062
8063 =item B<Regex> I<String>
8064
8065 B<Regex> option can also be used to parse strings or numbers out of
8066 specific field. For example: type-instance field which is "vcpu1-cpu2" can be
8067 parsed into two numeric fields CPU = 2 and VCPU = 1 and can be later used
8068 as a table index.
8069
8070 =item B<Group> I<Number>
8071
8072 B<Group> number can be specified in case groups are used in regex.
8073
8074 =back
8075
8076 =item B<Plugin> I<String>
8077
8078 Read plugin name whose collected data will be mapped to specified OIDs.
8079
8080 =item B<PluginInstance> I<String>
8081
8082 Read plugin instance whose collected data will be mapped to specified OIDs.
8083 The field is optional and by default there is no plugin instance check.
8084 Allowed only if B<Data> block defines scalar data type.
8085
8086 =item B<Type> I<String>
8087
8088 Collectd's type that is to be used for specified OID, e.E<nbsp>g. "if_octets"
8089 for example. The types are read from the B<TypesDB> (see L<collectd.conf(5)>).
8090
8091 =item B<TypeInstance> I<String>
8092
8093 Collectd's type-instance that is to be used for specified OID.
8094
8095 =item B<OIDs> I<OID> [I<OID> ...]
8096
8097 Configures the OIDs to be handled by I<snmp_agent> plugin. Values for these OIDs
8098 are taken from collectd data type specified by B<Plugin>, B<PluginInstance>,
8099 B<Type>, B<TypeInstance> fields of this B<Data> block. Number of the OIDs
8100 configured should correspond to number of values in specified B<Type>.
8101 For example two OIDs "IF-MIB::ifInOctets" "IF-MIB::ifOutOctets" can be mapped to
8102 "rx" and "tx" values of "if_octets" type.
8103
8104 =item B<Scale> I<Value>
8105
8106 The values taken from collectd are multiplied by I<Value>. The field is optional
8107 and the default is B<1.0>.
8108
8109 =item B<Shift> I<Value>
8110
8111 I<Value> is added to values from collectd after they have been multiplied by
8112 B<Scale> value. The field is optional and the default value is B<0.0>.
8113
8114 =back
8115
8116 =head3 The B<Table> block
8117
8118 The B<Table> block defines a collection of B<Data> blocks that belong to one
8119 snmp table. In addition to multiple B<Data> blocks the following options can be
8120 set:
8121
8122 =over 4
8123
8124 =item B<IndexOID> I<OID>
8125
8126 OID that is handled by the plugin and is mapped to numerical index value that is
8127 generated by the plugin for each table record.
8128
8129 =item B<SizeOID> I<OID>
8130
8131 OID that is handled by the plugin. Returned value is the number of records in
8132 the table. The field is optional.
8133
8134 =back
8135
8136 =head2 Plugin C<statsd>
8137
8138 The I<statsd plugin> listens to a UDP socket, reads "events" in the statsd
8139 protocol and dispatches rates or other aggregates of these numbers
8140 periodically.
8141
8142 The plugin implements the I<Counter>, I<Timer>, I<Gauge> and I<Set> types which
8143 are dispatched as the I<collectd> types C<derive>, C<latency>, C<gauge> and
8144 C<objects> respectively.
8145
8146 The following configuration options are valid:
8147
8148 =over 4
8149
8150 =item B<Host> I<Host>
8151
8152 Bind to the hostname / address I<Host>. By default, the plugin will bind to the
8153 "any" address, i.e. accept packets sent to any of the hosts addresses.
8154
8155 =item B<Port> I<Port>
8156
8157 UDP port to listen to. This can be either a service name or a port number.
8158 Defaults to C<8125>.
8159
8160 =item B<DeleteCounters> B<false>|B<true>
8161
8162 =item B<DeleteTimers> B<false>|B<true>
8163
8164 =item B<DeleteGauges> B<false>|B<true>
8165
8166 =item B<DeleteSets> B<false>|B<true>
8167
8168 These options control what happens if metrics are not updated in an interval.
8169 If set to B<False>, the default, metrics are dispatched unchanged, i.e. the
8170 rate of counters and size of sets will be zero, timers report C<NaN> and gauges
8171 are unchanged. If set to B<True>, the such metrics are not dispatched and
8172 removed from the internal cache.
8173
8174 =item B<CounterSum> B<false>|B<true>
8175
8176 When enabled, creates a C<count> metric which reports the change since the last
8177 read. This option primarily exists for compatibility with the I<statsd>
8178 implementation by Etsy.
8179
8180 =item B<TimerPercentile> I<Percent>
8181
8182 Calculate and dispatch the configured percentile, i.e. compute the latency, so
8183 that I<Percent> of all reported timers are smaller than or equal to the
8184 computed latency. This is useful for cutting off the long tail latency, as it's
8185 often done in I<Service Level Agreements> (SLAs).
8186
8187 Different percentiles can be calculated by setting this option several times.
8188 If none are specified, no percentiles are calculated / dispatched.
8189
8190 =item B<TimerLower> B<false>|B<true>
8191
8192 =item B<TimerUpper> B<false>|B<true>
8193
8194 =item B<TimerSum> B<false>|B<true>
8195
8196 =item B<TimerCount> B<false>|B<true>
8197
8198 Calculate and dispatch various values out of I<Timer> metrics received during
8199 an interval. If set to B<False>, the default, these values aren't calculated /
8200 dispatched.
8201
8202 Please note what reported timer values less than 0.001 are ignored in all B<Timer*> reports.
8203
8204 =back
8205
8206 =head2 Plugin C<swap>
8207
8208 The I<Swap plugin> collects information about used and available swap space. On
8209 I<Linux> and I<Solaris>, the following options are available:
8210
8211 =over 4
8212
8213 =item B<ReportByDevice> B<false>|B<true>
8214
8215 Configures how to report physical swap devices. If set to B<false> (the
8216 default), the summary over all swap devices is reported only, i.e. the globally
8217 used and available space over all devices. If B<true> is configured, the used
8218 and available space of each device will be reported separately.
8219
8220 This option is only available if the I<Swap plugin> can read C</proc/swaps>
8221 (under Linux) or use the L<swapctl(2)> mechanism (under I<Solaris>).
8222
8223 =item B<ReportBytes> B<false>|B<true>
8224
8225 When enabled, the I<swap I/O> is reported in bytes. When disabled, the default,
8226 I<swap I/O> is reported in pages. This option is available under Linux only.
8227
8228 =item B<ValuesAbsolute> B<true>|B<false>
8229
8230 Enables or disables reporting of absolute swap metrics, i.e. number of I<bytes>
8231 available and used. Defaults to B<true>.
8232
8233 =item B<ValuesPercentage> B<false>|B<true>
8234
8235 Enables or disables reporting of relative swap metrics, i.e. I<percent>
8236 available and free. Defaults to B<false>.
8237
8238 This is useful for deploying I<collectd> in a heterogeneous environment, where
8239 swap sizes differ and you want to specify generic thresholds or similar.
8240
8241 =item B<ReportIO> B<true>|B<false>
8242
8243 Enables or disables reporting swap IO. Defaults to B<true>.
8244
8245 This is useful for the cases when swap IO is not neccessary, is not available,
8246 or is not reliable.
8247
8248 =back
8249
8250 =head2 Plugin C<syslog>
8251
8252 =over 4
8253
8254 =item B<LogLevel> B<debug|info|notice|warning|err>
8255
8256 Sets the log-level. If, for example, set to B<notice>, then all events with
8257 severity B<notice>, B<warning>, or B<err> will be submitted to the
8258 syslog-daemon.
8259
8260 Please note that B<debug> is only available if collectd has been compiled with
8261 debugging support.
8262
8263 =item B<NotifyLevel> B<OKAY>|B<WARNING>|B<FAILURE>
8264
8265 Controls which notifications should be sent to syslog. The default behaviour is
8266 not to send any. Less severe notifications always imply logging more severe
8267 notifications: Setting this to B<OKAY> means all notifications will be sent to
8268 syslog, setting this to B<WARNING> will send B<WARNING> and B<FAILURE>
8269 notifications but will dismiss B<OKAY> notifications. Setting this option to
8270 B<FAILURE> will only send failures to syslog.
8271
8272 =back
8273
8274 =head2 Plugin C<table>
8275
8276 The C<table plugin> provides generic means to parse tabular data and dispatch
8277 user specified values. Values are selected based on column numbers. For
8278 example, this plugin may be used to get values from the Linux L<proc(5)>
8279 filesystem or CSV (comma separated values) files.
8280
8281   <Plugin table>
8282     <Table "/proc/slabinfo">
8283       #Plugin "slab"
8284       Instance "slabinfo"
8285       Separator " "
8286       <Result>
8287         Type gauge
8288         InstancePrefix "active_objs"
8289         InstancesFrom 0
8290         ValuesFrom 1
8291       </Result>
8292       <Result>
8293         Type gauge
8294         InstancePrefix "objperslab"
8295         InstancesFrom 0
8296         ValuesFrom 4
8297       </Result>
8298     </Table>
8299   </Plugin>
8300
8301 The configuration consists of one or more B<Table> blocks, each of which
8302 configures one file to parse. Within each B<Table> block, there are one or
8303 more B<Result> blocks, which configure which data to select and how to
8304 interpret it.
8305
8306 The following options are available inside a B<Table> block:
8307
8308 =over 4
8309
8310 =item B<Plugin> I<Plugin>
8311
8312 If specified, I<Plugin> is used as the plugin name when submitting values.
8313 Defaults to B<table>.
8314
8315 =item B<Instance> I<instance>
8316
8317 If specified, I<instance> is used as the plugin instance. If omitted, the
8318 filename of the table is used instead, with all special characters replaced
8319 with an underscore (C<_>).
8320
8321 =item B<Separator> I<string>
8322
8323 Any character of I<string> is interpreted as a delimiter between the different
8324 columns of the table. A sequence of two or more contiguous delimiters in the
8325 table is considered to be a single delimiter, i.E<nbsp>e. there cannot be any
8326 empty columns. The plugin uses the L<strtok_r(3)> function to parse the lines
8327 of a table - see its documentation for more details. This option is mandatory.
8328
8329 A horizontal tab, newline and carriage return may be specified by C<\\t>,
8330 C<\\n> and C<\\r> respectively. Please note that the double backslashes are
8331 required because of collectd's config parsing.
8332
8333 =back
8334
8335 The following options are available inside a B<Result> block:
8336
8337 =over 4
8338
8339 =item B<Type> I<type>
8340
8341 Sets the type used to dispatch the values to the daemon. Detailed information
8342 about types and their configuration can be found in L<types.db(5)>. This
8343 option is mandatory.
8344
8345 =item B<InstancePrefix> I<prefix>
8346
8347 If specified, prepend I<prefix> to the type instance. If omitted, only the
8348 B<InstancesFrom> option is considered for the type instance.
8349
8350 =item B<InstancesFrom> I<column0> [I<column1> ...]
8351
8352 If specified, the content of the given columns (identified by the column
8353 number starting at zero) will be used to create the type instance for each
8354 row. Multiple values (and the instance prefix) will be joined together with
8355 dashes (I<->) as separation character. If omitted, only the B<InstancePrefix>
8356 option is considered for the type instance.
8357
8358 The plugin itself does not check whether or not all built instances are
8359 different. It’s your responsibility to assure that each is unique. This is
8360 especially true, if you do not specify B<InstancesFrom>: B<You> have to make
8361 sure that the table only contains one row.
8362
8363 If neither B<InstancePrefix> nor B<InstancesFrom> is given, the type instance
8364 will be empty.
8365
8366 =item B<ValuesFrom> I<column0> [I<column1> ...]
8367
8368 Specifies the columns (identified by the column numbers starting at zero)
8369 whose content is used as the actual data for the data sets that are dispatched
8370 to the daemon. How many such columns you need is determined by the B<Type>
8371 setting above. If you specify too many or not enough columns, the plugin will
8372 complain about that and no data will be submitted to the daemon. The plugin
8373 uses L<strtoll(3)> and L<strtod(3)> to parse counter and gauge values
8374 respectively, so anything supported by those functions is supported by the
8375 plugin as well. This option is mandatory.
8376
8377 =back
8378
8379 =head2 Plugin C<tail>
8380
8381 The C<tail plugin> follows logfiles, just like L<tail(1)> does, parses
8382 each line and dispatches found values. What is matched can be configured by the
8383 user using (extended) regular expressions, as described in L<regex(7)>.
8384
8385   <Plugin "tail">
8386     <File "/var/log/exim4/mainlog">
8387       Plugin "mail"
8388       Instance "exim"
8389       Interval 60
8390       <Match>
8391         Regex "S=([1-9][0-9]*)"
8392         DSType "CounterAdd"
8393         Type "ipt_bytes"
8394         Instance "total"
8395       </Match>
8396       <Match>
8397         Regex "\\<R=local_user\\>"
8398         ExcludeRegex "\\<R=local_user\\>.*mail_spool defer"
8399         DSType "CounterInc"
8400         Type "counter"
8401         Instance "local_user"
8402       </Match>
8403       <Match>
8404         Regex "l=([0-9]*\\.[0-9]*)"
8405         <DSType "Distribution">
8406           Percentile 99
8407           Bucket 0 100
8408           #BucketType "bucket"
8409         </DSType>
8410         Type "latency"
8411         Instance "foo"
8412       </Match>
8413     </File>
8414   </Plugin>
8415
8416 The config consists of one or more B<File> blocks, each of which configures one
8417 logfile to parse. Within each B<File> block, there are one or more B<Match>
8418 blocks, which configure a regular expression to search for.
8419
8420 The B<Plugin> and B<Instance> options in the B<File> block may be used to set
8421 the plugin name and instance respectively. So in the above example the plugin name
8422 C<mail-exim> would be used.
8423
8424 These options are applied for all B<Match> blocks that B<follow> it, until the
8425 next B<Plugin> or B<Instance> option. This way you can extract several plugin
8426 instances from one logfile, handy when parsing syslog and the like.
8427
8428 The B<Interval> option allows you to define the length of time between reads. If
8429 this is not set, the default Interval will be used.
8430
8431 Each B<Match> block has the following options to describe how the match should
8432 be performed:
8433
8434 =over 4
8435
8436 =item B<Regex> I<regex>
8437
8438 Sets the regular expression to use for matching against a line. The first
8439 subexpression has to match something that can be turned into a number by
8440 L<strtoll(3)> or L<strtod(3)>, depending on the value of C<CounterAdd>, see
8441 below. Because B<extended> regular expressions are used, you do not need to use
8442 backslashes for subexpressions! If in doubt, please consult L<regex(7)>. Due to
8443 collectd's config parsing you need to escape backslashes, though. So if you
8444 want to match literal parentheses you need to do the following:
8445
8446   Regex "SPAM \\(Score: (-?[0-9]+\\.[0-9]+)\\)"
8447
8448 =item B<ExcludeRegex> I<regex>
8449
8450 Sets an optional regular expression to use for excluding lines from the match.
8451 An example which excludes all connections from localhost from the match:
8452
8453   ExcludeRegex "127\\.0\\.0\\.1"
8454
8455 =item B<DSType> I<Type>
8456
8457 Sets how the values are cumulated. I<Type> is one of:
8458
8459 =over 4
8460
8461 =item B<GaugeAverage>
8462
8463 Calculate the average of all values matched during the interval.
8464
8465 =item B<GaugeMin>
8466
8467 Report the smallest value matched during the interval.
8468
8469 =item B<GaugeMax>
8470
8471 Report the greatest value matched during the interval.
8472
8473 =item B<GaugeLast>
8474
8475 Report the last value matched during the interval.
8476
8477 =item B<GaugePersist>
8478
8479 Report the last matching value. The metric is I<not> reset to C<NaN> at the end
8480 of an interval. It is continuously reported until another value is matched.
8481 This is intended for cases in which only state changes are reported, for
8482 example a thermometer that only reports the temperature when it changes.
8483
8484 =item B<CounterSet>
8485
8486 =item B<DeriveSet>
8487
8488 =item B<AbsoluteSet>
8489
8490 The matched number is a counter. Simply I<sets> the internal counter to this
8491 value. Variants exist for C<COUNTER>, C<DERIVE>, and C<ABSOLUTE> data sources.
8492
8493 =item B<GaugeAdd>
8494
8495 =item B<CounterAdd>
8496
8497 =item B<DeriveAdd>
8498
8499 Add the matched value to the internal counter. In case of B<DeriveAdd>, the
8500 matched number may be negative, which will effectively subtract from the
8501 internal counter.
8502
8503 =item B<GaugeInc>
8504
8505 =item B<CounterInc>
8506
8507 =item B<DeriveInc>
8508
8509 Increase the internal counter by one. These B<DSType> are the only ones that do
8510 not use the matched subexpression, but simply count the number of matched
8511 lines. Thus, you may use a regular expression without submatch in this case.
8512
8513 B<GaugeInc> is reset to I<zero> after every read, unlike other B<Gauge*>
8514 metrics which are reset to C<NaN>.
8515
8516 =item B<Distribution>
8517
8518 Type to do calculations based on the distribution of values, primarily
8519 calculating percentiles. This is primarily geared towards latency, but can be
8520 used for other metrics as well. The range of values tracked with this setting
8521 must be in the range (0–2^34) and can be fractional. Please note that neither
8522 zero nor 2^34 are inclusive bounds, i.e. zero I<cannot> be handled by a
8523 distribution.
8524
8525 This option must be used together with the B<Percentile> and/or B<Bucket>
8526 options.
8527
8528 B<Synopsis:>
8529
8530   <DSType "Distribution">
8531     Percentile 99
8532     Bucket 0 100
8533     BucketType "bucket"
8534   </DSType>
8535
8536 =over 4
8537
8538 =item B<Percentile> I<Percent>
8539
8540 Calculate and dispatch the configured percentile, i.e. compute the value, so
8541 that I<Percent> of all matched values are smaller than or equal to the computed
8542 latency.
8543
8544 Metrics are reported with the I<type> B<Type> (the value of the above option)
8545 and the I<type instance> C<[E<lt>InstanceE<gt>-]E<lt>PercentE<gt>>.
8546
8547 This option may be repeated to calculate more than one percentile.
8548
8549 =item B<Bucket> I<lower_bound> I<upper_bound>
8550
8551 Export the number of values (a C<DERIVE>) falling within the given range. Both,
8552 I<lower_bound> and I<upper_bound> may be a fractional number, such as B<0.5>.
8553 Each B<Bucket> option specifies an interval C<(I<lower_bound>,
8554 I<upper_bound>]>, i.e. the range I<excludes> the lower bound and I<includes>
8555 the upper bound. I<lower_bound> and I<upper_bound> may be zero, meaning no
8556 lower/upper bound.
8557
8558 To export the entire (0–inf) range without overlap, use the upper bound of the
8559 previous range as the lower bound of the following range. In other words, use
8560 the following schema:
8561
8562   Bucket   0   1
8563   Bucket   1   2
8564   Bucket   2   5
8565   Bucket   5  10
8566   Bucket  10  20
8567   Bucket  20  50
8568   Bucket  50   0
8569
8570 Metrics are reported with the I<type> set by B<BucketType> option (C<bucket> 
8571 by default) and the I<type instance>
8572 C<E<lt>TypeE<gt>[-E<lt>InstanceE<gt>]-E<lt>lower_boundE<gt>_E<lt>upper_boundE<gt>>.
8573
8574 This option may be repeated to calculate more than one rate.
8575
8576 =item B<BucketType> I<Type>
8577
8578 Sets the type used to dispatch B<Bucket> metrics.
8579 Optional, by default C<bucket> will be used.
8580
8581 =back
8582
8583 =back
8584
8585 The B<Gauge*> and B<Distribution> types interpret the submatch as a floating
8586 point number, using L<strtod(3)>. The B<Counter*> and B<AbsoluteSet> types
8587 interpret the submatch as an unsigned integer using L<strtoull(3)>. The
8588 B<Derive*> types interpret the submatch as a signed integer using
8589 L<strtoll(3)>. B<CounterInc>, B<DeriveInc> and B<GaugeInc> do not use the
8590 submatch at all and it may be omitted in this case.
8591
8592 The B<Gauge*> types, unless noted otherwise, are reset to C<NaN> after being
8593 reported. In other words, B<GaugeAverage> reports the average of all values
8594 matched since the last metric was reported (or C<NaN> if there was no match).
8595
8596 =item B<Type> I<Type>
8597
8598 Sets the type used to dispatch this value. Detailed information about types and
8599 their configuration can be found in L<types.db(5)>.
8600
8601 =item B<Instance> I<TypeInstance>
8602
8603 This optional setting sets the type instance to use.
8604
8605 =back
8606
8607 =head2 Plugin C<tail_csv>
8608
8609 The I<tail_csv plugin> reads files in the CSV format, e.g. the statistics file
8610 written by I<Snort>.
8611
8612 B<Synopsis:>
8613
8614  <Plugin "tail_csv">
8615    <Metric "snort-dropped">
8616        Type "percent"
8617        Instance "dropped"
8618        ValueFrom 1
8619    </Metric>
8620    <File "/var/log/snort/snort.stats">
8621        Plugin "snortstats"
8622        Instance "eth0"
8623        Interval 600
8624        Collect "snort-dropped"
8625        #TimeFrom 0
8626    </File>
8627  </Plugin>
8628
8629 The configuration consists of one or more B<Metric> blocks that define an index
8630 into the line of the CSV file and how this value is mapped to I<collectd's>
8631 internal representation. These are followed by one or more B<Instance> blocks
8632 which configure which file to read, in which interval and which metrics to
8633 extract.
8634
8635 =over 4
8636
8637 =item E<lt>B<Metric> I<Name>E<gt>
8638
8639 The B<Metric> block configures a new metric to be extracted from the statistics
8640 file and how it is mapped on I<collectd's> data model. The string I<Name> is
8641 only used inside the B<Instance> blocks to refer to this block, so you can use
8642 one B<Metric> block for multiple CSV files.
8643
8644 =over 4
8645
8646 =item B<Type> I<Type>
8647
8648 Configures which I<Type> to use when dispatching this metric. Types are defined
8649 in the L<types.db(5)> file, see the appropriate manual page for more
8650 information on specifying types. Only types with a single I<data source> are
8651 supported by the I<tail_csv plugin>. The information whether the value is an
8652 absolute value (i.e. a C<GAUGE>) or a rate (i.e. a C<DERIVE>) is taken from the
8653 I<Type's> definition.
8654
8655 =item B<Instance> I<TypeInstance>
8656
8657 If set, I<TypeInstance> is used to populate the type instance field of the
8658 created value lists. Otherwise, no type instance is used.
8659
8660 =item B<ValueFrom> I<Index>
8661
8662 Configure to read the value from the field with the zero-based index I<Index>.
8663 If the value is parsed as signed integer, unsigned integer or double depends on
8664 the B<Type> setting, see above.
8665
8666 =back
8667
8668 =item E<lt>B<File> I<Path>E<gt>
8669
8670 Each B<File> block represents one CSV file to read. There must be at least one
8671 I<File> block but there can be multiple if you have multiple CSV files.
8672
8673 =over 4
8674
8675 =item B<Plugin> I<Plugin>
8676
8677 Use I<Plugin> as the plugin name when submitting values.
8678 Defaults to C<tail_csv>.
8679
8680 =item B<Instance> I<PluginInstance>
8681
8682 Sets the I<plugin instance> used when dispatching the values.
8683
8684 =item B<Collect> I<Metric>
8685
8686 Specifies which I<Metric> to collect. This option must be specified at least
8687 once, and you can use this option multiple times to specify more than one
8688 metric to be extracted from this statistic file.
8689
8690 =item B<Interval> I<Seconds>
8691
8692 Configures the interval in which to read values from this instance / file.
8693 Defaults to the plugin's default interval.
8694
8695 =item B<TimeFrom> I<Index>
8696
8697 Rather than using the local time when dispatching a value, read the timestamp
8698 from the field with the zero-based index I<Index>. The value is interpreted as
8699 seconds since epoch. The value is parsed as a double and may be factional.
8700
8701 =back
8702
8703 =back
8704
8705 =head2 Plugin C<teamspeak2>
8706
8707 The C<teamspeak2 plugin> connects to the query port of a teamspeak2 server and
8708 polls interesting global and virtual server data. The plugin can query only one
8709 physical server but unlimited virtual servers. You can use the following
8710 options to configure it:
8711
8712 =over 4
8713
8714 =item B<Host> I<hostname/ip>
8715
8716 The hostname or ip which identifies the physical server.
8717 Default: 127.0.0.1
8718
8719 =item B<Port> I<port>
8720
8721 The query port of the physical server. This needs to be a string.
8722 Default: "51234"
8723
8724 =item B<Server> I<port>
8725
8726 This option has to be added once for every virtual server the plugin should
8727 query. If you want to query the virtual server on port 8767 this is what the
8728 option would look like:
8729
8730   Server "8767"
8731
8732 This option, although numeric, needs to be a string, i.E<nbsp>e. you B<must>
8733 use quotes around it! If no such statement is given only global information
8734 will be collected.
8735
8736 =back
8737
8738 =head2 Plugin C<ted>
8739
8740 The I<TED> plugin connects to a device of "The Energy Detective", a device to
8741 measure power consumption. These devices are usually connected to a serial
8742 (RS232) or USB port. The plugin opens a configured device and tries to read the
8743 current energy readings. For more information on TED, visit
8744 L<http://www.theenergydetective.com/>.
8745
8746 Available configuration options:
8747
8748 =over 4
8749
8750 =item B<Device> I<Path>
8751
8752 Path to the device on which TED is connected. collectd will need read and write
8753 permissions on that file.
8754
8755 Default: B</dev/ttyUSB0>
8756
8757 =item B<Retries> I<Num>
8758
8759 Apparently reading from TED is not that reliable. You can therefore configure a
8760 number of retries here. You only configure the I<retries> here, to if you
8761 specify zero, one reading will be performed (but no retries if that fails); if
8762 you specify three, a maximum of four readings are performed. Negative values
8763 are illegal.
8764
8765 Default: B<0>
8766
8767 =back
8768
8769 =head2 Plugin C<tcpconns>
8770
8771 The C<tcpconns plugin> counts the number of currently established TCP
8772 connections based on the local port and/or the remote port. Since there may be
8773 a lot of connections the default if to count all connections with a local port,
8774 for which a listening socket is opened. You can use the following options to
8775 fine-tune the ports you are interested in:
8776
8777 =over 4
8778
8779 =item B<ListeningPorts> I<true>|I<false>
8780
8781 If this option is set to I<true>, statistics for all local ports for which a
8782 listening socket exists are collected. The default depends on B<LocalPort> and
8783 B<RemotePort> (see below): If no port at all is specifically selected, the
8784 default is to collect listening ports. If specific ports (no matter if local or
8785 remote ports) are selected, this option defaults to I<false>, i.E<nbsp>e. only
8786 the selected ports will be collected unless this option is set to I<true>
8787 specifically.
8788
8789 =item B<LocalPort> I<Port>
8790
8791 Count the connections to a specific local port. This can be used to see how
8792 many connections are handled by a specific daemon, e.E<nbsp>g. the mailserver.
8793 You have to specify the port in numeric form, so for the mailserver example
8794 you'd need to set B<25>.
8795
8796 =item B<RemotePort> I<Port>
8797
8798 Count the connections to a specific remote port. This is useful to see how
8799 much a remote service is used. This is most useful if you want to know how many
8800 connections a local service has opened to remote services, e.E<nbsp>g. how many
8801 connections a mail server or news server has to other mail or news servers, or
8802 how many connections a web proxy holds to web servers. You have to give the
8803 port in numeric form.
8804
8805 =item B<AllPortsSummary> I<true>|I<false>
8806
8807 If this option is set to I<true> a summary of statistics from all connections
8808 are collected. This option defaults to I<false>.
8809
8810 =back
8811
8812 =head2 Plugin C<thermal>
8813
8814 =over 4
8815
8816 =item B<ForceUseProcfs> I<true>|I<false>
8817
8818 By default, the I<Thermal plugin> tries to read the statistics from the Linux
8819 C<sysfs> interface. If that is not available, the plugin falls back to the
8820 C<procfs> interface. By setting this option to I<true>, you can force the
8821 plugin to use the latter. This option defaults to I<false>.
8822
8823 =item B<Device> I<Device>
8824
8825 Selects the name of the thermal device that you want to collect or ignore,
8826 depending on the value of the B<IgnoreSelected> option. This option may be
8827 used multiple times to specify a list of devices.
8828
8829 See F</"IGNORELISTS"> for details.
8830
8831 =item B<IgnoreSelected> I<true>|I<false>
8832
8833 Invert the selection: If set to true, all devices B<except> the ones that
8834 match the device names specified by the B<Device> option are collected. By
8835 default only selected devices are collected if a selection is made. If no
8836 selection is configured at all, B<all> devices are selected.
8837
8838 =back
8839
8840 =head2 Plugin C<threshold>
8841
8842 The I<Threshold plugin> checks values collected or received by I<collectd>
8843 against a configurable I<threshold> and issues I<notifications> if values are
8844 out of bounds.
8845
8846 Documentation for this plugin is available in the L<collectd-threshold(5)>
8847 manual page.
8848
8849 =head2 Plugin C<tokyotyrant>
8850
8851 The I<TokyoTyrant plugin> connects to a TokyoTyrant server and collects a
8852 couple metrics: number of records, and database size on disk.
8853
8854 =over 4
8855
8856 =item B<Host> I<Hostname/IP>
8857
8858 The hostname or IP which identifies the server.
8859 Default: B<127.0.0.1>
8860
8861 =item B<Port> I<Service/Port>
8862
8863 The query port of the server. This needs to be a string, even if the port is
8864 given in its numeric form.
8865 Default: B<1978>
8866
8867 =back
8868
8869 =head2 Plugin C<turbostat>
8870
8871 The I<Turbostat plugin> reads CPU frequency and C-state residency on modern
8872 Intel processors by using I<Model Specific Registers>.
8873
8874 =over 4
8875
8876 =item B<CoreCstates> I<Bitmask(Integer)>
8877
8878 Bit mask of the list of core C-states supported by the processor.
8879 This option should only be used if the automated detection fails.
8880 Default value extracted from the CPU model and family.
8881
8882 Currently supported C-states (by this plugin): 3, 6, 7
8883
8884 B<Example:>
8885
8886   All states (3, 6 and 7):
8887   (1<<3) + (1<<6) + (1<<7) = 392
8888
8889 =item B<PackageCstates> I<Bitmask(Integer)>
8890
8891 Bit mask of the list of packages C-states supported by the processor. This
8892 option should only be used if the automated detection fails. Default value
8893 extracted from the CPU model and family.
8894
8895 Currently supported C-states (by this plugin): 2, 3, 6, 7, 8, 9, 10
8896
8897 B<Example:>
8898
8899   States 2, 3, 6 and 7:
8900   (1<<2) + (1<<3) + (1<<6) + (1<<7) = 396
8901
8902 =item B<SystemManagementInterrupt> I<true>|I<false>
8903
8904 Boolean enabling the collection of the I/O System-Management Interrupt counter.
8905 This option should only be used if the automated detection fails or if you want
8906 to disable this feature.
8907
8908 =item B<DigitalTemperatureSensor> I<true>|I<false>
8909
8910 Boolean enabling the collection of the temperature of each core. This option
8911 should only be used if the automated detection fails or if you want to disable
8912 this feature.
8913
8914 =item B<TCCActivationTemp> I<Temperature>
8915
8916 I<Thermal Control Circuit Activation Temperature> of the installed CPU. This
8917 temperature is used when collecting the temperature of cores or packages. This
8918 option should only be used if the automated detection fails. Default value
8919 extracted from B<MSR_IA32_TEMPERATURE_TARGET>.
8920
8921 =item B<RunningAveragePowerLimit> I<Bitmask(Integer)>
8922
8923 Bit mask of the list of elements to be thermally monitored. This option should
8924 only be used if the automated detection fails or if you want to disable some
8925 collections. The different bits of this bit mask accepted by this plugin are:
8926
8927 =over 4
8928
8929 =item 0 ('1'): Package
8930
8931 =item 1 ('2'): DRAM
8932
8933 =item 2 ('4'): Cores
8934
8935 =item 3 ('8'): Embedded graphic device
8936
8937 =back
8938
8939 =item B<LogicalCoreNames> I<true>|I<false>
8940
8941 Boolean enabling the use of logical core numbering for per core statistics.
8942 When enabled, C<cpuE<lt>nE<gt>> is used as plugin instance, where I<n> is a
8943 dynamic number assigned by the kernel. Otherwise, C<coreE<lt>nE<gt>> is used
8944 if there is only one package and C<pkgE<lt>nE<gt>-coreE<lt>mE<gt>> if there is
8945 more than one, where I<n> is the n-th core of package I<m>.
8946
8947 =item B<RestoreAffinityPolicy> I<AllCPUs>|I<Restore>
8948
8949 Reading data from CPU has side-effect: collectd process's CPU affinity mask
8950 changes. After reading data is completed, affinity mask needs to be restored.
8951 This option allows to set restore policy.
8952
8953 B<AllCPUs> (the default): Restore the affinity by setting affinity to any/all
8954 CPUs.
8955
8956 B<Restore>: Save affinity using sched_getaffinity() before reading data and
8957 restore it after.
8958
8959 On some systems, sched_getaffinity() will fail due to inconsistency of the CPU
8960 set size between userspace and kernel. In these cases plugin will detect the
8961 unsuccessful call and fail with an error, preventing data collection.
8962 Most of configurations does not need to save affinity as Collectd process is
8963 allowed to run on any/all available CPUs.
8964
8965 If you need to save and restore affinity and get errors like 'Unable to save
8966 the CPU affinity', setting 'possible_cpus' kernel boot option may also help.
8967
8968 See following links for details:
8969
8970 L<https://github.com/collectd/collectd/issues/1593>
8971 L<https://sourceware.org/bugzilla/show_bug.cgi?id=15630>
8972 L<https://bugzilla.kernel.org/show_bug.cgi?id=151821>
8973
8974 =back
8975
8976 =head2 Plugin C<unixsock>
8977
8978 =over 4
8979
8980 =item B<SocketFile> I<Path>
8981
8982 Sets the socket-file which is to be created.
8983
8984 =item B<SocketGroup> I<Group>
8985
8986 If running as root change the group of the UNIX-socket after it has been
8987 created. Defaults to B<collectd>.
8988
8989 =item B<SocketPerms> I<Permissions>
8990
8991 Change the file permissions of the UNIX-socket after it has been created. The
8992 permissions must be given as a numeric, octal value as you would pass to
8993 L<chmod(1)>. Defaults to B<0770>.
8994
8995 =item B<DeleteSocket> B<false>|B<true>
8996
8997 If set to B<true>, delete the socket file before calling L<bind(2)>, if a file
8998 with the given name already exists. If I<collectd> crashes a socket file may be
8999 left over, preventing the daemon from opening a new socket when restarted.
9000 Since this is potentially dangerous, this defaults to B<false>.
9001
9002 =back
9003
9004 =head2 Plugin C<uuid>
9005
9006 This plugin, if loaded, causes the Hostname to be taken from the machine's
9007 UUID. The UUID is a universally unique designation for the machine, usually
9008 taken from the machine's BIOS. This is most useful if the machine is running in
9009 a virtual environment such as Xen, in which case the UUID is preserved across
9010 shutdowns and migration.
9011
9012 The following methods are used to find the machine's UUID, in order:
9013
9014 =over 4
9015
9016 =item *
9017
9018 Check I</etc/uuid> (or I<UUIDFile>).
9019
9020 =item *
9021
9022 Check for UUID from HAL (L<http://www.freedesktop.org/wiki/Software/hal>) if
9023 present.
9024
9025 =item *
9026
9027 Check for UUID from C<dmidecode> / SMBIOS.
9028
9029 =item *
9030
9031 Check for UUID from Xen hypervisor.
9032
9033 =back
9034
9035 If no UUID can be found then the hostname is not modified.
9036
9037 =over 4
9038
9039 =item B<UUIDFile> I<Path>
9040
9041 Take the UUID from the given file (default I</etc/uuid>).
9042
9043 =back
9044
9045 =head2 Plugin C<varnish>
9046
9047 The I<varnish plugin> collects information about Varnish, an HTTP accelerator.
9048 It collects a subset of the values displayed by L<varnishstat(1)>, and
9049 organizes them in categories which can be enabled or disabled. Currently only
9050 metrics shown in L<varnishstat(1)>'s I<MAIN> section are collected. The exact
9051 meaning of each metric can be found in L<varnish-counters(7)>.
9052
9053 Synopsis:
9054
9055  <Plugin "varnish">
9056    <Instance "example">
9057      CollectBackend     true
9058      CollectBan         false
9059      CollectCache       true
9060      CollectConnections true
9061      CollectDirectorDNS false
9062      CollectESI         false
9063      CollectFetch       false
9064      CollectHCB         false
9065      CollectObjects     false
9066      CollectPurge       false
9067      CollectSession     false
9068      CollectSHM         true
9069      CollectSMA         false
9070      CollectSMS         false
9071      CollectSM          false
9072      CollectStruct      false
9073      CollectTotals      false
9074      CollectUptime      false
9075      CollectVCL         false
9076      CollectVSM         false
9077      CollectWorkers     false
9078      CollectLock        false
9079      CollectMempool     false
9080      CollectManagement  false
9081      CollectSMF         false
9082      CollectVBE         false
9083      CollectMSE         false
9084    </Instance>
9085  </Plugin>
9086
9087 The configuration consists of one or more E<lt>B<Instance>E<nbsp>I<Name>E<gt>
9088 blocks. I<Name> is the parameter passed to "varnishd -n". If left empty, it
9089 will collectd statistics from the default "varnishd" instance (this should work
9090 fine in most cases).
9091
9092 Inside each E<lt>B<Instance>E<gt> blocks, the following options are recognized:
9093
9094 =over 4
9095
9096 =item B<CollectBackend> B<true>|B<false>
9097
9098 Back-end connection statistics, such as successful, reused,
9099 and closed connections. True by default.
9100
9101 =item B<CollectBan> B<true>|B<false>
9102
9103 Statistics about ban operations, such as number of bans added, retired, and
9104 number of objects tested against ban operations. Only available with Varnish
9105 3.x and above. False by default.
9106
9107 =item B<CollectCache> B<true>|B<false>
9108
9109 Cache hits and misses. True by default.
9110
9111 =item B<CollectConnections> B<true>|B<false>
9112
9113 Number of client connections received, accepted and dropped. True by default.
9114
9115 =item B<CollectDirectorDNS> B<true>|B<false>
9116
9117 DNS director lookup cache statistics. Only available with Varnish 3.x. False by
9118 default.
9119
9120 =item B<CollectESI> B<true>|B<false>
9121
9122 Edge Side Includes (ESI) parse statistics. False by default.
9123
9124 =item B<CollectFetch> B<true>|B<false>
9125
9126 Statistics about fetches (HTTP requests sent to the backend). False by default.
9127
9128 =item B<CollectHCB> B<true>|B<false>
9129
9130 Inserts and look-ups in the crit bit tree based hash. Look-ups are
9131 divided into locked and unlocked look-ups. False by default.
9132
9133 =item B<CollectObjects> B<true>|B<false>
9134
9135 Statistics on cached objects: number of objects expired, nuked (prematurely
9136 expired), saved, moved, etc. False by default.
9137
9138 =item B<CollectPurge> B<true>|B<false>
9139
9140 Statistics about purge operations, such as number of purges added, retired, and
9141 number of objects tested against purge operations. Only available with Varnish
9142 2.x. False by default.
9143
9144 =item B<CollectSession> B<true>|B<false>
9145
9146 Client session statistics. Number of past and current sessions, session herd and
9147 linger counters, etc. False by default. Note that if using Varnish 4.x, some
9148 metrics found in the Connections and Threads sections with previous versions of
9149 Varnish have been moved here.
9150
9151 =item B<CollectSHM> B<true>|B<false>
9152
9153 Statistics about the shared memory log, a memory region to store
9154 log messages which is flushed to disk when full. True by default.
9155
9156 =item B<CollectSMA> B<true>|B<false>
9157
9158 malloc or umem (umem_alloc(3MALLOC) based) storage statistics. The umem storage
9159 component is Solaris specific. Note: SMA, SMF and MSE share counters, enable
9160 only the one used by the Varnish instance. Only available with Varnish 2.x.
9161 False by default.
9162
9163 =item B<CollectSMS> B<true>|B<false>
9164
9165 synth (synthetic content) storage statistics. This storage
9166 component is used internally only. False by default.
9167
9168 =item B<CollectSM> B<true>|B<false>
9169
9170 file (memory mapped file) storage statistics. Only available with Varnish 2.x.,
9171 in varnish 4.x. use CollectSMF.
9172 False by default.
9173
9174 =item B<CollectStruct> B<true>|B<false>
9175
9176 Current varnish internal state statistics. Number of current sessions, objects
9177 in cache store, open connections to backends (with Varnish 2.x), etc. False by
9178 default.
9179
9180 =item B<CollectTotals> B<true>|B<false>
9181
9182 Collects overview counters, such as the number of sessions created,
9183 the number of requests and bytes transferred. False by default.
9184
9185 =item B<CollectUptime> B<true>|B<false>
9186
9187 Varnish uptime. Only available with Varnish 3.x and above. False by default.
9188
9189 =item B<CollectVCL> B<true>|B<false>
9190
9191 Number of total (available + discarded) VCL (config files). False by default.
9192
9193 =item B<CollectVSM> B<true>|B<false>
9194
9195 Collect statistics about Varnish's shared memory usage (used by the logging and
9196 statistics subsystems). Only available with Varnish 4.x. False by default.
9197
9198 =item B<CollectWorkers> B<true>|B<false>
9199
9200 Collect statistics about worker threads. False by default.
9201
9202 =item B<CollectVBE> B<true>|B<false>
9203
9204 Backend counters. Only available with Varnish 4.x. False by default.
9205
9206 =item B<CollectSMF> B<true>|B<false>
9207
9208 file (memory mapped file) storage statistics. Only available with Varnish 4.x.
9209 Note: SMA, SMF and MSE share counters, enable only the one used by the Varnish
9210 instance. Used to be called SM in Varnish 2.x. False by default.
9211
9212 =item B<CollectManagement> B<true>|B<false>
9213
9214 Management process counters. Only available with Varnish 4.x. False by default.
9215
9216 =item B<CollectLock> B<true>|B<false>
9217
9218 Lock counters. Only available with Varnish 4.x. False by default.
9219
9220 =item B<CollectMempool> B<true>|B<false>
9221
9222 Memory pool counters. Only available with Varnish 4.x. False by default.
9223
9224 =item B<CollectMSE> B<true>|B<false>
9225
9226 Varnish Massive Storage Engine 2.0 (MSE2) is an improved storage backend for
9227 Varnish, replacing the traditional malloc and file storages. Only available
9228 with Varnish-Plus 4.x. Note: SMA, SMF and MSE share counters, enable only the
9229 one used by the Varnish instance. False by default.
9230
9231 =back
9232
9233 =head2 Plugin C<virt>
9234
9235 This plugin allows CPU, disk, network load and other metrics to be collected for
9236 virtualized guests on the machine. The statistics are collected through libvirt
9237 API (L<http://libvirt.org/>). Majority of metrics can be gathered without
9238 installing any additional software on guests, especially I<collectd>, which runs
9239 only on the host system.
9240
9241 Only I<Connection> is required.
9242
9243 Consider the following example config:
9244
9245  <Plugin "virt">
9246    Connection "qemu:///system"
9247    HostnameFormat "hostname"
9248    InterfaceFormat "address"
9249    PluginInstanceFormat "name"
9250  </Plugin>
9251
9252 It will generate the following values:
9253
9254   node42.example.com/virt-instance-0006f26c/disk_octets-vda
9255   node42.example.com/virt-instance-0006f26c/disk_ops-vda
9256   node42.example.com/virt-instance-0006f26c/if_dropped-ca:fe:ca:fe:ca:fe
9257   node42.example.com/virt-instance-0006f26c/if_errors-ca:fe:ca:fe:ca:fe
9258   node42.example.com/virt-instance-0006f26c/if_octets-ca:fe:ca:fe:ca:fe
9259   node42.example.com/virt-instance-0006f26c/if_packets-ca:fe:ca:fe:ca:fe
9260   node42.example.com/virt-instance-0006f26c/memory-actual_balloon
9261   node42.example.com/virt-instance-0006f26c/memory-available
9262   node42.example.com/virt-instance-0006f26c/memory-last_update
9263   node42.example.com/virt-instance-0006f26c/memory-major_fault
9264   node42.example.com/virt-instance-0006f26c/memory-minor_fault
9265   node42.example.com/virt-instance-0006f26c/memory-rss
9266   node42.example.com/virt-instance-0006f26c/memory-swap_in
9267   node42.example.com/virt-instance-0006f26c/memory-swap_out
9268   node42.example.com/virt-instance-0006f26c/memory-total
9269   node42.example.com/virt-instance-0006f26c/memory-unused
9270   node42.example.com/virt-instance-0006f26c/memory-usable
9271   node42.example.com/virt-instance-0006f26c/virt_cpu_total
9272   node42.example.com/virt-instance-0006f26c/virt_vcpu-0
9273
9274 You can get information on the metric's units from the online libvirt documentation.
9275 For instance, I<virt_cpu_total> is in nanoseconds.
9276
9277 =over 4
9278
9279 =item B<Connection> I<uri>
9280
9281 Connect to the hypervisor given by I<uri>. For example if using Xen use:
9282
9283  Connection "xen:///"
9284
9285 Details which URIs allowed are given at L<http://libvirt.org/uri.html>.
9286
9287 =item B<RefreshInterval> I<seconds>
9288
9289 Refresh the list of domains and devices every I<seconds>. The default is 60
9290 seconds. Setting this to be the same or smaller than the I<Interval> will cause
9291 the list of domains and devices to be refreshed on every iteration.
9292
9293 Refreshing the devices in particular is quite a costly operation, so if your
9294 virtualization setup is static you might consider increasing this. If this
9295 option is set to 0, refreshing is disabled completely.
9296
9297 =item B<Domain> I<name>
9298
9299 =item B<BlockDevice> I<name:dev>
9300
9301 =item B<InterfaceDevice> I<name:dev>
9302
9303 =item B<IgnoreSelected> B<true>|B<false>
9304
9305 Select which domains and devices are collected.
9306
9307 If I<IgnoreSelected> is not given or B<false> then only the listed domains and
9308 disk/network devices are collected.
9309
9310 If I<IgnoreSelected> is B<true> then the test is reversed and the listed
9311 domains and disk/network devices are ignored, while the rest are collected.
9312
9313 The domain name and device names may use a regular expression, if the name is
9314 surrounded by I</.../> and collectd was compiled with support for regexps.
9315
9316 The default is to collect statistics for all domains and all their devices.
9317
9318 B<Note:> B<BlockDevice> and B<InterfaceDevice> options are related to
9319 corresponding B<*Format> options. Specifically, B<BlockDevice> filtering depends
9320 on B<BlockDeviceFormat> setting - if user wants to filter block devices by
9321 'target' name then B<BlockDeviceFormat> option has to be set to 'target' and
9322 B<BlockDevice> option must be set to a valid block device target
9323 name("/:hdb/"). Mixing formats and filter values from different worlds (i.e.,
9324 using 'target' name as B<BlockDevice> value with B<BlockDeviceFormat> set to
9325 'source') may lead to unexpected results (all devices filtered out or all
9326 visible, depending on the value of B<IgnoreSelected> option).
9327 Similarly, option B<InterfaceDevice> is related to B<InterfaceFormat> setting
9328 (i.e., when user wants to use MAC address as a filter then B<InterfaceFormat>
9329 has to be set to 'address' - using wrong type here may filter out all of the
9330 interfaces).
9331
9332 B<Example 1:>
9333
9334 Ignore all I<hdb> devices on any domain, but other block devices (eg. I<hda>)
9335 will be collected:
9336
9337  BlockDevice "/:hdb/"
9338  IgnoreSelected "true"
9339  BlockDeviceFormat "target"
9340
9341 B<Example 2:>
9342
9343 Collect metrics only for block device on 'baremetal0' domain when its
9344 'source' matches given path:
9345
9346  BlockDevice "baremetal0:/var/lib/libvirt/images/baremetal0.qcow2"
9347  BlockDeviceFormat source
9348
9349 As you can see it is possible to filter devices/interfaces using
9350 various formats - for block devices 'target' or 'source' name can be
9351 used.  Interfaces can be filtered using 'name', 'address' or 'number'.
9352
9353 B<Example 3:>
9354
9355 Collect metrics only for domains 'baremetal0' and 'baremetal1' and
9356 ignore any other domain:
9357
9358  Domain "baremetal0"
9359  Domain "baremetal1"
9360
9361 It is possible to filter multiple block devices/domains/interfaces by
9362 adding multiple filtering entries in separate lines.
9363
9364 =item B<BlockDeviceFormat> B<target>|B<source>
9365
9366 If I<BlockDeviceFormat> is set to B<target>, the default, then the device name
9367 seen by the guest will be used for reporting metrics.
9368 This corresponds to the C<E<lt>targetE<gt>> node in the XML definition of the
9369 domain.
9370
9371 If I<BlockDeviceFormat> is set to B<source>, then metrics will be reported
9372 using the path of the source, e.g. an image file.
9373 This corresponds to the C<E<lt>sourceE<gt>> node in the XML definition of the
9374 domain.
9375
9376 B<Example:>
9377
9378 If the domain XML have the following device defined:
9379
9380   <disk type='block' device='disk'>
9381     <driver name='qemu' type='raw' cache='none' io='native' discard='unmap'/>
9382     <source dev='/var/lib/libvirt/images/image1.qcow2'/>
9383     <target dev='sda' bus='scsi'/>
9384     <boot order='2'/>
9385     <address type='drive' controller='0' bus='0' target='0' unit='0'/>
9386   </disk>
9387
9388 Setting C<BlockDeviceFormat target> will cause the I<type instance> to be set
9389 to C<sda>.
9390 Setting C<BlockDeviceFormat source> will cause the I<type instance> to be set
9391 to C<var_lib_libvirt_images_image1.qcow2>.
9392
9393 B<Note:> this option determines also what field will be used for
9394 filtering over block devices (filter value in B<BlockDevice>
9395 will be applied to target or source). More info about filtering
9396 block devices can be found in the description of B<BlockDevice>.
9397
9398 =item B<BlockDeviceFormatBasename> B<false>|B<true>
9399
9400 The B<BlockDeviceFormatBasename> controls whether the full path or the
9401 L<basename(1)> of the source is being used as the I<type instance> when
9402 B<BlockDeviceFormat> is set to B<source>. Defaults to B<false>.
9403
9404 B<Example:>
9405
9406 Assume the device path (source tag) is C</var/lib/libvirt/images/image1.qcow2>.
9407 Setting C<BlockDeviceFormatBasename false> will cause the I<type instance> to
9408 be set to C<var_lib_libvirt_images_image1.qcow2>.
9409 Setting C<BlockDeviceFormatBasename true> will cause the I<type instance> to be
9410 set to C<image1.qcow2>.
9411
9412 =item B<HostnameFormat> B<name|uuid|hostname|metadata...>
9413
9414 When the virt plugin logs data, it sets the hostname of the collected data
9415 according to this setting. The default is to use the guest name as provided by
9416 the hypervisor, which is equal to setting B<name>.
9417
9418 B<uuid> means use the guest's UUID. This is useful if you want to track the
9419 same guest across migrations.
9420
9421 B<hostname> means to use the global B<Hostname> setting, which is probably not
9422 useful on its own because all guests will appear to have the same name. This is
9423 useful in conjunction with B<PluginInstanceFormat> though.
9424
9425 B<metadata> means use information from guest's metadata. Use
9426 B<HostnameMetadataNS> and B<HostnameMetadataXPath> to localize this information.
9427
9428 You can also specify combinations of these fields. For example B<name uuid>
9429 means to concatenate the guest name and UUID (with a literal colon character
9430 between, thus I<"foo:1234-1234-1234-1234">).
9431
9432 At the moment of writing (collectd-5.5), hostname string is limited to 62
9433 characters. In case when combination of fields exceeds 62 characters,
9434 hostname will be truncated without a warning.
9435
9436 =item B<InterfaceFormat> B<name>|B<address>|B<number>
9437
9438 When the virt plugin logs interface data, it sets the name of the collected
9439 data according to this setting. The default is to use the path as provided by
9440 the hypervisor (the "dev" property of the target node), which is equal to
9441 setting B<name>.
9442
9443 B<address> means use the interface's mac address. This is useful since the
9444 interface path might change between reboots of a guest or across migrations.
9445
9446 B<number> means use the interface's number in guest.
9447
9448 B<Note:> this option determines also what field will be used for
9449 filtering over interface device (filter value in B<InterfaceDevice>
9450 will be applied to name, address or number).  More info about filtering
9451 interfaces can be found in the description of B<InterfaceDevice>.
9452
9453 =item B<PluginInstanceFormat> B<name|uuid|metadata|none>
9454
9455 When the virt plugin logs data, it sets the plugin_instance of the collected
9456 data according to this setting. The default is to not set the plugin_instance.
9457
9458 B<name> means use the guest's name as provided by the hypervisor.
9459 B<uuid> means use the guest's UUID.
9460 B<metadata> means use information from guest's metadata.
9461
9462 You can also specify combinations of the B<name> and B<uuid> fields.
9463 For example B<name uuid> means to concatenate the guest name and UUID
9464 (with a literal colon character between, thus I<"foo:1234-1234-1234-1234">).
9465
9466 =item B<HostnameMetadataNS> B<string>
9467
9468 When B<metadata> is used in B<HostnameFormat> or B<PluginInstanceFormat>, this
9469 selects in which metadata namespace we will pick the hostname. The default is
9470 I<http://openstack.org/xmlns/libvirt/nova/1.0>.
9471
9472 =item B<HostnameMetadataXPath> B<string>
9473
9474 When B<metadata> is used in B<HostnameFormat> or B<PluginInstanceFormat>, this
9475 describes where the hostname is located in the libvirt metadata. The default is
9476 I</instance/name/text()>.
9477
9478 =item B<ReportBlockDevices> B<true>|B<false>
9479
9480 Enabled by default. Allows to disable stats reporting of block devices for
9481 whole plugin.
9482
9483 =item B<ReportNetworkInterfaces> B<true>|B<false>
9484
9485 Enabled by default. Allows to disable stats reporting of network interfaces for
9486 whole plugin.
9487
9488 =item B<ExtraStats> B<string>
9489
9490 Report additional extra statistics. The default is no extra statistics, preserving
9491 the previous behaviour of the plugin. If unsure, leave the default. If enabled,
9492 allows the plugin to reported more detailed statistics about the behaviour of
9493 Virtual Machines. The argument is a space-separated list of selectors.
9494
9495 Currently supported selectors are:
9496
9497 =over 4
9498
9499 =item B<cpu_util>: report CPU utilization per domain in percentage.
9500
9501 =item B<disk>: report extra statistics like number of flush operations and total
9502 service time for read, write and flush operations. Requires libvirt API version
9503 I<0.9.5> or later.
9504
9505 =item B<disk_err>: report disk errors if any occured. Requires libvirt API version
9506 I<0.9.10> or later.
9507
9508 =item B<domain_state>: report domain state and reason as 'domain_state' metric.
9509
9510 =item B<fs_info>: report file system information as a notification. Requires
9511 libvirt API version I<1.2.11> or later. Can be collected only if I<Guest Agent>
9512 is installed and configured inside VM. Make sure that installed I<Guest Agent>
9513 version supports retrieving  file system information.
9514
9515 =item B<job_stats_background>: report statistics about progress of a background
9516 job on a domain. Only one type of job statistics can be collected at the same time.
9517 Requires libvirt API version I<1.2.9> or later.
9518
9519 =item B<job_stats_completed>: report statistics about a recently completed job on
9520 a domain. Only one type of job statistics can be collected at the same time.
9521 Requires libvirt API version I<1.2.9> or later.
9522
9523 =item B<memory>: report statistics about memory usage details, provided
9524 by libvirt virDomainMemoryStats() function.
9525
9526 =item B<pcpu>: report the physical user/system cpu time consumed by the hypervisor, per-vm.
9527 Requires libvirt API version I<0.9.11> or later.
9528
9529 =item B<perf>: report performance monitoring events. To collect performance
9530 metrics they must be enabled for domain and supported by the platform. Requires
9531 libvirt API version I<1.3.3> or later.
9532 B<Note>: I<perf> metrics can't be collected if I<intel_rdt> plugin is enabled.
9533
9534 =item B<vcpu>: report domain virtual CPUs utilisation.
9535
9536 =item B<vcpupin>: report pinning of domain VCPUs to host physical CPUs.
9537
9538 =item B<disk_physical>: report 'disk_physical' statistic for disk device.
9539 B<Note>: This statistic is only reported for disk devices with 'source'
9540 property available.
9541
9542 =item B<disk_allocation>: report 'disk_allocation' statistic for disk device.
9543 B<Note>: This statistic is only reported for disk devices with 'source'
9544 property available.
9545
9546 =item B<disk_capacity>: report 'disk_capacity' statistic for disk device.
9547 B<Note>: This statistic is only reported for disk devices with 'source'
9548 property available.
9549
9550 =back
9551
9552 =item B<PersistentNotification> B<true>|B<false>
9553
9554 Override default configuration to only send notifications when there is a change
9555 in the lifecycle state of a domain. When set to true notifications will be sent
9556 for every read cycle. Default is false. Does not affect the stats being
9557 dispatched.
9558
9559 =item B<Instances> B<integer>
9560
9561 How many read instances you want to use for this plugin. The default is one,
9562 and the sensible setting is a multiple of the B<ReadThreads> value.
9563
9564 This option is only useful when domains are specially tagged.
9565 If you are not sure, just use the default setting.
9566
9567 The reader instance will only query the domains with attached matching tag.
9568 Tags should have the form of 'virt-X' where X is the reader instance number,
9569 starting from 0.
9570
9571 The special-purpose reader instance #0, guaranteed to be always present,
9572 will query all the domains with missing or unrecognized tag, so no domain will
9573 ever be left out.
9574
9575 Domain tagging is done with a custom attribute in the libvirt domain metadata
9576 section. Value is selected by an XPath I</domain/metadata/ovirtmap/tag/text()>
9577 expression in the I<http://ovirt.org/ovirtmap/tag/1.0> namespace.
9578 (XPath and namespace values are not configurable yet).
9579
9580 Tagging could be used by management applications to evenly spread the
9581 load among the reader threads, or to pin on the same threads all
9582 the libvirt domains which use the same shared storage, to minimize
9583 the disruption in presence of storage outages.
9584
9585 =back
9586
9587 =head2 Plugin C<vmem>
9588
9589 The C<vmem> plugin collects information about the usage of virtual memory.
9590 Since the statistics provided by the Linux kernel are very detailed, they are
9591 collected very detailed. However, to get all the details, you have to switch
9592 them on manually. Most people just want an overview over, such as the number of
9593 pages read from swap space.
9594
9595 =over 4
9596
9597 =item B<Verbose> B<true>|B<false>
9598
9599 Enables verbose collection of information. This will start collecting page
9600 "actions", e.E<nbsp>g. page allocations, (de)activations, steals and so on.
9601 Part of these statistics are collected on a "per zone" basis.
9602
9603 =back
9604
9605 =head2 Plugin C<vserver>
9606
9607 This plugin doesn't have any options. B<VServer> support is only available for
9608 Linux. It cannot yet be found in a vanilla kernel, though. To make use of this
9609 plugin you need a kernel that has B<VServer> support built in, i.E<nbsp>e. you
9610 need to apply the patches and compile your own kernel, which will then provide
9611 the F</proc/virtual> filesystem that is required by this plugin.
9612
9613 The B<VServer> homepage can be found at L<http://linux-vserver.org/>.
9614
9615 B<Note>: The traffic collected by this plugin accounts for the amount of
9616 traffic passing a socket which might be a lot less than the actual on-wire
9617 traffic (e.E<nbsp>g. due to headers and retransmission). If you want to
9618 collect on-wire traffic you could, for example, use the logging facilities of
9619 iptables to feed data for the guest IPs into the iptables plugin.
9620
9621 =head2 Plugin C<write_graphite>
9622
9623 The C<write_graphite> plugin writes data to I<Graphite>, an open-source metrics
9624 storage and graphing project. The plugin connects to I<Carbon>, the data layer
9625 of I<Graphite>, via I<TCP> or I<UDP> and sends data via the "line based"
9626 protocol (per default using portE<nbsp>2003). The data will be sent in blocks
9627 of at most 1428 bytes to minimize the number of network packets.
9628
9629 Synopsis:
9630
9631  <Plugin write_graphite>
9632    <Node "example">
9633      Host "localhost"
9634      Port "2003"
9635      Protocol "tcp"
9636      LogSendErrors true
9637      Prefix "collectd"
9638      UseTags false
9639      ReverseHost false
9640    </Node>
9641  </Plugin>
9642
9643 The configuration consists of one or more E<lt>B<Node>E<nbsp>I<Name>E<gt>
9644 blocks. Inside the B<Node> blocks, the following options are recognized:
9645
9646 =over 4
9647
9648 =item B<Host> I<Address>
9649
9650 Hostname or address to connect to. Defaults to C<localhost>.
9651
9652 =item B<Port> I<Service>
9653
9654 Service name or port number to connect to. Defaults to C<2003>.
9655
9656 =item B<Protocol> I<String>
9657
9658 Protocol to use when connecting to I<Graphite>. Defaults to C<tcp>.
9659
9660 =item B<ReconnectInterval> I<Seconds>
9661
9662 When set to non-zero, forces the connection to the Graphite backend to be
9663 closed and re-opend periodically. This behavior is desirable in environments
9664 where the connection to the Graphite backend is done through load balancers,
9665 for example. When set to zero, the default, the connetion is kept open for as
9666 long as possible.
9667
9668 =item B<LogSendErrors> B<false>|B<true>
9669
9670 If set to B<true> (the default), logs errors when sending data to I<Graphite>.
9671 If set to B<false>, it will not log the errors. This is especially useful when
9672 using Protocol UDP since many times we want to use the "fire-and-forget"
9673 approach and logging errors fills syslog with unneeded messages.
9674
9675 =item B<Prefix> I<String>
9676
9677 When B<UseTags> is I<false>, B<Prefix> value is added in front of the host name.
9678 When B<UseTags> is I<true>, B<Prefix> value is added in front of series name.
9679
9680 Dots and whitespace are I<not> escaped in this string (see B<EscapeCharacter>
9681 below).
9682
9683 =item B<Postfix> I<String>
9684
9685 When B<UseTags> is I<false>, B<Postfix> value appended to the host name.
9686 When B<UseTags> is I<true>, B<Postgix> value appended to the end of series name
9687 (before the first ; that separates the name from the tags).
9688
9689 Dots and whitespace are I<not> escaped in this string (see B<EscapeCharacter>
9690 below).
9691
9692 =item B<EscapeCharacter> I<Char>
9693
9694 I<Carbon> uses the dot (C<.>) as escape character and doesn't allow whitespace
9695 in the identifier. The B<EscapeCharacter> option determines which character
9696 dots, whitespace and control characters are replaced with. Defaults to
9697 underscore (C<_>).
9698
9699 =item B<StoreRates> B<false>|B<true>
9700
9701 If set to B<true> (the default), convert counter values to rates. If set to
9702 B<false> counter values are stored as is, i.E<nbsp>e. as an increasing integer
9703 number.
9704
9705 =item B<SeparateInstances> B<false>|B<true>
9706
9707 If set to B<true>, the plugin instance and type instance will be in their own
9708 path component, for example C<host.cpu.0.cpu.idle>. If set to B<false> (the
9709 default), the plugin and plugin instance (and likewise the type and type
9710 instance) are put into one component, for example C<host.cpu-0.cpu-idle>.
9711
9712 Option value is not used when B<UseTags> is I<true>.
9713
9714 =item B<AlwaysAppendDS> B<false>|B<true>
9715
9716 If set to B<true>, append the name of the I<Data Source> (DS) to the "metric"
9717 identifier. If set to B<false> (the default), this is only done when there is
9718 more than one DS.
9719
9720 =item B<PreserveSeparator> B<false>|B<true>
9721
9722 If set to B<false> (the default) the C<.> (dot) character is replaced with
9723 I<EscapeCharacter>. Otherwise, if set to B<true>, the C<.> (dot) character
9724 is preserved, i.e. passed through.
9725
9726 Option value is not used when B<UseTags> is I<true>.
9727
9728 =item B<DropDuplicateFields> B<false>|B<true>
9729
9730 If set to B<true>, detect and remove duplicate components in Graphite metric
9731 names. For example, the metric name  C<host.load.load.shortterm> will
9732 be shortened to C<host.load.shortterm>.
9733
9734 =item B<UseTags> B<false>|B<true>
9735
9736 If set to B<true>, Graphite metric names will be generated as tagged series.
9737 This allows for much more flexibility than the traditional hierarchical layout.
9738
9739 Example:
9740 C<test.single;host=example.com;plugin=test;plugin_instance=foo;type=single;type_instance=bar>
9741
9742 You can use B<Postfix> option to add more tags by specifying it like
9743 C<;tag1=value1;tag2=value2>. Note what tagging support was added since Graphite
9744 version 1.1.x.
9745
9746 If set to B<true>, the B<SeparateInstances> and B<PreserveSeparator> settings
9747 are not used.
9748
9749 Default value: B<false>.
9750
9751 =item B<ReverseHost> B<false>|B<true>
9752
9753 If set to B<true>, the (dot separated) parts of the B<host> field of the
9754 I<value list> will be rewritten in reverse order. The rewrite happens I<before>
9755 special characters are replaced with the B<EscapeCharacter>.
9756
9757 This option might be convenient if the metrics are presented with Graphite in a
9758 DNS like tree structure (probably without replacing dots in hostnames).
9759
9760 Example:
9761  Hostname "node3.cluster1.example.com"
9762  LoadPlugin "cpu"
9763  LoadPlugin "write_graphite"
9764  <Plugin "write_graphite">
9765   <Node "graphite.example.com">
9766    EscapeCharacter "."
9767    ReverseHost true
9768   </Node>
9769  </Plugin>
9770
9771  result on the wire: com.example.cluster1.node3.cpu-0.cpu-idle 99.900993 1543010932
9772
9773 Default value: B<false>.
9774
9775 =back
9776
9777 =head2 Plugin C<write_log>
9778
9779 The C<write_log> plugin writes metrics as INFO log messages.
9780
9781 This plugin supports two output formats: I<Graphite> and I<JSON>.
9782
9783 Synopsis:
9784
9785  <Plugin write_log>
9786    Format Graphite
9787  </Plugin>
9788
9789 =over 4
9790
9791 =item B<Format> I<Format>
9792
9793 The output format to use. Can be one of C<Graphite> or C<JSON>.
9794
9795 =back
9796
9797 =head2 Plugin C<write_tsdb>
9798
9799 The C<write_tsdb> plugin writes data to I<OpenTSDB>, a scalable open-source
9800 time series database. The plugin connects to a I<TSD>, a masterless, no shared
9801 state daemon that ingests metrics and stores them in HBase. The plugin uses
9802 I<TCP> over the "line based" protocol with a default port 4242. The data will
9803 be sent in blocks of at most 1428 bytes to minimize the number of network
9804 packets.
9805
9806 Synopsis:
9807
9808  <Plugin write_tsdb>
9809    ResolveInterval 60
9810    ResolveJitter 60
9811    <Node "example">
9812      Host "tsd-1.my.domain"
9813      Port "4242"
9814      HostTags "status=production"
9815    </Node>
9816  </Plugin>
9817
9818 The configuration consists of one or more E<lt>B<Node>E<nbsp>I<Name>E<gt>
9819 blocks and global directives.
9820
9821 Global directives are:
9822
9823 =over 4
9824
9825 =item B<ResolveInterval> I<seconds>
9826
9827 =item B<ResolveJitter> I<seconds>
9828
9829 When I<collectd> connects to a TSDB node, it will request the hostname from
9830 DNS. This can become a problem if the TSDB node is unavailable or badly
9831 configured because collectd will request DNS in order to reconnect for every
9832 metric, which can flood your DNS. So you can cache the last value for
9833 I<ResolveInterval> seconds.
9834 Defaults to the I<Interval> of the I<write_tsdb plugin>, e.g. 10E<nbsp>seconds.
9835
9836 You can also define a jitter, a random interval to wait in addition to
9837 I<ResolveInterval>. This prevents all your collectd servers to resolve the
9838 hostname at the same time when the connection fails.
9839 Defaults to the I<Interval> of the I<write_tsdb plugin>, e.g. 10E<nbsp>seconds.
9840
9841 B<Note:> If the DNS resolution has already been successful when the socket
9842 closes, the plugin will try to reconnect immediately with the cached
9843 information. DNS is queried only when the socket is closed for a longer than
9844 I<ResolveInterval> + I<ResolveJitter> seconds.
9845
9846 =back
9847
9848 Inside the B<Node> blocks, the following options are recognized:
9849
9850 =over 4
9851
9852 =item B<Host> I<Address>
9853
9854 Hostname or address to connect to. Defaults to C<localhost>.
9855
9856 =item B<Port> I<Service>
9857
9858 Service name or port number to connect to. Defaults to C<4242>.
9859
9860
9861 =item B<HostTags> I<String>
9862
9863 When set, I<HostTags> is added to the end of the metric. It is intended to be
9864 used for name=value pairs that the TSD will tag the metric with. Dots and
9865 whitespace are I<not> escaped in this string.
9866
9867 =item B<StoreRates> B<false>|B<true>
9868
9869 If set to B<true>, convert counter values to rates. If set to B<false>
9870 (the default) counter values are stored as is, as an increasing
9871 integer number.
9872
9873 =item B<AlwaysAppendDS> B<false>|B<true>
9874
9875 If set the B<true>, append the name of the I<Data Source> (DS) to the "metric"
9876 identifier. If set to B<false> (the default), this is only done when there is
9877 more than one DS.
9878
9879 =back
9880
9881 =head2 Plugin C<write_mongodb>
9882
9883 The I<write_mongodb plugin> will send values to I<MongoDB>, a schema-less
9884 NoSQL database.
9885
9886 B<Synopsis:>
9887
9888  <Plugin "write_mongodb">
9889    <Node "default">
9890      Host "localhost"
9891      Port "27017"
9892      Timeout 1000
9893      StoreRates true
9894    </Node>
9895  </Plugin>
9896
9897 The plugin can send values to multiple instances of I<MongoDB> by specifying
9898 one B<Node> block for each instance. Within the B<Node> blocks, the following
9899 options are available:
9900
9901 =over 4
9902
9903 =item B<Host> I<Address>
9904
9905 Hostname or address to connect to. Defaults to C<localhost>.
9906
9907 =item B<Port> I<Service>
9908
9909 Service name or port number to connect to. Defaults to C<27017>.
9910
9911 =item B<Timeout> I<Milliseconds>
9912
9913 Set the timeout for each operation on I<MongoDB> to I<Timeout> milliseconds.
9914 Setting this option to zero means no timeout, which is the default.
9915
9916 =item B<StoreRates> B<false>|B<true>
9917
9918 If set to B<true> (the default), convert counter values to rates. If set to
9919 B<false> counter values are stored as is, i.e. as an increasing integer
9920 number.
9921
9922 =item B<Database> I<Database>
9923
9924 =item B<User> I<User>
9925
9926 =item B<Password> I<Password>
9927
9928 Sets the information used when authenticating to a I<MongoDB> database. The
9929 fields are optional (in which case no authentication is attempted), but if you
9930 want to use authentication all three fields must be set.
9931
9932 =back
9933
9934 =head2 Plugin C<write_prometheus>
9935
9936 The I<write_prometheus plugin> implements a tiny webserver that can be scraped
9937 using I<Prometheus>.
9938
9939 B<Options:>
9940
9941 =over 4
9942
9943 =item B<Host> I<Host>
9944
9945 Bind to the hostname / address I<Host>. By default, the plugin will bind to the
9946 "any" address, i.e. accept packets sent to any of the hosts addresses.
9947
9948 This option is supported only for libmicrohttpd newer than 0.9.0.
9949
9950 =item B<Port> I<Port>
9951
9952 Port the embedded webserver should listen on. Defaults to B<9103>.
9953
9954 =item B<StalenessDelta> I<Seconds>
9955
9956 Time in seconds after which I<Prometheus> considers a metric "stale" if it
9957 hasn't seen any update for it. This value must match the setting in Prometheus.
9958 It defaults to B<300> seconds (5 minutes), same as Prometheus.
9959
9960 B<Background:>
9961
9962 I<Prometheus> has a global setting, C<StalenessDelta>, which controls after
9963 which time a metric without updates is considered "stale". This setting
9964 effectively puts an upper limit on the interval in which metrics are reported.
9965
9966 When the I<write_prometheus plugin> encounters a metric with an interval
9967 exceeding this limit, it will inform you, the user, and provide the metric to
9968 I<Prometheus> B<without> a timestamp. That causes I<Prometheus> to consider the
9969 metric "fresh" each time it is scraped, with the time of the scrape being
9970 considered the time of the update. The result is that there appear more
9971 datapoints in I<Prometheus> than were actually created, but at least the metric
9972 doesn't disappear periodically.
9973
9974 =back
9975
9976 =head2 Plugin C<write_http>
9977
9978 This output plugin submits values to an HTTP server using POST requests and
9979 encoding metrics with JSON or using the C<PUTVAL> command described in
9980 L<collectd-unixsock(5)>.
9981
9982 Synopsis:
9983
9984  <Plugin "write_http">
9985    <Node "example">
9986      URL "http://example.com/post-collectd"
9987      User "collectd"
9988      Password "weCh3ik0"
9989      Format JSON
9990    </Node>
9991  </Plugin>
9992
9993 The plugin can send values to multiple HTTP servers by specifying one
9994 E<lt>B<Node>E<nbsp>I<Name>E<gt> block for each server. Within each B<Node>
9995 block, the following options are available:
9996
9997 =over 4
9998
9999 =item B<URL> I<URL>
10000
10001 URL to which the values are submitted to. Mandatory.
10002
10003 =item B<User> I<Username>
10004
10005 Optional user name needed for authentication.
10006
10007 =item B<Password> I<Password>
10008
10009 Optional password needed for authentication.
10010
10011 =item B<VerifyPeer> B<true>|B<false>
10012
10013 Enable or disable peer SSL certificate verification. See
10014 L<http://curl.haxx.se/docs/sslcerts.html> for details. Enabled by default.
10015
10016 =item B<VerifyHost> B<true|false>
10017
10018 Enable or disable peer host name verification. If enabled, the plugin checks if
10019 the C<Common Name> or a C<Subject Alternate Name> field of the SSL certificate
10020 matches the host name provided by the B<URL> option. If this identity check
10021 fails, the connection is aborted. Obviously, only works when connecting to a
10022 SSL enabled server. Enabled by default.
10023
10024 =item B<CACert> I<File>
10025
10026 File that holds one or more SSL certificates. If you want to use HTTPS you will
10027 possibly need this option. What CA certificates come bundled with C<libcurl>
10028 and are checked by default depends on the distribution you use.
10029
10030 =item B<CAPath> I<Directory>
10031
10032 Directory holding one or more CA certificate files. You can use this if for
10033 some reason all the needed CA certificates aren't in the same file and can't be
10034 pointed to using the B<CACert> option. Requires C<libcurl> to be built against
10035 OpenSSL.
10036
10037 =item B<ClientKey> I<File>
10038
10039 File that holds the private key in PEM format to be used for certificate-based
10040 authentication.
10041
10042 =item B<ClientCert> I<File>
10043
10044 File that holds the SSL certificate to be used for certificate-based
10045 authentication.
10046
10047 =item B<ClientKeyPass> I<Password>
10048
10049 Password required to load the private key in B<ClientKey>.
10050
10051 =item B<Header> I<Header>
10052
10053 A HTTP header to add to the request.  Multiple headers are added if this option is specified more than once.  Example:
10054
10055   Header "X-Custom-Header: custom_value"
10056
10057 =item B<SSLVersion> B<SSLv2>|B<SSLv3>|B<TLSv1>|B<TLSv1_0>|B<TLSv1_1>|B<TLSv1_2>
10058
10059 Define which SSL protocol version must be used. By default C<libcurl> will
10060 attempt to figure out the remote SSL protocol version. See
10061 L<curl_easy_setopt(3)> for more details.
10062
10063 =item B<Format> B<Command>|B<JSON>|B<KAIROSDB>
10064
10065 Format of the output to generate. If set to B<Command>, will create output that
10066 is understood by the I<Exec> and I<UnixSock> plugins. When set to B<JSON>, will
10067 create output in the I<JavaScript Object Notation> (JSON). When set to KAIROSDB
10068 , will create output in the KairosDB format.
10069
10070 Defaults to B<Command>.
10071
10072 =item B<Attribute> I<String> I<String>
10073
10074 Only available for the KAIROSDB output format.
10075
10076 Consider the two given strings to be the key and value of an additional tag for
10077 each metric being sent out.
10078
10079 You can add multiple B<Attribute>.
10080
10081 =item B<TTL> I<Int>
10082
10083 Only available for the KAIROSDB output format.
10084
10085 Sets the Cassandra ttl for the data points.
10086
10087 Please refer to L<http://kairosdb.github.io/docs/build/html/restapi/AddDataPoints.html?highlight=ttl>
10088
10089 =item B<Prefix> I<String>
10090
10091 Only available for the KAIROSDB output format.
10092
10093 Sets the metrics prefix I<string>. Defaults to I<collectd>.
10094
10095 =item B<Metrics> B<true>|B<false>
10096
10097 Controls whether I<metrics> are POSTed to this location. Defaults to B<true>.
10098
10099 =item B<Notifications> B<false>|B<true>
10100
10101 Controls whether I<notifications> are POSTed to this location. Defaults to B<false>.
10102
10103 =item B<StoreRates> B<true|false>
10104
10105 If set to B<true>, convert counter values to rates. If set to B<false> (the
10106 default) counter values are stored as is, i.e. as an increasing integer number.
10107
10108 =item B<BufferSize> I<Bytes>
10109
10110 Sets the send buffer size to I<Bytes>. By increasing this buffer, less HTTP
10111 requests will be generated, but more metrics will be batched / metrics are
10112 cached for longer before being sent, introducing additional delay until they
10113 are available on the server side. I<Bytes> must be at least 1024 and cannot
10114 exceed the size of an C<int>, i.e. 2E<nbsp>GByte.
10115 Defaults to C<4096>.
10116
10117 =item B<LowSpeedLimit> I<Bytes per Second>
10118
10119 Sets the minimal transfer rate in I<Bytes per Second> below which the
10120 connection with the HTTP server will be considered too slow and aborted. All
10121 the data submitted over this connection will probably be lost. Defaults to 0,
10122 which means no minimum transfer rate is enforced.
10123
10124 =item B<Timeout> I<Timeout>
10125
10126 Sets the maximum time in milliseconds given for HTTP POST operations to
10127 complete. When this limit is reached, the POST operation will be aborted, and
10128 all the data in the current send buffer will probably be lost. Defaults to 0,
10129 which means the connection never times out.
10130
10131 =item B<LogHttpError> B<false>|B<true>
10132
10133 Enables printing of HTTP error code to log. Turned off by default.
10134
10135 The C<write_http> plugin regularly submits the collected values to the HTTP
10136 server. How frequently this happens depends on how much data you are collecting
10137 and the size of B<BufferSize>. The optimal value to set B<Timeout> to is
10138 slightly below this interval, which you can estimate by monitoring the network
10139 traffic between collectd and the HTTP server.
10140
10141 =back
10142
10143 =head2 Plugin C<write_kafka>
10144
10145 The I<write_kafka plugin> will send values to a I<Kafka> topic, a distributed
10146 queue.
10147 Synopsis:
10148
10149  <Plugin "write_kafka">
10150    Property "metadata.broker.list" "broker1:9092,broker2:9092"
10151    <Topic "collectd">
10152      Format JSON
10153    </Topic>
10154  </Plugin>
10155
10156 The following options are understood by the I<write_kafka plugin>:
10157
10158 =over 4
10159
10160 =item E<lt>B<Topic> I<Name>E<gt>
10161
10162 The plugin's configuration consists of one or more B<Topic> blocks. Each block
10163 is given a unique I<Name> and specifies one kafka producer.
10164 Inside the B<Topic> block, the following per-topic options are
10165 understood:
10166
10167 =over 4
10168
10169 =item B<Property> I<String> I<String>
10170
10171 Configure the named property for the current topic. Properties are
10172 forwarded to the kafka producer library B<librdkafka>.
10173
10174 =item B<Key> I<String>
10175
10176 Use the specified string as a partitioning key for the topic. Kafka breaks
10177 topic into partitions and guarantees that for a given topology, the same
10178 consumer will be used for a specific key. The special (case insensitive)
10179 string B<Random> can be used to specify that an arbitrary partition should
10180 be used.
10181
10182 =item B<Format> B<Command>|B<JSON>|B<Graphite>
10183
10184 Selects the format in which messages are sent to the broker. If set to
10185 B<Command> (the default), values are sent as C<PUTVAL> commands which are
10186 identical to the syntax used by the I<Exec> and I<UnixSock plugins>.
10187
10188 If set to B<JSON>, the values are encoded in the I<JavaScript Object Notation>,
10189 an easy and straight forward exchange format.
10190
10191 If set to B<Graphite>, values are encoded in the I<Graphite> format, which is
10192 C<E<lt>metricE<gt> E<lt>valueE<gt> E<lt>timestampE<gt>\n>.
10193
10194 =item B<StoreRates> B<true>|B<false>
10195
10196 Determines whether or not C<COUNTER>, C<DERIVE> and C<ABSOLUTE> data sources
10197 are converted to a I<rate> (i.e. a C<GAUGE> value). If set to B<false> (the
10198 default), no conversion is performed. Otherwise the conversion is performed
10199 using the internal value cache.
10200
10201 Please note that currently this option is only used if the B<Format> option has
10202 been set to B<JSON>.
10203
10204 =item B<GraphitePrefix> (B<Format>=I<Graphite> only)
10205
10206 A prefix can be added in the metric name when outputting in the I<Graphite>
10207 format.
10208
10209 When B<GraphiteUseTags> is I<false>, prefix is added before the I<Host> name.
10210 Metric name will be
10211 C<E<lt>prefixE<gt>E<lt>hostE<gt>E<lt>postfixE<gt>E<lt>pluginE<gt>E<lt>typeE<gt>E<lt>nameE<gt>>
10212
10213 When B<GraphiteUseTags> is I<true>, prefix is added in front of series name.
10214
10215 =item B<GraphitePostfix> (B<Format>=I<Graphite> only)
10216
10217 A postfix can be added in the metric name when outputting in the I<Graphite>
10218 format.
10219
10220 When B<GraphiteUseTags> is I<false>, postfix is added after the I<Host> name.
10221 Metric name will be
10222 C<E<lt>prefixE<gt>E<lt>hostE<gt>E<lt>postfixE<gt>E<lt>pluginE<gt>E<lt>typeE<gt>E<lt>nameE<gt>>
10223
10224 When B<GraphiteUseTags> is I<true>, prefix value appended to the end of series
10225 name (before the first ; that separates the name from the tags).
10226
10227 =item B<GraphiteEscapeChar> (B<Format>=I<Graphite> only)
10228
10229 Specify a character to replace dots (.) in the host part of the metric name.
10230 In I<Graphite> metric name, dots are used as separators between different
10231 metric parts (host, plugin, type).
10232 Default is C<_> (I<Underscore>).
10233
10234 =item B<GraphiteSeparateInstances> B<false>|B<true>
10235
10236 If set to B<true>, the plugin instance and type instance will be in their own
10237 path component, for example C<host.cpu.0.cpu.idle>. If set to B<false> (the
10238 default), the plugin and plugin instance (and likewise the type and type
10239 instance) are put into one component, for example C<host.cpu-0.cpu-idle>.
10240
10241 Option value is not used when B<GraphiteUseTags> is I<true>.
10242
10243 =item B<GraphiteAlwaysAppendDS> B<true>|B<false>
10244
10245 If set to B<true>, append the name of the I<Data Source> (DS) to the "metric"
10246 identifier. If set to B<false> (the default), this is only done when there is
10247 more than one DS.
10248
10249 =item B<GraphitePreserveSeparator> B<false>|B<true>
10250
10251 If set to B<false> (the default) the C<.> (dot) character is replaced with
10252 I<GraphiteEscapeChar>. Otherwise, if set to B<true>, the C<.> (dot) character
10253 is preserved, i.e. passed through.
10254
10255 Option value is not used when B<GraphiteUseTags> is I<true>.
10256
10257 =item B<GraphiteUseTags> B<false>|B<true>
10258
10259 If set to B<true> Graphite metric names will be generated as tagged series.
10260
10261 Default value: B<false>.
10262
10263 =item B<StoreRates> B<true>|B<false>
10264
10265 If set to B<true> (the default), convert counter values to rates. If set to
10266 B<false> counter values are stored as is, i.e. as an increasing integer number.
10267
10268 This will be reflected in the C<ds_type> tag: If B<StoreRates> is enabled,
10269 converted values will have "rate" appended to the data source type, e.g.
10270 C<ds_type:derive:rate>.
10271
10272 =back
10273
10274 =item B<Property> I<String> I<String>
10275
10276 Configure the kafka producer through properties, you almost always will
10277 want to set B<metadata.broker.list> to your Kafka broker list.
10278
10279 =back
10280
10281 =head2 Plugin C<write_redis>
10282
10283 The I<write_redis plugin> submits values to I<Redis>, a data structure server.
10284
10285 Synopsis:
10286
10287   <Plugin "write_redis">
10288     <Node "example">
10289         Host "localhost"
10290         Port "6379"
10291         Timeout 1000
10292         Prefix "collectd/"
10293         Database 1
10294         MaxSetSize -1
10295         MaxSetDuration -1
10296         StoreRates true
10297     </Node>
10298   </Plugin>
10299
10300 Values are submitted to I<Sorted Sets>, using the metric name as the key, and
10301 the timestamp as the score. Retrieving a date range can then be done using the
10302 C<ZRANGEBYSCORE> I<Redis> command. Additionally, all the identifiers of these
10303 I<Sorted Sets> are kept in a I<Set> called C<collectd/values> (or
10304 C<${prefix}/values> if the B<Prefix> option was specified) and can be retrieved
10305 using the C<SMEMBERS> I<Redis> command. You can specify the database to use
10306 with the B<Database> parameter (default is C<0>). See
10307 L<http://redis.io/commands#sorted_set> and L<http://redis.io/commands#set> for
10308 details.
10309
10310 The information shown in the synopsis above is the I<default configuration>
10311 which is used by the plugin if no configuration is present.
10312
10313 The plugin can send values to multiple instances of I<Redis> by specifying
10314 one B<Node> block for each instance. Within the B<Node> blocks, the following
10315 options are available:
10316
10317 =over 4
10318
10319 =item B<Node> I<Nodename>
10320
10321 The B<Node> block identifies a new I<Redis> node, that is a new I<Redis>
10322 instance running on a specified host and port. The node name is a
10323 canonical identifier which is used as I<plugin instance>. It is limited to
10324 51E<nbsp>characters in length.
10325
10326 =item B<Host> I<Hostname>
10327
10328 The B<Host> option is the hostname or IP-address where the I<Redis> instance is
10329 running on.
10330
10331 =item B<Port> I<Port>
10332
10333 The B<Port> option is the TCP port on which the Redis instance accepts
10334 connections. Either a service name of a port number may be given. Please note
10335 that numerical port numbers must be given as a string, too.
10336
10337 =item B<Timeout> I<Milliseconds>
10338
10339 The B<Timeout> option sets the socket connection timeout, in milliseconds.
10340
10341 =item B<Prefix> I<Prefix>
10342
10343 Prefix used when constructing the name of the I<Sorted Sets> and the I<Set>
10344 containing all metrics. Defaults to C<collectd/>, so metrics will have names
10345 like C<collectd/cpu-0/cpu-user>. When setting this to something different, it
10346 is recommended but not required to include a trailing slash in I<Prefix>.
10347
10348 =item B<Database> I<Index>
10349
10350 This index selects the redis database to use for writing operations. Defaults
10351 to C<0>.
10352
10353 =item B<MaxSetSize> I<Items>
10354
10355 The B<MaxSetSize> option limits the number of items that the I<Sorted Sets> can
10356 hold. Negative values for I<Items> sets no limit, which is the default behavior.
10357
10358 =item B<MaxSetDuration> I<Seconds>
10359
10360 The B<MaxSetDuration> option limits the duration of items that the
10361 I<Sorted Sets> can hold. Negative values for I<Items> sets no duration, which
10362 is the default behavior.
10363
10364 =item B<StoreRates> B<true>|B<false>
10365
10366 If set to B<true> (the default), convert counter values to rates. If set to
10367 B<false> counter values are stored as is, i.e. as an increasing integer number.
10368
10369 =back
10370
10371 =head2 Plugin C<write_riemann>
10372
10373 The I<write_riemann plugin> will send values to I<Riemann>, a powerful stream
10374 aggregation and monitoring system. The plugin sends I<Protobuf> encoded data to
10375 I<Riemann> using UDP packets.
10376
10377 Synopsis:
10378
10379  <Plugin "write_riemann">
10380    <Node "example">
10381      Host "localhost"
10382      Port "5555"
10383      Protocol UDP
10384      StoreRates true
10385      AlwaysAppendDS false
10386      TTLFactor 2.0
10387    </Node>
10388    Tag "foobar"
10389    Attribute "foo" "bar"
10390  </Plugin>
10391
10392 The following options are understood by the I<write_riemann plugin>:
10393
10394 =over 4
10395
10396 =item E<lt>B<Node> I<Name>E<gt>
10397
10398 The plugin's configuration consists of one or more B<Node> blocks. Each block
10399 is given a unique I<Name> and specifies one connection to an instance of
10400 I<Riemann>. Indise the B<Node> block, the following per-connection options are
10401 understood:
10402
10403 =over 4
10404
10405 =item B<Host> I<Address>
10406
10407 Hostname or address to connect to. Defaults to C<localhost>.
10408
10409 =item B<Port> I<Service>
10410
10411 Service name or port number to connect to. Defaults to C<5555>.
10412
10413 =item B<Protocol> B<UDP>|B<TCP>|B<TLS>
10414
10415 Specify the protocol to use when communicating with I<Riemann>. Defaults to
10416 B<TCP>.
10417
10418 =item B<TLSCertFile> I<Path>
10419
10420 When using the B<TLS> protocol, path to a PEM certificate to present
10421 to remote host.
10422
10423 =item B<TLSCAFile> I<Path>
10424
10425 When using the B<TLS> protocol, path to a PEM CA certificate to
10426 use to validate the remote hosts's identity.
10427
10428 =item B<TLSKeyFile> I<Path>
10429
10430 When using the B<TLS> protocol, path to a PEM private key associated
10431 with the certificate defined by B<TLSCertFile>.
10432
10433 =item B<Batch> B<true>|B<false>
10434
10435 If set to B<true> and B<Protocol> is set to B<TCP>,
10436 events will be batched in memory and flushed at
10437 regular intervals or when B<BatchMaxSize> is exceeded.
10438
10439 Notifications are not batched and sent as soon as possible.
10440
10441 When enabled, it can occur that events get processed by the Riemann server
10442 close to or after their expiration time. Tune the B<TTLFactor> and
10443 B<BatchMaxSize> settings according to the amount of values collected, if this
10444 is an issue.
10445
10446 Defaults to true
10447
10448 =item B<BatchMaxSize> I<size>
10449
10450 Maximum payload size for a riemann packet. Defaults to 8192
10451
10452 =item B<BatchFlushTimeout> I<seconds>
10453
10454 Maximum amount of seconds to wait in between to batch flushes.
10455 No timeout by default.
10456
10457 =item B<StoreRates> B<true>|B<false>
10458
10459 If set to B<true> (the default), convert counter values to rates. If set to
10460 B<false> counter values are stored as is, i.e. as an increasing integer number.
10461
10462 This will be reflected in the C<ds_type> tag: If B<StoreRates> is enabled,
10463 converted values will have "rate" appended to the data source type, e.g.
10464 C<ds_type:derive:rate>.
10465
10466 =item B<AlwaysAppendDS> B<false>|B<true>
10467
10468 If set to B<true>, append the name of the I<Data Source> (DS) to the
10469 "service", i.e. the field that, together with the "host" field, uniquely
10470 identifies a metric in I<Riemann>. If set to B<false> (the default), this is
10471 only done when there is more than one DS.
10472
10473 =item B<TTLFactor> I<Factor>
10474
10475 I<Riemann> events have a I<Time to Live> (TTL) which specifies how long each
10476 event is considered active. I<collectd> populates this field based on the
10477 metrics interval setting. This setting controls the factor with which the
10478 interval is multiplied to set the TTL. The default value is B<2.0>. Unless you
10479 know exactly what you're doing, you should only increase this setting from its
10480 default value.
10481
10482 =item B<Notifications> B<false>|B<true>
10483
10484 If set to B<true>, create riemann events for notifications. This is B<true>
10485 by default. When processing thresholds from write_riemann, it might prove
10486 useful to avoid getting notification events.
10487
10488 =item B<CheckThresholds> B<false>|B<true>
10489
10490 If set to B<true>, attach state to events based on thresholds defined
10491 in the B<Threshold> plugin. Defaults to B<false>.
10492
10493 =item B<EventServicePrefix> I<String>
10494
10495 Add the given string as a prefix to the event service name.
10496 If B<EventServicePrefix> not set or set to an empty string (""),
10497 no prefix will be used.
10498
10499 =back
10500
10501 =item B<Tag> I<String>
10502
10503 Add the given string as an additional tag to the metric being sent to
10504 I<Riemann>.
10505
10506 =item B<Attribute> I<String> I<String>
10507
10508 Consider the two given strings to be the key and value of an additional
10509 attribute for each metric being sent out to I<Riemann>.
10510
10511 =back
10512
10513 =head2 Plugin C<write_sensu>
10514
10515 The I<write_sensu plugin> will send values to I<Sensu>, a powerful stream
10516 aggregation and monitoring system. The plugin sends I<JSON> encoded data to
10517 a local I<Sensu> client using a TCP socket.
10518
10519 At the moment, the I<write_sensu plugin> does not send over a collectd_host
10520 parameter so it is not possible to use one collectd instance as a gateway for
10521 others. Each collectd host must pair with one I<Sensu> client.
10522
10523 Synopsis:
10524
10525  <Plugin "write_sensu">
10526    <Node "example">
10527      Host "localhost"
10528      Port "3030"
10529      StoreRates true
10530      AlwaysAppendDS false
10531      MetricHandler "influx"
10532      MetricHandler "default"
10533      NotificationHandler "flapjack"
10534      NotificationHandler "howling_monkey"
10535      Notifications true
10536    </Node>
10537    Tag "foobar"
10538    Attribute "foo" "bar"
10539  </Plugin>
10540
10541 The following options are understood by the I<write_sensu plugin>:
10542
10543 =over 4
10544
10545 =item E<lt>B<Node> I<Name>E<gt>
10546
10547 The plugin's configuration consists of one or more B<Node> blocks. Each block
10548 is given a unique I<Name> and specifies one connection to an instance of
10549 I<Sensu>. Inside the B<Node> block, the following per-connection options are
10550 understood:
10551
10552 =over 4
10553
10554 =item B<Host> I<Address>
10555
10556 Hostname or address to connect to. Defaults to C<localhost>.
10557
10558 =item B<Port> I<Service>
10559
10560 Service name or port number to connect to. Defaults to C<3030>.
10561
10562 =item B<StoreRates> B<true>|B<false>
10563
10564 If set to B<true> (the default), convert counter values to rates. If set to
10565 B<false> counter values are stored as is, i.e. as an increasing integer number.
10566
10567 This will be reflected in the C<collectd_data_source_type> tag: If
10568 B<StoreRates> is enabled, converted values will have "rate" appended to the
10569 data source type, e.g.  C<collectd_data_source_type:derive:rate>.
10570
10571 =item B<AlwaysAppendDS> B<false>|B<true>
10572
10573 If set the B<true>, append the name of the I<Data Source> (DS) to the
10574 "service", i.e. the field that, together with the "host" field, uniquely
10575 identifies a metric in I<Sensu>. If set to B<false> (the default), this is
10576 only done when there is more than one DS.
10577
10578 =item B<Notifications> B<false>|B<true>
10579
10580 If set to B<true>, create I<Sensu> events for notifications. This is B<false>
10581 by default. At least one of B<Notifications> or B<Metrics> should be enabled.
10582
10583 =item B<Metrics> B<false>|B<true>
10584
10585 If set to B<true>, create I<Sensu> events for metrics. This is B<false>
10586 by default. At least one of B<Notifications> or B<Metrics> should be enabled.
10587
10588
10589 =item B<Separator> I<String>
10590
10591 Sets the separator for I<Sensu> metrics name or checks. Defaults to "/".
10592
10593 =item B<MetricHandler> I<String>
10594
10595 Add a handler that will be set when metrics are sent to I<Sensu>. You can add
10596 several of them, one per line. Defaults to no handler.
10597
10598 =item B<NotificationHandler> I<String>
10599
10600 Add a handler that will be set when notifications are sent to I<Sensu>. You can
10601 add several of them, one per line. Defaults to no handler.
10602
10603 =item B<EventServicePrefix> I<String>
10604
10605 Add the given string as a prefix to the event service name.
10606 If B<EventServicePrefix> not set or set to an empty string (""),
10607 no prefix will be used.
10608
10609 =back
10610
10611 =item B<Tag> I<String>
10612
10613 Add the given string as an additional tag to the metric being sent to
10614 I<Sensu>.
10615
10616 =item B<Attribute> I<String> I<String>
10617
10618 Consider the two given strings to be the key and value of an additional
10619 attribute for each metric being sent out to I<Sensu>.
10620
10621 =back
10622
10623 =head2 Plugin C<write_stackdriver>
10624
10625 The C<write_stackdriver> plugin writes metrics to the
10626 I<Google Stackdriver Monitoring> service.
10627
10628 This plugin supports two authentication methods: When configured, credentials
10629 are read from the JSON credentials file specified with B<CredentialFile>.
10630 Alternatively, when running on
10631 I<Google Compute Engine> (GCE), an I<OAuth> token is retrieved from the
10632 I<metadata server> and used to authenticate to GCM.
10633
10634 B<Synopsis:>
10635
10636  <Plugin write_stackdriver>
10637    CredentialFile "/path/to/service_account.json"
10638    <Resource "global">
10639      Label "project_id" "monitored_project"
10640    </Resource>
10641  </Plugin>
10642
10643 =over 4
10644
10645 =item B<CredentialFile> I<file>
10646
10647 Path to a JSON credentials file holding the credentials for a GCP service
10648 account.
10649
10650 If B<CredentialFile> is not specified, the plugin uses I<Application Default
10651 Credentials>. That means which credentials are used depends on the environment:
10652
10653 =over 4
10654
10655 =item
10656
10657 The environment variable C<GOOGLE_APPLICATION_CREDENTIALS> is checked. If this
10658 variable is specified it should point to a JSON file that defines the
10659 credentials.
10660
10661 =item
10662
10663 The path C<${HOME}/.config/gcloud/application_default_credentials.json> is
10664 checked. This where credentials used by the I<gcloud> command line utility are
10665 stored. You can use C<gcloud auth application-default login> to create these
10666 credentials.
10667
10668 Please note that these credentials are often of your personal account, not a
10669 service account, and are therefore unfit to be used in a production
10670 environment.
10671
10672 =item
10673
10674 When running on GCE, the built-in service account associated with the virtual
10675 machine instance is used.
10676 See also the B<Email> option below.
10677
10678 =back
10679
10680 =item B<Project> I<Project>
10681
10682 The I<Project ID> or the I<Project Number> of the I<Stackdriver Account>. The
10683 I<Project ID> is a string identifying the GCP project, which you can chose
10684 freely when creating a new project. The I<Project Number> is a 12-digit decimal
10685 number. You can look up both on the I<Developer Console>.
10686
10687 This setting is optional. If not set, the project ID is read from the
10688 credentials file or determined from the GCE's metadata service.
10689
10690 =item B<Email> I<Email> (GCE only)
10691
10692 Choses the GCE I<Service Account> used for authentication.
10693
10694 Each GCE instance has a C<default> I<Service Account> but may also be
10695 associated with additional I<Service Accounts>. This is often used to restrict
10696 the permissions of services running on the GCE instance to the required
10697 minimum. The I<write_stackdriver plugin> requires the
10698 C<https://www.googleapis.com/auth/monitoring> scope. When multiple I<Service
10699 Accounts> are available, this option selects which one is used by
10700 I<write_stackdriver plugin>.
10701
10702 =item B<Resource> I<ResourceType>
10703
10704 Configures the I<Monitored Resource> to use when storing metrics.
10705 More information on I<Monitored Resources> and I<Monitored Resource Types> are
10706 available at L<https://cloud.google.com/monitoring/api/resources>.
10707
10708 This block takes one string argument, the I<ResourceType>. Inside the block are
10709 one or more B<Label> options which configure the resource labels.
10710
10711 This block is optional. The default value depends on the runtime environment:
10712 on GCE, the C<gce_instance> resource type is used, otherwise the C<global>
10713 resource type ist used:
10714
10715 =over 4
10716
10717 =item
10718
10719 B<On GCE>, defaults to the equivalent of this config:
10720
10721   <Resource "gce_instance">
10722     Label "project_id" "<project_id>"
10723     Label "instance_id" "<instance_id>"
10724     Label "zone" "<zone>"
10725   </Resource>
10726
10727 The values for I<project_id>, I<instance_id> and I<zone> are read from the GCE
10728 metadata service.
10729
10730 =item
10731
10732 B<Elsewhere>, i.e. not on GCE, defaults to the equivalent of this config:
10733
10734   <Resource "global">
10735     Label "project_id" "<Project>"
10736   </Resource>
10737
10738 Where I<Project> refers to the value of the B<Project> option or the project ID
10739 inferred from the B<CredentialFile>.
10740
10741 =back
10742
10743 =item B<Url> I<Url>
10744
10745 URL of the I<Stackdriver Monitoring> API. Defaults to
10746 C<https://monitoring.googleapis.com/v3>.
10747
10748 =back
10749
10750 =head2 Plugin C<write_syslog>
10751
10752 The C<write_syslog> plugin writes data in I<syslog> format log messages.
10753 It implements the basic syslog protocol, RFC 5424, extends it with
10754 content-based filtering, rich filtering capabilities,
10755 flexible configuration options and adds features such as using TCP for transport.
10756 The plugin can connect to a I<Syslog> daemon, like syslog-ng and rsyslog, that will
10757 ingest metrics, transform and ship them to the specified output.
10758 The plugin uses I<TCP> over the "line based" protocol with a default port 44514.
10759 The data will be sent in blocks of at most 1428 bytes to minimize the number of
10760 network packets.
10761
10762 Synopsis:
10763
10764  <Plugin write_syslog>
10765    ResolveInterval 60
10766    ResolveJitter 60
10767    <Node "example">
10768      Host "syslog-1.my.domain"
10769      Port "44514"
10770      Prefix "collectd"
10771      MessageFormat "human"
10772      HostTags ""
10773    </Node>
10774  </Plugin>
10775
10776 The configuration consists of one or more E<lt>B<Node>E<nbsp>I<Name>E<gt>
10777 blocks and global directives.
10778
10779 Global directives are:
10780
10781 =over 4
10782
10783 =item B<ResolveInterval> I<seconds>
10784
10785 =item B<ResolveJitter> I<seconds>
10786
10787 When I<collectd> connects to a syslog node, it will request the hostname from
10788 DNS. This can become a problem if the syslog node is unavailable or badly
10789 configured because collectd will request DNS in order to reconnect for every
10790 metric, which can flood your DNS. So you can cache the last value for
10791 I<ResolveInterval> seconds.
10792 Defaults to the I<Interval> of the I<write_syslog plugin>, e.g. 10E<nbsp>seconds.
10793
10794 You can also define a jitter, a random interval to wait in addition to
10795 I<ResolveInterval>. This prevents all your collectd servers to resolve the
10796 hostname at the same time when the connection fails.
10797 Defaults to the I<Interval> of the I<write_syslog plugin>, e.g. 10E<nbsp>seconds.
10798
10799 B<Note:> If the DNS resolution has already been successful when the socket
10800 closes, the plugin will try to reconnect immediately with the cached
10801 information. DNS is queried only when the socket is closed for a longer than
10802 I<ResolveInterval> + I<ResolveJitter> seconds.
10803
10804 =back
10805
10806 Inside the B<Node> blocks, the following options are recognized:
10807
10808 =over 4
10809
10810 =item B<Host> I<Address>
10811
10812 Hostname or address to connect to. Defaults to C<localhost>.
10813
10814 =item B<Port> I<Service>
10815
10816 Service name or port number to connect to. Defaults to C<44514>.
10817
10818
10819 =item B<HostTags> I<String>
10820
10821 When set, I<HostTags> is added to the end of the metric.
10822 It is intended to be used for adding additional metadata to tag the metric with.
10823 Dots and whitespace are I<not> escaped in this string.
10824
10825 Examples:
10826
10827 When MessageFormat is set to "human".
10828
10829   ["prefix1" "example1"="example1_v"]["prefix2" "example2"="example2_v"]"
10830
10831 When MessageFormat is set to "JSON", text should be in JSON format.
10832 Escaping the quotation marks is required.
10833
10834   HostTags "\"prefix1\": {\"example1\":\"example1_v\",\"example2\":\"example2_v\"}"
10835
10836 =item B<MessageFormat> I<String>
10837
10838 I<MessageFormat> selects the format in which messages are sent to the
10839 syslog deamon, human or JSON. Defaults to human.
10840
10841 Syslog message format:
10842
10843 <priority>VERSION ISOTIMESTAMP HOSTNAME APPLICATION PID MESSAGEID STRUCTURED-DATA MSG
10844
10845 The difference between the message formats are in the STRUCTURED-DATA and MSG parts.
10846
10847 Human format:
10848
10849   <166>1 ISOTIMESTAMP HOSTNAME collectd PID MESSAGEID
10850   ["collectd" "value": "v1" "plugin"="plugin_v" "plugin_instance"="plugin_instance_v"
10851   "type_instance"="type_instance_v" "type"="type_v" "ds_name"="ds_name_v" "interval"="interval_v" ]
10852   "host_tag_example"="host_tag_example_v" plugin_v.type_v.ds_name_v="v1"
10853
10854 JSON format:
10855
10856   <166>1 ISOTIMESTAMP HOSTNAME collectd PID MESSAGEID STRUCTURED-DATA
10857   {
10858     "collectd": {
10859     "time": time_as_epoch, "interval": interval_v, "plugin": "plugin_v",
10860     "plugin_instance": "plugin_instance_v", "type":"type_v",
10861     "type_instance": "type_instance_v", "plugin_v": {"type_v": v1}
10862     } , "host":"host_v", "host_tag_example": "host_tag_example_v"
10863   }
10864
10865 =item B<StoreRates> B<false>|B<true>
10866
10867 If set to B<true>, convert counter values to rates. If set to B<false>
10868 (the default) counter values are stored as is, as an increasing
10869 integer number.
10870
10871 =item B<AlwaysAppendDS> B<false>|B<true>
10872
10873 If set to B<true>, append the name of the I<Data Source> (DS) to the "metric"
10874 identifier. If set to B<false> (the default), this is only done when there is
10875 more than one DS.
10876
10877 =item B<Prefix> I<String>
10878
10879 When set, I<Prefix> is added to all metrics names as a prefix. It is intended in
10880 case you want to be able to define the source of the specific metric. Dots and
10881 whitespace are I<not> escaped in this string.
10882
10883 =back
10884
10885 =head2 Plugin C<xencpu>
10886
10887 This plugin collects metrics of hardware CPU load for machine running Xen
10888 hypervisor. Load is calculated from 'idle time' value, provided by Xen.
10889 Result is reported using the C<percent> type, for each CPU (core).
10890
10891 This plugin doesn't have any options (yet).
10892
10893 =head2 Plugin C<zookeeper>
10894
10895 The I<zookeeper plugin> will collect statistics from a I<Zookeeper> server
10896 using the mntr command.  It requires Zookeeper 3.4.0+ and access to the
10897 client port.
10898
10899 B<Synopsis:>
10900
10901  <Plugin "zookeeper">
10902    Host "127.0.0.1"
10903    Port "2181"
10904  </Plugin>
10905
10906 =over 4
10907
10908 =item B<Host> I<Address>
10909
10910 Hostname or address to connect to. Defaults to C<localhost>.
10911
10912 =item B<Port> I<Service>
10913
10914 Service name or port number to connect to. Defaults to C<2181>.
10915
10916 =back
10917
10918 =head1 THRESHOLD CONFIGURATION
10919
10920 Starting with version C<4.3.0> collectd has support for B<monitoring>. By that
10921 we mean that the values are not only stored or sent somewhere, but that they
10922 are judged and, if a problem is recognized, acted upon. The only action
10923 collectd takes itself is to generate and dispatch a "notification". Plugins can
10924 register to receive notifications and perform appropriate further actions.
10925
10926 Since systems and what you expect them to do differ a lot, you can configure
10927 B<thresholds> for your values freely. This gives you a lot of flexibility but
10928 also a lot of responsibility.
10929
10930 Every time a value is out of range a notification is dispatched. This means
10931 that the idle percentage of your CPU needs to be less then the configured
10932 threshold only once for a notification to be generated. There's no such thing
10933 as a moving average or similar - at least not now.
10934
10935 Also, all values that match a threshold are considered to be relevant or
10936 "interesting". As a consequence collectd will issue a notification if they are
10937 not received for B<Timeout> iterations. The B<Timeout> configuration option is
10938 explained in section L<"GLOBAL OPTIONS">. If, for example, B<Timeout> is set to
10939 "2" (the default) and some hosts sends it's CPU statistics to the server every
10940 60 seconds, a notification will be dispatched after about 120 seconds. It may
10941 take a little longer because the timeout is checked only once each B<Interval>
10942 on the server.
10943
10944 When a value comes within range again or is received after it was missing, an
10945 "OKAY-notification" is dispatched.
10946
10947 Here is a configuration example to get you started. Read below for more
10948 information.
10949
10950  <Plugin threshold>
10951    <Type "foo">
10952      WarningMin    0.00
10953      WarningMax 1000.00
10954      FailureMin    0.00
10955      FailureMax 1200.00
10956      Invert false
10957      Instance "bar"
10958    </Type>
10959
10960    <Plugin "interface">
10961      Instance "eth0"
10962      <Type "if_octets">
10963        FailureMax 10000000
10964        DataSource "rx"
10965      </Type>
10966    </Plugin>
10967
10968    <Host "hostname">
10969      <Type "cpu">
10970        Instance "idle"
10971        FailureMin 10
10972      </Type>
10973
10974      <Plugin "memory">
10975        <Type "memory">
10976          Instance "cached"
10977          WarningMin 100000000
10978        </Type>
10979      </Plugin>
10980    </Host>
10981  </Plugin>
10982
10983 There are basically two types of configuration statements: The C<Host>,
10984 C<Plugin>, and C<Type> blocks select the value for which a threshold should be
10985 configured. The C<Plugin> and C<Type> blocks may be specified further using the
10986 C<Instance> option. You can combine the block by nesting the blocks, though
10987 they must be nested in the above order, i.E<nbsp>e. C<Host> may contain either
10988 C<Plugin> and C<Type> blocks, C<Plugin> may only contain C<Type> blocks and
10989 C<Type> may not contain other blocks. If multiple blocks apply to the same
10990 value the most specific block is used.
10991
10992 The other statements specify the threshold to configure. They B<must> be
10993 included in a C<Type> block. Currently the following statements are recognized:
10994
10995 =over 4
10996
10997 =item B<FailureMax> I<Value>
10998
10999 =item B<WarningMax> I<Value>
11000
11001 Sets the upper bound of acceptable values. If unset defaults to positive
11002 infinity. If a value is greater than B<FailureMax> a B<FAILURE> notification
11003 will be created. If the value is greater than B<WarningMax> but less than (or
11004 equal to) B<FailureMax> a B<WARNING> notification will be created.
11005
11006 =item B<FailureMin> I<Value>
11007
11008 =item B<WarningMin> I<Value>
11009
11010 Sets the lower bound of acceptable values. If unset defaults to negative
11011 infinity. If a value is less than B<FailureMin> a B<FAILURE> notification will
11012 be created. If the value is less than B<WarningMin> but greater than (or equal
11013 to) B<FailureMin> a B<WARNING> notification will be created.
11014
11015 =item B<DataSource> I<DSName>
11016
11017 Some data sets have more than one "data source". Interesting examples are the
11018 C<if_octets> data set, which has received (C<rx>) and sent (C<tx>) bytes and
11019 the C<disk_ops> data set, which holds C<read> and C<write> operations. The
11020 system load data set, C<load>, even has three data sources: C<shortterm>,
11021 C<midterm>, and C<longterm>.
11022
11023 Normally, all data sources are checked against a configured threshold. If this
11024 is undesirable, or if you want to specify different limits for each data
11025 source, you can use the B<DataSource> option to have a threshold apply only to
11026 one data source.
11027
11028 =item B<Invert> B<true>|B<false>
11029
11030 If set to B<true> the range of acceptable values is inverted, i.E<nbsp>e.
11031 values between B<FailureMin> and B<FailureMax> (B<WarningMin> and
11032 B<WarningMax>) are not okay. Defaults to B<false>.
11033
11034 =item B<Persist> B<true>|B<false>
11035
11036 Sets how often notifications are generated. If set to B<true> one notification
11037 will be generated for each value that is out of the acceptable range. If set to
11038 B<false> (the default) then a notification is only generated if a value is out
11039 of range but the previous value was okay.
11040
11041 This applies to missing values, too: If set to B<true> a notification about a
11042 missing value is generated once every B<Interval> seconds. If set to B<false>
11043 only one such notification is generated until the value appears again.
11044
11045 =item B<Percentage> B<true>|B<false>
11046
11047 If set to B<true>, the minimum and maximum values given are interpreted as
11048 percentage value, relative to the other data sources. This is helpful for
11049 example for the "df" type, where you may want to issue a warning when less than
11050 5E<nbsp>% of the total space is available. Defaults to B<false>.
11051
11052 =item B<Hits> I<Number>
11053
11054 Delay creating the notification until the threshold has been passed I<Number>
11055 times. When a notification has been generated, or when a subsequent value is
11056 inside the threshold, the counter is reset. If, for example, a value is
11057 collected once every 10E<nbsp>seconds and B<Hits> is set to 3, a notification
11058 will be dispatched at most once every 30E<nbsp>seconds.
11059
11060 This is useful when short bursts are not a problem. If, for example, 100% CPU
11061 usage for up to a minute is normal (and data is collected every
11062 10E<nbsp>seconds), you could set B<Hits> to B<6> to account for this.
11063
11064 =item B<Hysteresis> I<Number>
11065
11066 When set to non-zero, a hysteresis value is applied when checking minimum and
11067 maximum bounds. This is useful for values that increase slowly and fluctuate a
11068 bit while doing so. When these values come close to the threshold, they may
11069 "flap", i.e. switch between failure / warning case and okay case repeatedly.
11070
11071 If, for example, the threshold is configures as
11072
11073   WarningMax 100.0
11074   Hysteresis 1.0
11075
11076 then a I<Warning> notification is created when the value exceeds I<101> and the
11077 corresponding I<Okay> notification is only created once the value falls below
11078 I<99>, thus avoiding the "flapping".
11079
11080 =back
11081
11082 =head1 FILTER CONFIGURATION
11083
11084 Starting with collectd 4.6 there is a powerful filtering infrastructure
11085 implemented in the daemon. The concept has mostly been copied from
11086 I<ip_tables>, the packet filter infrastructure for Linux. We'll use a similar
11087 terminology, so that users that are familiar with iptables feel right at home.
11088
11089 =head2 Terminology
11090
11091 The following are the terms used in the remainder of the filter configuration
11092 documentation. For an ASCII-art schema of the mechanism, see
11093 L<"General structure"> below.
11094
11095 =over 4
11096
11097 =item B<Match>
11098
11099 A I<match> is a criteria to select specific values. Examples are, of course, the
11100 name of the value or it's current value.
11101
11102 Matches are implemented in plugins which you have to load prior to using the
11103 match. The name of such plugins starts with the "match_" prefix.
11104
11105 =item B<Target>
11106
11107 A I<target> is some action that is to be performed with data. Such actions
11108 could, for example, be to change part of the value's identifier or to ignore
11109 the value completely.
11110
11111 Some of these targets are built into the daemon, see L<"Built-in targets">
11112 below. Other targets are implemented in plugins which you have to load prior to
11113 using the target. The name of such plugins starts with the "target_" prefix.
11114
11115 =item B<Rule>
11116
11117 The combination of any number of matches and at least one target is called a
11118 I<rule>. The target actions will be performed for all values for which B<all>
11119 matches apply. If the rule does not have any matches associated with it, the
11120 target action will be performed for all values.
11121
11122 =item B<Chain>
11123
11124 A I<chain> is a list of rules and possibly default targets. The rules are tried
11125 in order and if one matches, the associated target will be called. If a value
11126 is handled by a rule, it depends on the target whether or not any subsequent
11127 rules are considered or if traversal of the chain is aborted, see
11128 L<"Flow control"> below. After all rules have been checked, the default targets
11129 will be executed.
11130
11131 =back
11132
11133 =head2 General structure
11134
11135 The following shows the resulting structure:
11136
11137  +---------+
11138  ! Chain   !
11139  +---------+
11140       !
11141       V
11142  +---------+  +---------+  +---------+  +---------+
11143  ! Rule    !->! Match   !->! Match   !->! Target  !
11144  +---------+  +---------+  +---------+  +---------+
11145       !
11146       V
11147  +---------+  +---------+  +---------+
11148  ! Rule    !->! Target  !->! Target  !
11149  +---------+  +---------+  +---------+
11150       !
11151       V
11152       :
11153       :
11154       !
11155       V
11156  +---------+  +---------+  +---------+
11157  ! Rule    !->! Match   !->! Target  !
11158  +---------+  +---------+  +---------+
11159       !
11160       V
11161  +---------+
11162  ! Default !
11163  ! Target  !
11164  +---------+
11165
11166 =head2 Flow control
11167
11168 There are four ways to control which way a value takes through the filter
11169 mechanism:
11170
11171 =over 4
11172
11173 =item B<jump>
11174
11175 The built-in B<jump> target can be used to "call" another chain, i.E<nbsp>e.
11176 process the value with another chain. When the called chain finishes, usually
11177 the next target or rule after the jump is executed.
11178
11179 =item B<stop>
11180
11181 The stop condition, signaled for example by the built-in target B<stop>, causes
11182 all processing of the value to be stopped immediately.
11183
11184 =item B<return>
11185
11186 Causes processing in the current chain to be aborted, but processing of the
11187 value generally will continue. This means that if the chain was called via
11188 B<Jump>, the next target or rule after the jump will be executed. If the chain
11189 was not called by another chain, control will be returned to the daemon and it
11190 may pass the value to another chain.
11191
11192 =item B<continue>
11193
11194 Most targets will signal the B<continue> condition, meaning that processing
11195 should continue normally. There is no special built-in target for this
11196 condition.
11197
11198 =back
11199
11200 =head2 Synopsis
11201
11202 The configuration reflects this structure directly:
11203
11204  PostCacheChain "PostCache"
11205  <Chain "PostCache">
11206    <Rule "ignore_mysql_show">
11207      <Match "regex">
11208        Plugin "^mysql$"
11209        Type "^mysql_command$"
11210        TypeInstance "^show_"
11211      </Match>
11212      <Target "stop">
11213      </Target>
11214    </Rule>
11215    <Target "write">
11216      Plugin "rrdtool"
11217    </Target>
11218  </Chain>
11219
11220 The above configuration example will ignore all values where the plugin field
11221 is "mysql", the type is "mysql_command" and the type instance begins with
11222 "show_". All other values will be sent to the C<rrdtool> write plugin via the
11223 default target of the chain. Since this chain is run after the value has been
11224 added to the cache, the MySQL C<show_*> command statistics will be available
11225 via the C<unixsock> plugin.
11226
11227 =head2 List of configuration options
11228
11229 =over 4
11230
11231 =item B<PreCacheChain> I<ChainName>
11232
11233 =item B<PostCacheChain> I<ChainName>
11234
11235 Configure the name of the "pre-cache chain" and the "post-cache chain". The
11236 argument is the name of a I<chain> that should be executed before and/or after
11237 the values have been added to the cache.
11238
11239 To understand the implications, it's important you know what is going on inside
11240 I<collectd>. The following diagram shows how values are passed from the
11241 read-plugins to the write-plugins:
11242
11243    +---------------+
11244    !  Read-Plugin  !
11245    +-------+-------+
11246            !
11247  + - - - - V - - - - +
11248  : +---------------+ :
11249  : !   Pre-Cache   ! :
11250  : !     Chain     ! :
11251  : +-------+-------+ :
11252  :         !         :
11253  :         V         :
11254  : +-------+-------+ :  +---------------+
11255  : !     Cache     !--->!  Value Cache  !
11256  : !     insert    ! :  +---+---+-------+
11257  : +-------+-------+ :      !   !
11258  :         !   ,------------'   !
11259  :         V   V     :          V
11260  : +-------+---+---+ :  +-------+-------+
11261  : !  Post-Cache   +--->! Write-Plugins !
11262  : !     Chain     ! :  +---------------+
11263  : +---------------+ :
11264  :                   :
11265  :  dispatch values  :
11266  + - - - - - - - - - +
11267
11268 After the values are passed from the "read" plugins to the dispatch functions,
11269 the pre-cache chain is run first. The values are added to the internal cache
11270 afterwards. The post-cache chain is run after the values have been added to the
11271 cache. So why is it such a huge deal if chains are run before or after the
11272 values have been added to this cache?
11273
11274 Targets that change the identifier of a value list should be executed before
11275 the values are added to the cache, so that the name in the cache matches the
11276 name that is used in the "write" plugins. The C<unixsock> plugin, too, uses
11277 this cache to receive a list of all available values. If you change the
11278 identifier after the value list has been added to the cache, this may easily
11279 lead to confusion, but it's not forbidden of course.
11280
11281 The cache is also used to convert counter values to rates. These rates are, for
11282 example, used by the C<value> match (see below). If you use the rate stored in
11283 the cache B<before> the new value is added, you will use the old, B<previous>
11284 rate. Write plugins may use this rate, too, see the C<csv> plugin, for example.
11285 The C<unixsock> plugin uses these rates too, to implement the C<GETVAL>
11286 command.
11287
11288 Last but not last, the B<stop> target makes a difference: If the pre-cache
11289 chain returns the stop condition, the value will not be added to the cache and
11290 the post-cache chain will not be run.
11291
11292 =item B<Chain> I<Name>
11293
11294 Adds a new chain with a certain name. This name can be used to refer to a
11295 specific chain, for example to jump to it.
11296
11297 Within the B<Chain> block, there can be B<Rule> blocks and B<Target> blocks.
11298
11299 =item B<Rule> [I<Name>]
11300
11301 Adds a new rule to the current chain. The name of the rule is optional and
11302 currently has no meaning for the daemon.
11303
11304 Within the B<Rule> block, there may be any number of B<Match> blocks and there
11305 must be at least one B<Target> block.
11306
11307 =item B<Match> I<Name>
11308
11309 Adds a match to a B<Rule> block. The name specifies what kind of match should
11310 be performed. Available matches depend on the plugins that have been loaded.
11311
11312 The arguments inside the B<Match> block are passed to the plugin implementing
11313 the match, so which arguments are valid here depends on the plugin being used.
11314 If you do not need any to pass any arguments to a match, you can use the
11315 shorter syntax:
11316
11317  Match "foobar"
11318
11319 Which is equivalent to:
11320
11321  <Match "foobar">
11322  </Match>
11323
11324 =item B<Target> I<Name>
11325
11326 Add a target to a rule or a default target to a chain. The name specifies what
11327 kind of target is to be added. Which targets are available depends on the
11328 plugins being loaded.
11329
11330 The arguments inside the B<Target> block are passed to the plugin implementing
11331 the target, so which arguments are valid here depends on the plugin being used.
11332 If you do not need any to pass any arguments to a target, you can use the
11333 shorter syntax:
11334
11335  Target "stop"
11336
11337 This is the same as writing:
11338
11339  <Target "stop">
11340  </Target>
11341
11342 =back
11343
11344 =head2 Built-in targets
11345
11346 The following targets are built into the core daemon and therefore need no
11347 plugins to be loaded:
11348
11349 =over 4
11350
11351 =item B<return>
11352
11353 Signals the "return" condition, see the L<"Flow control"> section above. This
11354 causes the current chain to stop processing the value and returns control to
11355 the calling chain. The calling chain will continue processing targets and rules
11356 just after the B<jump> target (see below). This is very similar to the
11357 B<RETURN> target of iptables, see L<iptables(8)>.
11358
11359 This target does not have any options.
11360
11361 Example:
11362
11363  Target "return"
11364
11365 =item B<stop>
11366
11367 Signals the "stop" condition, see the L<"Flow control"> section above. This
11368 causes processing of the value to be aborted immediately. This is similar to
11369 the B<DROP> target of iptables, see L<iptables(8)>.
11370
11371 This target does not have any options.
11372
11373 Example:
11374
11375  Target "stop"
11376
11377 =item B<write>
11378
11379 Sends the value to "write" plugins.
11380
11381 Available options:
11382
11383 =over 4
11384
11385 =item B<Plugin> I<Name>
11386
11387 Name of the write plugin to which the data should be sent. This option may be
11388 given multiple times to send the data to more than one write plugin. If the
11389 plugin supports multiple instances, the plugin's instance(s) must also be
11390 specified.
11391
11392 =back
11393
11394 If no plugin is explicitly specified, the values will be sent to all available
11395 write plugins.
11396
11397 Single-instance plugin example:
11398
11399  <Target "write">
11400    Plugin "rrdtool"
11401  </Target>
11402
11403 Multi-instance plugin example:
11404
11405  <Plugin "write_graphite">
11406    <Node "foo">
11407    ...
11408    </Node>
11409    <Node "bar">
11410    ...
11411    </Node>
11412  </Plugin>
11413   ...
11414  <Target "write">
11415    Plugin "write_graphite/foo"
11416  </Target>
11417
11418 =item B<jump>
11419
11420 Starts processing the rules of another chain, see L<"Flow control"> above. If
11421 the end of that chain is reached, or a stop condition is encountered,
11422 processing will continue right after the B<jump> target, i.E<nbsp>e. with the
11423 next target or the next rule. This is similar to the B<-j> command line option
11424 of iptables, see L<iptables(8)>.
11425
11426 Available options:
11427
11428 =over 4
11429
11430 =item B<Chain> I<Name>
11431
11432 Jumps to the chain I<Name>. This argument is required and may appear only once.
11433
11434 =back
11435
11436 Example:
11437
11438  <Target "jump">
11439    Chain "foobar"
11440  </Target>
11441
11442 =back
11443
11444 =head2 Available matches
11445
11446 =over 4
11447
11448 =item B<regex>
11449
11450 Matches a value using regular expressions.
11451
11452 Available options:
11453
11454 =over 4
11455
11456 =item B<Host> I<Regex>
11457
11458 =item B<Plugin> I<Regex>
11459
11460 =item B<PluginInstance> I<Regex>
11461
11462 =item B<Type> I<Regex>
11463
11464 =item B<TypeInstance> I<Regex>
11465
11466 =item B<MetaData> I<String> I<Regex>
11467
11468 Match values where the given regular expressions match the various fields of
11469 the identifier of a value. If multiple regular expressions are given, B<all>
11470 regexen must match for a value to match.
11471
11472 =item B<Invert> B<false>|B<true>
11473
11474 When set to B<true>, the result of the match is inverted, i.e. all value lists
11475 where all regular expressions apply are not matched, all other value lists are
11476 matched. Defaults to B<false>.
11477
11478 =back
11479
11480 Example:
11481
11482  <Match "regex">
11483    Host "customer[0-9]+"
11484    Plugin "^foobar$"
11485  </Match>
11486
11487 =item B<timediff>
11488
11489 Matches values that have a time which differs from the time on the server.
11490
11491 This match is mainly intended for servers that receive values over the
11492 C<network> plugin and write them to disk using the C<rrdtool> plugin. RRDtool
11493 is very sensitive to the timestamp used when updating the RRD files. In
11494 particular, the time must be ever increasing. If a misbehaving client sends one
11495 packet with a timestamp far in the future, all further packets with a correct
11496 time will be ignored because of that one packet. What's worse, such corrupted
11497 RRD files are hard to fix.
11498
11499 This match lets one match all values B<outside> a specified time range
11500 (relative to the server's time), so you can use the B<stop> target (see below)
11501 to ignore the value, for example.
11502
11503 Available options:
11504
11505 =over 4
11506
11507 =item B<Future> I<Seconds>
11508
11509 Matches all values that are I<ahead> of the server's time by I<Seconds> or more
11510 seconds. Set to zero for no limit. Either B<Future> or B<Past> must be
11511 non-zero.
11512
11513 =item B<Past> I<Seconds>
11514
11515 Matches all values that are I<behind> of the server's time by I<Seconds> or
11516 more seconds. Set to zero for no limit. Either B<Future> or B<Past> must be
11517 non-zero.
11518
11519 =back
11520
11521 Example:
11522
11523  <Match "timediff">
11524    Future  300
11525    Past   3600
11526  </Match>
11527
11528 This example matches all values that are five minutes or more ahead of the
11529 server or one hour (or more) lagging behind.
11530
11531 =item B<value>
11532
11533 Matches the actual value of data sources against given minimumE<nbsp>/ maximum
11534 values. If a data-set consists of more than one data-source, all data-sources
11535 must match the specified ranges for a positive match.
11536
11537 Available options:
11538
11539 =over 4
11540
11541 =item B<Min> I<Value>
11542
11543 Sets the smallest value which still results in a match. If unset, behaves like
11544 negative infinity.
11545
11546 =item B<Max> I<Value>
11547
11548 Sets the largest value which still results in a match. If unset, behaves like
11549 positive infinity.
11550
11551 =item B<Invert> B<true>|B<false>
11552
11553 Inverts the selection. If the B<Min> and B<Max> settings result in a match,
11554 no-match is returned and vice versa. Please note that the B<Invert> setting
11555 only effects how B<Min> and B<Max> are applied to a specific value. Especially
11556 the B<DataSource> and B<Satisfy> settings (see below) are not inverted.
11557
11558 =item B<DataSource> I<DSName> [I<DSName> ...]
11559
11560 Select one or more of the data sources. If no data source is configured, all
11561 data sources will be checked. If the type handled by the match does not have a
11562 data source of the specified name(s), this will always result in no match
11563 (independent of the B<Invert> setting).
11564
11565 =item B<Satisfy> B<Any>|B<All>
11566
11567 Specifies how checking with several data sources is performed. If set to
11568 B<Any>, the match succeeds if one of the data sources is in the configured
11569 range. If set to B<All> the match only succeeds if all data sources are within
11570 the configured range. Default is B<All>.
11571
11572 Usually B<All> is used for positive matches, B<Any> is used for negative
11573 matches. This means that with B<All> you usually check that all values are in a
11574 "good" range, while with B<Any> you check if any value is within a "bad" range
11575 (or outside the "good" range).
11576
11577 =back
11578
11579 Either B<Min> or B<Max>, but not both, may be unset.
11580
11581 Example:
11582
11583  # Match all values smaller than or equal to 100. Matches only if all data
11584  # sources are below 100.
11585  <Match "value">
11586    Max 100
11587    Satisfy "All"
11588  </Match>
11589
11590  # Match if the value of any data source is outside the range of 0 - 100.
11591  <Match "value">
11592    Min   0
11593    Max 100
11594    Invert true
11595    Satisfy "Any"
11596  </Match>
11597
11598 =item B<empty_counter>
11599
11600 Matches all values with one or more data sources of type B<COUNTER> and where
11601 all counter values are zero. These counters usually I<never> increased since
11602 they started existing (and are therefore uninteresting), or got reset recently
11603 or overflowed and you had really, I<really> bad luck.
11604
11605 Please keep in mind that ignoring such counters can result in confusing
11606 behavior: Counters which hardly ever increase will be zero for long periods of
11607 time. If the counter is reset for some reason (machine or service restarted,
11608 usually), the graph will be empty (NAN) for a long time. People may not
11609 understand why.
11610
11611 =item B<hashed>
11612
11613 Calculates a hash value of the host name and matches values according to that
11614 hash value. This makes it possible to divide all hosts into groups and match
11615 only values that are in a specific group. The intended use is in load
11616 balancing, where you want to handle only part of all data and leave the rest
11617 for other servers.
11618
11619 The hashing function used tries to distribute the hosts evenly. First, it
11620 calculates a 32E<nbsp>bit hash value using the characters of the hostname:
11621
11622   hash_value = 0;
11623   for (i = 0; host[i] != 0; i++)
11624     hash_value = (hash_value * 251) + host[i];
11625
11626 The constant 251 is a prime number which is supposed to make this hash value
11627 more random. The code then checks the group for this host according to the
11628 I<Total> and I<Match> arguments:
11629
11630   if ((hash_value % Total) == Match)
11631     matches;
11632   else
11633     does not match;
11634
11635 Please note that when you set I<Total> to two (i.E<nbsp>e. you have only two
11636 groups), then the least significant bit of the hash value will be the XOR of
11637 all least significant bits in the host name. One consequence is that when you
11638 have two hosts, "server0.example.com" and "server1.example.com", where the host
11639 name differs in one digit only and the digits differ by one, those hosts will
11640 never end up in the same group.
11641
11642 Available options:
11643
11644 =over 4
11645
11646 =item B<Match> I<Match> I<Total>
11647
11648 Divide the data into I<Total> groups and match all hosts in group I<Match> as
11649 described above. The groups are numbered from zero, i.E<nbsp>e. I<Match> must
11650 be smaller than I<Total>. I<Total> must be at least one, although only values
11651 greater than one really do make any sense.
11652
11653 You can repeat this option to match multiple groups, for example:
11654
11655   Match 3 7
11656   Match 5 7
11657
11658 The above config will divide the data into seven groups and match groups three
11659 and five. One use would be to keep every value on two hosts so that if one
11660 fails the missing data can later be reconstructed from the second host.
11661
11662 =back
11663
11664 Example:
11665
11666  # Operate on the pre-cache chain, so that ignored values are not even in the
11667  # global cache.
11668  <Chain "PreCache">
11669    <Rule>
11670      <Match "hashed">
11671        # Divide all received hosts in seven groups and accept all hosts in
11672        # group three.
11673        Match 3 7
11674      </Match>
11675      # If matched: Return and continue.
11676      Target "return"
11677    </Rule>
11678    # If not matched: Return and stop.
11679    Target "stop"
11680  </Chain>
11681
11682 =back
11683
11684 =head2 Available targets
11685
11686 =over 4
11687
11688 =item B<notification>
11689
11690 Creates and dispatches a notification.
11691
11692 Available options:
11693
11694 =over 4
11695
11696 =item B<Message> I<String>
11697
11698 This required option sets the message of the notification. The following
11699 placeholders will be replaced by an appropriate value:
11700
11701 =over 4
11702
11703 =item B<%{host}>
11704
11705 =item B<%{plugin}>
11706
11707 =item B<%{plugin_instance}>
11708
11709 =item B<%{type}>
11710
11711 =item B<%{type_instance}>
11712
11713 These placeholders are replaced by the identifier field of the same name.
11714
11715 =item B<%{ds:>I<name>B<}>
11716
11717 These placeholders are replaced by a (hopefully) human readable representation
11718 of the current rate of this data source. If you changed the instance name
11719 (using the B<set> or B<replace> targets, see below), it may not be possible to
11720 convert counter values to rates.
11721
11722 =back
11723
11724 Please note that these placeholders are B<case sensitive>!
11725
11726 =item B<Severity> B<"FAILURE">|B<"WARNING">|B<"OKAY">
11727
11728 Sets the severity of the message. If omitted, the severity B<"WARNING"> is
11729 used.
11730
11731 =back
11732
11733 Example:
11734
11735   <Target "notification">
11736     Message "Oops, the %{type_instance} temperature is currently %{ds:value}!"
11737     Severity "WARNING"
11738   </Target>
11739
11740 =item B<replace>
11741
11742 Replaces parts of the identifier using regular expressions.
11743
11744 Available options:
11745
11746 =over 4
11747
11748 =item B<Host> I<Regex> I<Replacement>
11749
11750 =item B<Plugin> I<Regex> I<Replacement>
11751
11752 =item B<PluginInstance> I<Regex> I<Replacement>
11753
11754 =item B<TypeInstance> I<Regex> I<Replacement>
11755
11756 =item B<MetaData> I<String> I<Regex> I<Replacement>
11757
11758 =item B<DeleteMetaData> I<String> I<Regex>
11759
11760 Match the appropriate field with the given regular expression I<Regex>. If the
11761 regular expression matches, that part that matches is replaced with
11762 I<Replacement>. If multiple places of the input buffer match a given regular
11763 expression, only the first occurrence will be replaced.
11764
11765 You can specify each option multiple times to use multiple regular expressions
11766 one after another.
11767
11768 =back
11769
11770 Example:
11771
11772  <Target "replace">
11773    # Replace "example.net" with "example.com"
11774    Host "\\<example.net\\>" "example.com"
11775
11776    # Strip "www." from hostnames
11777    Host "\\<www\\." ""
11778  </Target>
11779
11780 =item B<set>
11781
11782 Sets part of the identifier of a value to a given string.
11783
11784 Available options:
11785
11786 =over 4
11787
11788 =item B<Host> I<String>
11789
11790 =item B<Plugin> I<String>
11791
11792 =item B<PluginInstance> I<String>
11793
11794 =item B<TypeInstance> I<String>
11795
11796 =item B<MetaData> I<String> I<String>
11797
11798 Set the appropriate field to the given string. The strings for plugin instance,
11799 type instance, and meta data may be empty, the strings for host and plugin may
11800 not be empty. It's currently not possible to set the type of a value this way.
11801
11802 The following placeholders will be replaced by an appropriate value:
11803
11804 =over 4
11805
11806 =item B<%{host}>
11807
11808 =item B<%{plugin}>
11809
11810 =item B<%{plugin_instance}>
11811
11812 =item B<%{type}>
11813
11814 =item B<%{type_instance}>
11815
11816 These placeholders are replaced by the identifier field of the same name.
11817
11818 =item B<%{meta:>I<name>B<}>
11819
11820 These placeholders are replaced by the meta data value with the given name.
11821
11822 =back
11823
11824 Please note that these placeholders are B<case sensitive>!
11825
11826 =item B<DeleteMetaData> I<String>
11827
11828 Delete the named meta data field.
11829
11830 =back
11831
11832 Example:
11833
11834  <Target "set">
11835    PluginInstance "coretemp"
11836    TypeInstance "core3"
11837  </Target>
11838
11839 =back
11840
11841 =head2 Backwards compatibility
11842
11843 If you use collectd with an old configuration, i.E<nbsp>e. one without a
11844 B<Chain> block, it will behave as it used to. This is equivalent to the
11845 following configuration:
11846
11847  <Chain "PostCache">
11848    Target "write"
11849  </Chain>
11850
11851 If you specify a B<PostCacheChain>, the B<write> target will not be added
11852 anywhere and you will have to make sure that it is called where appropriate. We
11853 suggest to add the above snippet as default target to your "PostCache" chain.
11854
11855 =head2 Examples
11856
11857 Ignore all values, where the hostname does not contain a dot, i.E<nbsp>e. can't
11858 be an FQDN.
11859
11860  <Chain "PreCache">
11861    <Rule "no_fqdn">
11862      <Match "regex">
11863        Host "^[^\.]*$"
11864      </Match>
11865      Target "stop"
11866    </Rule>
11867    Target "write"
11868  </Chain>
11869
11870 =head1 IGNORELISTS
11871
11872 B<Ignorelists> are a generic framework to either ignore some metrics or report
11873 specific metrics only. Plugins usually provide one or more options to specify
11874 the items (mounts points, devices, ...) and the boolean option
11875 C<IgnoreSelected>.
11876
11877 =over 4
11878
11879 =item B<Select> I<String>
11880
11881 Selects the item I<String>. This option often has a plugin specific name, e.g.
11882 B<Sensor> in the C<sensors> plugin. It is also plugin specific what this string
11883 is compared to. For example, the C<df> plugin's B<MountPoint> compares it to a
11884 mount point and the C<sensors> plugin's B<Sensor> compares it to a sensor name.
11885
11886 By default, this option is doing a case-sensitive full-string match. The
11887 following config will match C<foo>, but not C<Foo>:
11888
11889   Select "foo"
11890
11891 If I<String> starts and ends with C</> (a slash), the string is compiled as a
11892 I<regular expression>. For example, so match all item starting with C<foo>, use
11893 could use the following syntax:
11894
11895   Select "/^foo/"
11896
11897 The regular expression is I<not> anchored, i.e. the following config will match
11898 C<foobar>, C<barfoo> and C<AfooZ>:
11899
11900   Select "/foo/"
11901
11902 The B<Select> option may be repeated to select multiple items.
11903
11904 =item B<IgnoreSelected> B<true>|B<false>
11905
11906 If set to B<true>, matching metrics are I<ignored> and all other metrics are
11907 collected. If set to B<false>, matching metrics are I<collected> and all other
11908 metrics are ignored.
11909
11910 =back
11911
11912 =head1 SEE ALSO
11913
11914 L<collectd(1)>,
11915 L<collectd-exec(5)>,
11916 L<collectd-perl(5)>,
11917 L<collectd-unixsock(5)>,
11918 L<types.db(5)>,
11919 L<hddtemp(8)>,
11920 L<iptables(8)>,
11921 L<kstat(3KSTAT)>,
11922 L<mbmon(1)>,
11923 L<psql(1)>,
11924 L<regex(7)>,
11925 L<rrdtool(1)>,
11926 L<sensors(1)>
11927
11928 =head1 AUTHOR
11929
11930 Florian Forster E<lt>octo@collectd.orgE<gt>
11931
11932 =cut