forked from collectd/collectd
-
Notifications
You must be signed in to change notification settings - Fork 8
/
collectd.conf.pod
13174 lines (8982 loc) · 422 KB
/
collectd.conf.pod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
=encoding UTF-8
=head1 NAME
collectd.conf - Configuration for the system statistics collection daemon B<collectd>
=head1 SYNOPSIS
BaseDir "/var/lib/collectd"
PIDFile "/run/collectd.pid"
Interval 10.0
LoadPlugin cpu
LoadPlugin load
<LoadPlugin df>
Interval 3600
</LoadPlugin>
<Plugin df>
ValuesPercentage true
</Plugin>
LoadPlugin ping
<Plugin ping>
Host "example.org"
Host "provider.net"
</Plugin>
=head1 DESCRIPTION
This config file controls how the system statistics collection daemon
B<collectd> behaves. The most significant option is B<LoadPlugin>, which
controls which plugins to load. These plugins ultimately define collectd's
behavior. If the B<AutoLoadPlugin> option has been enabled, the explicit
B<LoadPlugin> lines may be omitted for all plugins with a configuration block,
i.e. a C<E<lt>PluginE<nbsp>...E<gt>> block.
The syntax of this config file is similar to the config file of the famous
I<Apache> webserver. Each line contains either an option (a key and a list of
one or more values) or a section-start or -end. Empty lines and everything
after a non-quoted hash-symbol (C<#>) are ignored. I<Keys> are unquoted
strings, consisting only of alphanumeric characters and the underscore (C<_>)
character. Keys are handled case insensitive by I<collectd> itself and all
plugins included with it. I<Values> can either be an I<unquoted string>, a
I<quoted string> (enclosed in double-quotes) a I<number> or a I<boolean>
expression. I<Unquoted strings> consist of only alphanumeric characters and
underscores (C<_>) and do not need to be quoted. I<Quoted strings> are
enclosed in double quotes (C<">). You can use the backslash character (C<\>)
to include double quotes as part of the string. I<Numbers> can be specified in
decimal and floating point format (using a dot C<.> as decimal separator),
hexadecimal when using the C<0x> prefix and octal with a leading zero (C<0>).
I<Boolean> values are either B<true> or B<false>.
Lines may be wrapped by using C<\> as the last character before the newline.
This allows long lines to be split into multiple lines. Quoted strings may be
wrapped as well. However, those are treated special in that whitespace at the
beginning of the following lines will be ignored, which allows for nicely
indenting the wrapped lines.
The configuration is read and processed in order, i.e. from top to bottom. So
the plugins are loaded in the order listed in this config file. It is a good
idea to load any logging plugins first in order to catch messages from plugins
during configuration. Also, unless B<AutoLoadPlugin> is enabled, the
B<LoadPlugin> option I<must> occur I<before> the appropriate
C<E<lt>B<Plugin> ...E<gt>> block.
=head1 GLOBAL OPTIONS
=over 4
=item B<BaseDir> I<Directory>
Sets the base directory. This is the directory beneath which all RRD-files are
created. Possibly more subdirectories are created. This is also the working
directory for the daemon.
=item B<LoadPlugin> I<Plugin>
Loads the plugin I<Plugin>. This is required to load plugins, unless the
B<AutoLoadPlugin> option is enabled (see below). Without any loaded plugins,
I<collectd> will be mostly useless.
Only the first B<LoadPlugin> statement or block for a given plugin name has any
effect. This is useful when you want to split up the configuration into smaller
files and want each file to be "self contained", i.e. it contains a B<Plugin>
block I<and> the appropriate B<LoadPlugin> statement. The downside is that if
you have multiple conflicting B<LoadPlugin> blocks, e.g. when they specify
different intervals, only one of them (the first one encountered) will take
effect and all others will be silently ignored.
B<LoadPlugin> may either be a simple configuration I<statement> or a I<block>
with additional options, affecting the behavior of B<LoadPlugin>. A simple
statement looks like this:
LoadPlugin "cpu"
Options inside a B<LoadPlugin> block can override default settings and
influence the way plugins are loaded, e.g.:
<LoadPlugin perl>
Interval 60
</LoadPlugin>
The following options are valid inside B<LoadPlugin> blocks:
=over 4
=item B<Globals> B<true|false>
If enabled, collectd will export all global symbols of the plugin (and of all
libraries loaded as dependencies of the plugin) and, thus, makes those symbols
available for resolving unresolved symbols in subsequently loaded plugins if
that is supported by your system.
This is useful (or possibly even required), e.g., when loading a plugin that
embeds some scripting language into the daemon (e.g. the I<Perl> and
I<Python plugins>). Scripting languages usually provide means to load
extensions written in C. Those extensions require symbols provided by the
interpreter, which is loaded as a dependency of the respective collectd plugin.
See the documentation of those plugins (e.g., L<collectd-perl(5)> or
L<collectd-python(5)>) for details.
By default, this is disabled. As a special exception, if the plugin name is
either C<perl> or C<python>, the default is changed to enabled in order to keep
the average user from ever having to deal with this low level linking stuff.
=item B<Interval> I<Seconds>
Sets a plugin-specific interval for collecting metrics. This overrides the
global B<Interval> setting. If a plugin provides its own support for specifying
an interval, that setting will take precedence.
=item B<FlushInterval> I<Seconds>
Specifies the interval, in seconds, to call the flush callback if it's
defined in this plugin. By default, this is disabled.
=item B<FlushTimeout> I<Seconds>
Specifies the value of the timeout argument of the flush callback.
=back
=item B<AutoLoadPlugin> B<false>|B<true>
When set to B<false> (the default), each plugin needs to be loaded explicitly,
using the B<LoadPlugin> statement documented above. If a
B<E<lt>PluginE<nbsp>...E<gt>> block is encountered and no configuration
handling callback for this plugin has been registered, a warning is logged and
the block is ignored.
When set to B<true>, explicit B<LoadPlugin> statements are not required. Each
B<E<lt>PluginE<nbsp>...E<gt>> block acts as if it was immediately preceded by a
B<LoadPlugin> statement. B<LoadPlugin> statements are still required for
plugins that don't provide any configuration, e.g. the I<Load plugin>.
=item B<CollectInternalStats> B<false>|B<true>
When set to B<true>, various statistics about the I<collectd> daemon will be
collected, with "collectd" as the I<plugin name>. Defaults to B<false>.
The following metrics are reported:
=over 4
=item C<collectd-write_queue/queue_length>
The number of metrics currently in the write queue. You can limit the queue
length with the B<WriteQueueLimitLow> and B<WriteQueueLimitHigh> options.
=item C<collectd-write_queue/derive-dropped>
The number of metrics dropped due to a queue length limitation.
If this value is non-zero, your system can't handle all incoming metrics and
protects itself against overload by dropping metrics.
=item C<collectd-cache/cache_size>
The number of elements in the metric cache (the cache you can interact with
using L<collectd-unixsock(5)>).
=back
=item B<Include> I<Path> [I<pattern>]
If I<Path> points to a file, includes that file. If I<Path> points to a
directory, recursively includes all files within that directory and its
subdirectories. If the C<wordexp> function is available on your system,
shell-like wildcards are expanded before files are included. This means you can
use statements like the following:
Include "/etc/collectd.d/*.conf"
Starting with version 5.3, this may also be a block in which further options
affecting the behavior of B<Include> may be specified. The following option is
currently allowed:
<Include "/etc/collectd.d">
Filter "*.conf"
</Include>
=over 4
=item B<Filter> I<pattern>
If the C<fnmatch> function is available on your system, a shell-like wildcard
I<pattern> may be specified to filter which files to include. This may be used
in combination with recursively including a directory to easily be able to
arbitrarily mix configuration files and other documents (e.g. README files).
The given example is similar to the first example above but includes all files
matching C<*.conf> in any subdirectory of C</etc/collectd.d>.
=back
If more than one file is included by a single B<Include> option, the files
will be included in lexicographical order (as defined by the C<strcmp>
function). Thus, you can e.E<nbsp>g. use numbered prefixes to specify the
order in which the files are loaded.
To prevent loops and shooting yourself in the foot in interesting ways the
nesting is limited to a depth of 8E<nbsp>levels, which should be sufficient for
most uses. Since symlinks are followed it is still possible to crash the daemon
by looping symlinks. In our opinion significant stupidity should result in an
appropriate amount of pain.
It is no problem to have a block like C<E<lt>Plugin fooE<gt>> in more than one
file, but you cannot include files from within blocks.
=item B<PIDFile> I<File>
Sets where to write the PID file to. This file is overwritten when it exists
and deleted when the program is stopped. Some init-scripts might override this
setting using the B<-P> command-line option.
=item B<PluginDir> I<Directory>
Path to the plugins (shared objects) of collectd.
=item B<TypesDB> I<File> [I<File> ...]
Set one or more files that contain the data-set descriptions. See
L<types.db(5)> for a description of the format of this file.
If this option is not specified, a default file is read. If you need to define
custom types in addition to the types defined in the default file, you need to
explicitly load both. In other words, if the B<TypesDB> option is encountered
the default behavior is disabled and if you need the default types you have to
also explicitly load them.
=item B<Interval> I<Seconds>
Configures the interval in which to query the read plugins. Obviously smaller
values lead to a higher system load produced by collectd, while higher values
lead to more coarse statistics.
B<Warning:> You should set this once and then never touch it again. If you do,
I<you will have to delete all your RRD files> or know some serious RRDtool
magic! (Assuming you're using the I<RRDtool> or I<RRDCacheD> plugin.)
=item B<MaxReadInterval> I<Seconds>
A read plugin doubles the interval between queries after each failed attempt
to get data.
This options limits the maximum value of the interval. The default value is
B<86400>.
=item B<Timeout> I<Iterations>
Consider a value list "missing" when no update has been read or received for
I<Iterations> iterations. By default, I<collectd> considers a value list
missing when no update has been received for twice the update interval. Since
this setting uses iterations, the maximum allowed time without update depends
on the I<Interval> information contained in each value list. This is used in
the I<Threshold> configuration to dispatch notifications about missing values,
see L<collectd-threshold(5)> for details.
=item B<ReadThreads> I<Num>
Number of threads to start for reading plugins. The default value is B<5>, but
you may want to increase this if you have more than five plugins that take a
long time to read. Mostly those are plugins that do network-IO. Setting this to
a value higher than the number of registered read callbacks is not recommended.
=item B<WriteThreads> I<Num>
Number of threads to start for dispatching value lists to write plugins. The
default value is B<5>, but you may want to increase this if you have more than
five plugins that may take relatively long to write to.
=item B<WriteQueueLimitHigh> I<HighNum>
=item B<WriteQueueLimitLow> I<LowNum>
Metrics are read by the I<read threads> and then put into a queue to be handled
by the I<write threads>. If one of the I<write plugins> is slow (e.g. network
timeouts, I/O saturation of the disk) this queue will grow. In order to avoid
running into memory issues in such a case, you can limit the size of this
queue.
By default, there is no limit and memory may grow indefinitely. This is most
likely not an issue for clients, i.e. instances that only handle the local
metrics. For servers it is recommended to set this to a non-zero value, though.
You can set the limits using B<WriteQueueLimitHigh> and B<WriteQueueLimitLow>.
Each of them takes a numerical argument which is the number of metrics in the
queue. If there are I<HighNum> metrics in the queue, any new metrics I<will> be
dropped. If there are less than I<LowNum> metrics in the queue, all new metrics
I<will> be enqueued. If the number of metrics currently in the queue is between
I<LowNum> and I<HighNum>, the metric is dropped with a probability that is
proportional to the number of metrics in the queue (i.e. it increases linearly
until it reaches 100%.)
If B<WriteQueueLimitHigh> is set to non-zero and B<WriteQueueLimitLow> is
unset, the latter will default to half of B<WriteQueueLimitHigh>.
If you do not want to randomly drop values when the queue size is between
I<LowNum> and I<HighNum>, set B<WriteQueueLimitHigh> and B<WriteQueueLimitLow>
to the same value.
Enabling the B<CollectInternalStats> option is of great help to figure out the
values to set B<WriteQueueLimitHigh> and B<WriteQueueLimitLow> to.
=item B<Hostname> I<Name>
Sets the hostname that identifies a host. If you omit this setting, the
hostname will be determined using the L<gethostname(2)> system call.
=item B<FQDNLookup> B<true|false>
If B<Hostname> is determined automatically this setting controls whether or not
the daemon should try to figure out the "fully qualified domain name", FQDN.
This is achieved by using C<getaddrinfo()> to look up full web address of the
first network interface that has one. This option is enabled by default.
=item B<PreCacheChain> I<ChainName>
=item B<PostCacheChain> I<ChainName>
Configure the name of the "pre-cache chain" and the "post-cache chain". Please
see L</"FILTER CONFIGURATION"> below on information on chains and how these
setting change the daemon's behavior.
=back
=head1 PLUGIN OPTIONS
Some plugins may register own options. These options must be enclosed in a
C<Plugin>-Section. Which options exist depends on the plugin used. Some plugins
require external configuration, too. The C<apache plugin>, for example,
required C<mod_status> to be configured in the webserver you're going to
collect data from. These plugins are listed below as well, even if they don't
require any configuration within collectd's configuration file.
A list of all plugins and a short summary for each plugin can be found in the
F<README> file shipped with the sourcecode and hopefully binary packets as
well.
=head2 Plugin C<aggregation>
The I<Aggregation plugin> makes it possible to aggregate several values into
one using aggregation functions such as I<sum>, I<average>, I<min> and I<max>.
This can be put to a wide variety of uses, e.g. average and total CPU
statistics for your entire fleet.
The grouping is powerful but, as with many powerful tools, may be a bit
difficult to wrap your head around. The grouping will therefore be
demonstrated using an example: The average and sum of the CPU usage across
all CPUs of each host is to be calculated.
To select all the affected values for our example, set C<Plugin cpu> and
C<Type cpu>. The other values are left unspecified, meaning "all values". The
I<Host>, I<Plugin>, I<PluginInstance>, I<Type> and I<TypeInstance> options
work as if they were specified in the C<WHERE> clause of an C<SELECT> SQL
statement.
Plugin "cpu"
Type "cpu"
Although the I<Host>, I<PluginInstance> (CPU number, i.e. 0, 1, 2, ...) and
I<TypeInstance> (idle, user, system, ...) fields are left unspecified in the
example, the intention is to have a new value for each host / type instance
pair. This is achieved by "grouping" the values using the C<GroupBy> option.
It can be specified multiple times to group by more than one field.
GroupBy "Host"
GroupBy "TypeInstance"
We do neither specify nor group by I<plugin instance> (the CPU number), so all
metrics that differ in the CPU number only will be aggregated. Each
aggregation needs I<at least one> such field, otherwise no aggregation would
take place.
The full example configuration looks like this:
<Plugin "aggregation">
<Aggregation>
Plugin "cpu"
Type "cpu"
GroupBy "Host"
GroupBy "TypeInstance"
CalculateSum true
CalculateAverage true
</Aggregation>
</Plugin>
There are a couple of limitations you should be aware of:
=over 4
=item *
The I<Type> cannot be left unspecified, because it is not reasonable to add
apples to oranges. Also, the internal lookup structure won't work if you try
to group by type.
=item *
There must be at least one unspecified, ungrouped field. Otherwise nothing
will be aggregated.
=back
As you can see in the example above, each aggregation has its own
B<Aggregation> block. You can have multiple aggregation blocks and aggregation
blocks may match the same values, i.e. one value list can update multiple
aggregations. The following options are valid inside B<Aggregation> blocks:
=over 4
=item B<Host> I<Host>
=item B<Plugin> I<Plugin>
=item B<PluginInstance> I<PluginInstance>
=item B<Type> I<Type>
=item B<TypeInstance> I<TypeInstance>
Selects the value lists to be added to this aggregation. B<Type> must be a
valid data set name, see L<types.db(5)> for details.
If the string starts with and ends with a slash (C</>), the string is
interpreted as a I<regular expression>. The regex flavor used are POSIX
extended regular expressions as described in L<regex(7)>. Example usage:
Host "/^db[0-9]\\.example\\.com$/"
=item B<GroupBy> B<Host>|B<Plugin>|B<PluginInstance>|B<TypeInstance>
Group valued by the specified field. The B<GroupBy> option may be repeated to
group by multiple fields.
=item B<SetHost> I<Host>
=item B<SetPlugin> I<Plugin>
=item B<SetPluginInstance> I<PluginInstance>
=item B<SetTypeInstance> I<TypeInstance>
Sets the appropriate part of the identifier to the provided string.
The I<PluginInstance> should include the placeholder C<%{aggregation}> which
will be replaced with the aggregation function, e.g. "average". Not including
the placeholder will result in duplication warnings and/or messed up values if
more than one aggregation function are enabled.
The following example calculates the average usage of all "even" CPUs:
<Plugin "aggregation">
<Aggregation>
Plugin "cpu"
PluginInstance "/[0,2,4,6,8]$/"
Type "cpu"
SetPlugin "cpu"
SetPluginInstance "even-%{aggregation}"
GroupBy "Host"
GroupBy "TypeInstance"
CalculateAverage true
</Aggregation>
</Plugin>
This will create the files:
=over 4
=item *
foo.example.com/cpu-even-average/cpu-idle
=item *
foo.example.com/cpu-even-average/cpu-system
=item *
foo.example.com/cpu-even-average/cpu-user
=item *
...
=back
=item B<CalculateNum> B<true>|B<false>
=item B<CalculateSum> B<true>|B<false>
=item B<CalculateAverage> B<true>|B<false>
=item B<CalculateMinimum> B<true>|B<false>
=item B<CalculateMaximum> B<true>|B<false>
=item B<CalculateStddev> B<true>|B<false>
Boolean options for enabling calculation of the number of value lists, their
sum, average, minimum, maximum andE<nbsp>/ or standard deviation. All options
are disabled by default.
=back
=head2 Plugin C<amqp>
The I<AMQP plugin> can be used to communicate with other instances of
I<collectd> or third party applications using an AMQP 0.9.1 message broker.
Values are sent to or received from the broker, which handles routing,
queueing and possibly filtering out messages.
B<Synopsis:>
<Plugin "amqp">
# Send values to an AMQP broker
<Publish "some_name">
Host "localhost"
Host "fallback-amqp.example.com"
Port "5672"
VHost "/"
User "guest"
Password "guest"
Exchange "amq.fanout"
# ExchangeType "fanout"
# RoutingKey "collectd"
# Persistent false
# ConnectionRetryDelay 0
# Format "command"
# StoreRates false
# TLSEnabled false
# TLSVerifyPeer true
# TLSVerifyHostName true
# TLSCACert "/path/to/ca.pem"
# TLSClientCert "/path/to/client-cert.pem"
# TLSClientKey "/path/to/client-key.pem"
# GraphitePrefix "collectd."
# GraphiteEscapeChar "_"
# GraphiteSeparateInstances false
# GraphiteAlwaysAppendDS false
# GraphitePreserveSeparator false
</Publish>
# Receive values from an AMQP broker
<Subscribe "some_name">
Host "localhost"
Port "5672"
VHost "/"
User "guest"
Password "guest"
Exchange "amq.fanout"
# ExchangeType "fanout"
# Queue "queue_name"
# QueueDurable false
# QueueAutoDelete true
# RoutingKey "collectd.#"
# ConnectionRetryDelay 0
# TLSEnabled false
# TLSVerifyPeer true
# TLSVerifyHostName true
# TLSCACert "/path/to/ca.pem"
# TLSClientCert "/path/to/client-cert.pem"
# TLSClientKey "/path/to/client-key.pem"
</Subscribe>
</Plugin>
The plugin's configuration consists of a number of I<Publish> and I<Subscribe>
blocks, which configure sending and receiving of values respectively. The two
blocks are very similar, so unless otherwise noted, an option can be used in
either block. The name given in the blocks starting tag is only used for
reporting messages, but may be used to support I<flushing> of certain
I<Publish> blocks in the future.
=over 4
=item B<Host> I<Host> [I<Host> ...]
Hostname or IP-address of the AMQP broker. Defaults to the default behavior of
the underlying communications library, I<rabbitmq-c>, which is "localhost".
If multiple hosts are specified, then a random one is chosen at each
(re)connection attempt. This is useful for failover with a clustered broker.
=item B<Port> I<Port>
Service name or port number on which the AMQP broker accepts connections. This
argument must be a string, even if the numeric form is used. Defaults to
"5672".
=item B<VHost> I<VHost>
Name of the I<virtual host> on the AMQP broker to use. Defaults to "/".
=item B<User> I<User>
=item B<Password> I<Password>
Credentials used to authenticate to the AMQP broker. By default "guest"/"guest"
is used.
=item B<Exchange> I<Exchange>
In I<Publish> blocks, this option specifies the I<exchange> to send values to.
By default, "amq.fanout" will be used.
In I<Subscribe> blocks this option is optional. If given, a I<binding> between
the given exchange and the I<queue> is created, using the I<routing key> if
configured. See the B<Queue> and B<RoutingKey> options below.
=item B<ExchangeType> I<Type>
If given, the plugin will try to create the configured I<exchange> with this
I<type> after connecting. When in a I<Subscribe> block, the I<queue> will then
be bound to this exchange.
=item B<Queue> I<Queue> (Subscribe only)
Configures the I<queue> name to subscribe to. If no queue name was configured
explicitly, a unique queue name will be created by the broker.
=item B<QueueDurable> B<true>|B<false> (Subscribe only)
Defines if the I<queue> subscribed to is durable (saved to persistent storage)
or transient (will disappear if the AMQP broker is restarted). Defaults to
"false".
This option should be used in conjunction with the I<Persistent> option on the
publish side.
=item B<QueueAutoDelete> B<true>|B<false> (Subscribe only)
Defines if the I<queue> subscribed to will be deleted once the last consumer
unsubscribes. Defaults to "true".
=item B<RoutingKey> I<Key>
In I<Publish> blocks, this configures the routing key to set on all outgoing
messages. If not given, the routing key will be computed from the I<identifier>
of the value. The host, plugin, type and the two instances are concatenated
together using dots as the separator and all containing dots replaced with
slashes. For example "collectd.host/example/com.cpu.0.cpu.user". This makes it
possible to receive only specific values using a "topic" exchange.
In I<Subscribe> blocks, configures the I<routing key> used when creating a
I<binding> between an I<exchange> and the I<queue>. The usual wildcards can be
used to filter messages when using a "topic" exchange. If you're only
interested in CPU statistics, you could use the routing key "collectd.*.cpu.#"
for example.
=item B<Persistent> B<true>|B<false> (Publish only)
Selects the I<delivery method> to use. If set to B<true>, the I<persistent>
mode will be used, i.e. delivery is guaranteed. If set to B<false> (the
default), the I<transient> delivery mode will be used, i.e. messages may be
lost due to high load, overflowing queues or similar issues.
=item B<ConnectionRetryDelay> I<Delay>
When the connection to the AMQP broker is lost, defines the time in seconds to
wait before attempting to reconnect. Defaults to 0, which implies collectd will
attempt to reconnect at each read interval (in Subscribe mode) or each time
values are ready for submission (in Publish mode).
=item B<Format> B<Command>|B<JSON>|B<Graphite> (Publish only)
Selects the format in which messages are sent to the broker. If set to
B<Command> (the default), values are sent as C<PUTVAL> commands which are
identical to the syntax used by the I<Exec> and I<UnixSock plugins>. In this
case, the C<Content-Type> header field will be set to C<text/collectd>.
If set to B<JSON>, the values are encoded in the I<JavaScript Object Notation>,
an easy and straight forward exchange format. The C<Content-Type> header field
will be set to C<application/json>.
If set to B<Graphite>, values are encoded in the I<Graphite> format, which is
"<metric> <value> <timestamp>\n". The C<Content-Type> header field will be set to
C<text/graphite>.
A subscribing client I<should> use the C<Content-Type> header field to
determine how to decode the values. Currently, the I<AMQP plugin> itself can
only decode the B<Command> format.
=item B<StoreRates> B<true>|B<false> (Publish only)
Determines whether or not C<COUNTER>, C<DERIVE> and C<ABSOLUTE> data sources
are converted to a I<rate> (i.e. a C<GAUGE> value). If set to B<false> (the
default), no conversion is performed. Otherwise the conversion is performed
using the internal value cache.
Please note that currently this option is only used if the B<Format> option has
been set to B<JSON>.
=item B<GraphitePrefix> (Publish and B<Format>=I<Graphite> only)
A prefix can be added in the metric name when outputting in the I<Graphite> format.
It's added before the I<Host> name.
Metric name will be "<prefix><host><postfix><plugin><type><name>"
=item B<GraphitePostfix> (Publish and B<Format>=I<Graphite> only)
A postfix can be added in the metric name when outputting in the I<Graphite> format.
It's added after the I<Host> name.
Metric name will be "<prefix><host><postfix><plugin><type><name>"
=item B<GraphiteEscapeChar> (Publish and B<Format>=I<Graphite> only)
Specify a character to replace dots (.) in the host part of the metric name.
In I<Graphite> metric name, dots are used as separators between different
metric parts (host, plugin, type).
Default is "_" (I<Underscore>).
=item B<GraphiteSeparateInstances> B<true>|B<false>
If set to B<true>, the plugin instance and type instance will be in their own
path component, for example C<host.cpu.0.cpu.idle>. If set to B<false> (the
default), the plugin and plugin instance (and likewise the type and type
instance) are put into one component, for example C<host.cpu-0.cpu-idle>.
=item B<GraphiteAlwaysAppendDS> B<true>|B<false>
If set to B<true>, append the name of the I<Data Source> (DS) to the "metric"
identifier. If set to B<false> (the default), this is only done when there is
more than one DS.
=item B<GraphitePreserveSeparator> B<false>|B<true>
If set to B<false> (the default) the C<.> (dot) character is replaced with
I<GraphiteEscapeChar>. Otherwise, if set to B<true>, the C<.> (dot) character
is preserved, i.e. passed through.
=item B<TLSEnabled> B<true>|B<false>
If set to B<true> then connect to the broker using a TLS connection.
If set to B<false> (the default), then a plain text connection is used.
Requires rabbitmq-c >= 0.4.
=item B<TLSVerifyPeer> B<true>|B<false>
If set to B<true> (the default) then the server certificate chain is verified.
Setting this to B<false> will skip verification (insecure).
Requires rabbitmq-c >= 0.8.
=item B<TLSVerifyHostName> B<true>|B<false>
If set to B<true> (the default) then the server host name is verified.
Setting this to B<false> will skip verification (insecure).
Requires rabbitmq-c >= 0.8.
=item B<TLSCACert> I<Path>
Path to the CA cert file in PEM format.
=item B<TLSClientCert> I<Path>
Path to the client certificate in PEM format.
If this is set, then B<TLSClientKey> must be set as well.
=item B<TLSClientKey> I<Path>
Path to the client key in PEM format.
If this is set, then B<TLSClientCert> must be set as well.
=back
=head2 Plugin C<amqp1>
The I<AMQP1 plugin> can be used to communicate with other instances of
I<collectd> or third party applications using an AMQP 1.0 message
intermediary. Metric values or notifications are sent to the
messaging intermediary which may handle direct messaging or
queue based transfer.
B<Synopsis:>
<Plugin "amqp1">
# Send values to an AMQP 1.0 intermediary
<Transport "name">
Host "localhost"
Port "5672"
User "guest"
Password "guest"
Address "collectd"
# RetryDelay 1
<Instance "some_name">
Format "command"
PreSettle false
Notify false
# StoreRates false
# GraphitePrefix "collectd."
# GraphiteEscapeChar "_"
# GraphiteSeparateInstances false
# GraphiteAlwaysAppendDS false
# GraphitePreserveSeparator false
</Instance>
</Transport>
</Plugin>
The plugin's configuration consists of a I<Transport> that configures
communications to the AMQP 1.0 messaging bus and one or more I<Instance>
corresponding to metric or event publishers to the messaging system.
The address in the I<Transport> block concatenated with the name given in the
I<Instance> block starting tag will be used as the send-to address for
communications over the messaging link.
The following options are accepted within each I<Transport> block:
=over 4
=item B<Host> I<Host>
Hostname or IP-address of the AMQP 1.0 intermediary. Defaults to the
default behavior of the underlying communications library,
I<libqpid-proton>, which is "localhost".
=item B<Port> I<Port>
Service name or port number on which the AMQP 1.0 intermediary accepts
connections. This argument must be a string, even if the numeric form
is used. Defaults to "5672".
=item B<User> I<User>
=item B<Password> I<Password>
Credentials used to authenticate to the AMQP 1.0 intermediary. By
default "guest"/"guest" is used.
=item B<Address> I<Address>
This option specifies the prefix for the send-to value in the message.
By default, "collectd" will be used.
=item B<RetryDelay> I<RetryDelay>
When the AMQP1 connection is lost, defines the time in seconds to wait
before attempting to reconnect. Defaults to 1, which implies attempt
to reconnect at 1 second intervals.
=item B<SendQueueLimit> I<SendQueueLimit>
If there is no AMQP1 connection, the plugin will continue to queue
messages to send, which could result in unbounded memory consumption. This
parameter is used to limit the number of messages in the outbound queue to
the specified value. The default value is 0, which disables this feature.
=back
The following options are accepted within each I<Instance> block:
=over 4
=item B<Format> B<Command>|B<JSON>|B<Graphite>
Selects the format in which messages are sent to the intermediary. If set to
B<Command> (the default), values are sent as C<PUTVAL> commands which are
identical to the syntax used by the I<Exec> and I<UnixSock plugins>. In this
case, the C<Content-Type> header field will be set to C<text/collectd>.
If set to B<JSON>, the values are encoded in the I<JavaScript Object Notation>,
an easy and straight forward exchange format. The C<Content-Type> header field
will be set to C<application/json>.
If set to B<Graphite>, values are encoded in the I<Graphite> format, which is
"<metric> <value> <timestamp>\n". The C<Content-Type> header field will be set to
C<text/graphite>.
A subscribing client I<should> use the C<Content-Type> header field to
determine how to decode the values.
=item B<PreSettle> B<true>|B<false>
If set to B<false> (the default), the plugin will wait for a message
acknowledgement from the messaging bus before sending the next
message. This indicates transfer of ownership to the messaging
system. If set to B<true>, the plugin will not wait for a message
acknowledgement and the message may be dropped prior to transfer of
ownership.
=item B<Notify> B<true>|B<false>
If set to B<false> (the default), the plugin will service the
instance write call back as a value list. If set to B<true> the
plugin will service the instance as a write notification callback
for alert formatting.
=item B<StoreRates> B<true>|B<false>
Determines whether or not C<COUNTER>, C<DERIVE> and C<ABSOLUTE> data sources
are converted to a I<rate> (i.e. a C<GAUGE> value). If set to B<false> (the
default), no conversion is performed. Otherwise the conversion is performed
using the internal value cache.
Please note that currently this option is only used if the B<Format> option has
been set to B<JSON>.
=item B<GraphitePrefix>
A prefix can be added in the metric name when outputting in the I<Graphite> format.
It's added before the I<Host> name.
Metric name will be "<prefix><host><postfix><plugin><type><name>"
=item B<GraphitePostfix>
A postfix can be added in the metric name when outputting in the I<Graphite> format.
It's added after the I<Host> name.
Metric name will be "<prefix><host><postfix><plugin><type><name>"
=item B<GraphiteEscapeChar>
Specify a character to replace dots (.) in the host part of the metric name.
In I<Graphite> metric name, dots are used as separators between different
metric parts (host, plugin, type).
Default is "_" (I<Underscore>).
=item B<GraphiteSeparateInstances> B<true>|B<false>
If set to B<true>, the plugin instance and type instance will be in their own
path component, for example C<host.cpu.0.cpu.idle>. If set to B<false> (the
default), the plugin and plugin instance (and likewise the type and type
instance) are put into one component, for example C<host.cpu-0.cpu-idle>.
=item B<GraphiteAlwaysAppendDS> B<true>|B<false>
If set to B<true>, append the name of the I<Data Source> (DS) to the "metric"
identifier. If set to B<false> (the default), this is only done when there is
more than one DS.
=item B<GraphitePreserveSeparator> B<false>|B<true>
If set to B<false> (the default) the C<.> (dot) character is replaced with
I<GraphiteEscapeChar>. Otherwise, if set to B<true>, the C<.> (dot) character
is preserved, i.e. passed through.
=back
=head2 Plugin C<apache>
To configure the C<apache>-plugin you first need to configure the Apache
webserver correctly. The Apache-plugin C<mod_status> needs to be loaded and
working and the C<ExtendedStatus> directive needs to be B<enabled>. You can use
the following snipped to base your Apache config upon:
ExtendedStatus on
<IfModule mod_status.c>
<Location /mod_status>
SetHandler server-status
</Location>
</IfModule>
Since its C<mod_status> module is very similar to Apache's, B<lighttpd> is
also supported. It introduces a new field, called C<BusyServers>, to count the
number of currently connected clients. This field is also supported.
The configuration of the I<Apache> plugin consists of one or more
C<E<lt>InstanceE<nbsp>/E<gt>> blocks. Each block requires one string argument
as the instance name. For example:
<Plugin "apache">
<Instance "www1">
URL "http://www1.example.com/mod_status?auto"
</Instance>
<Instance "www2">
URL "http://www2.example.com/mod_status?auto"
</Instance>
</Plugin>
The instance name will be used as the I<plugin instance>. To emulate the old
(versionE<nbsp>4) behavior, you can use an empty string (""). In order for the
plugin to work correctly, each instance name must be unique. This is not
enforced by the plugin and it is your responsibility to ensure it.
The following options are accepted within each I<Instance> block: