1 collectd - System information collection daemon
2 =================================================
3 https://collectd.org/
5 About
6 -----
8 collectd is a small daemon which collects system information periodically
9 and provides mechanisms to store and monitor the values in a variety of
10 ways.
13 Features
14 --------
16 * collectd is able to collect the following data:
18 - apache
19 Apache server utilization: Number of bytes transferred, number of
20 requests handled and detailed scoreboard statistics
22 - apcups
23 APC UPS Daemon: UPS charge, load, input/output/battery voltage, etc.
25 - apple_sensors
26 Sensors in Macs running Mac OS X / Darwin: Temperature, fan speed and
27 voltage sensors.
29 - aquaero
30 Various sensors in the Aquaero 5 water cooling board made by Aquacomputer.
32 - ascent
33 Statistics about Ascent, a free server for the game `World of Warcraft'.
35 - barometer
36 Reads absolute barometric pressure, air pressure reduced to sea level and
37 temperature. Supported sensors are MPL115A2 and MPL3115 from Freescale
38 and BMP085 from Bosch.
40 - battery
41 Batterycharge, -current and voltage of ACPI and PMU based laptop
42 batteries.
44 - bind
45 Name server and resolver statistics from the `statistics-channel'
46 interface of BIND 9.5, 9,6 and later.
48 - ceph
49 Statistics from the Ceph distributed storage system.
51 - cgroups
52 CPU accounting information for process groups under Linux.
54 - chrony
55 Chrony daemon statistics: Local clock drift, offset to peers, etc.
57 - conntrack
58 Number of nf_conntrack entries.
60 - contextswitch
61 Number of context switches done by the operating system.
63 - cpu
64 CPU utilization: Time spent in the system, user, nice, idle, and related
65 states.
67 - cpufreq
68 CPU frequency (For laptops with speed step or a similar technology)
70 - curl
71 Parse statistics from websites using regular expressions.
73 - curl_json
74 Retrieves JSON data via cURL and parses it according to user
75 configuration.
77 - curl_xml
78 Retrieves XML data via cURL and parses it according to user
79 configuration.
81 - dbi
82 Executes SQL statements on various databases and interprets the returned
83 data.
85 - df
86 Mountpoint usage (Basically the values `df(1)' delivers)
88 - disk
89 Disk utilization: Sectors read/written, number of read/write actions,
90 average time an IO-operation took to complete.
92 - dns
93 DNS traffic: Query types, response codes, opcodes and traffic/octets
94 transferred.
96 - dpdk
97 Collect DPDK interface statistics.
99 - drbd
100 Collect individual drbd resource statistics.
102 - email
103 Email statistics: Count, traffic, spam scores and checks.
104 See collectd-email(5).
106 - entropy
107 Amount of entropy available to the system.
109 - ethstat
110 Network interface card statistics.
112 - exec
113 Values gathered by a custom program or script.
114 See collectd-exec(5).
116 - fhcount
117 File handles statistics.
119 - filecount
120 Count the number of files in directories.
122 - fscache
123 Linux file-system based caching framework statistics.
125 - gmond
126 Receive multicast traffic from Ganglia instances.
128 - grpc
129 Receive values over the network using the gRPC framework.
131 - hddtemp
132 Hard disk temperatures using hddtempd.
134 - interface
135 Interface traffic: Number of octets, packets and errors for each
136 interface.
138 - ipc
139 IPC counters: semaphores used, number of allocated segments in shared
140 memory and more.
142 - ipmi
143 IPMI (Intelligent Platform Management Interface) sensors information.
145 - iptables
146 Iptables' counters: Number of bytes that were matched by a certain
147 iptables rule.
149 - ipvs
150 IPVS connection statistics (number of connections, octets and packets
151 for each service and destination).
152 See http://www.linuxvirtualserver.org/software/index.html.
154 - irq
155 IRQ counters: Frequency in which certain interrupts occur.
157 - java
158 Integrates a `Java Virtual Machine' (JVM) to execute plugins in Java
159 bytecode. See “Configuring with libjvm” below.
161 - load
162 System load average over the last 1, 5 and 15 minutes.
164 - lpar
165 Detailed CPU statistics of the “Logical Partitions” virtualization
166 technique built into IBM's POWER processors.
168 - lvm
169 Size of “Logical Volumes” (LV) and “Volume Groups” (VG) of Linux'
170 “Logical Volume Manager” (LVM).
172 - madwifi
173 Queries very detailed usage statistics from wireless LAN adapters and
174 interfaces that use the Atheros chipset and the MadWifi driver.
176 - mbmon
177 Motherboard sensors: temperature, fan speed and voltage information,
178 using mbmon(1).
180 - md
181 Linux software-RAID device information (number of active, failed, spare
182 and missing disks).
184 - memcachec
185 Query and parse data from a memcache daemon (memcached).
187 - memcached
188 Statistics of the memcached distributed caching system.
189 <http://www.danga.com/memcached/>
191 - memory
192 Memory utilization: Memory occupied by running processes, page cache,
193 buffer cache and free.
195 - mic
196 Collects CPU usage, memory usage, temperatures and power consumption from
197 Intel Many Integrated Core (MIC) CPUs.
199 - modbus
200 Reads values from Modbus/TCP enabled devices. Supports reading values
201 from multiple "slaves" so gateway devices can be used.
203 - mqtt
204 Publishes and subscribes to MQTT topics.
206 - multimeter
207 Information provided by serial multimeters, such as the `Metex
208 M-4650CR'.
210 - mysql
211 MySQL server statistics: Commands issued, handlers triggered, thread
212 usage, query cache utilization and traffic/octets sent and received.
214 - netapp
215 Plugin to query performance values from a NetApp storage system using the
216 “Manage ONTAP” SDK provided by NetApp.
218 - netlink
219 Very detailed Linux network interface and routing statistics. You can get
220 (detailed) information on interfaces, qdiscs, classes, and, if you can
221 make use of it, filters.
223 - network
224 Receive values that were collected by other hosts. Large setups will
225 want to collect the data on one dedicated machine, and this is the
226 plugin of choice for that.
228 - nfs
229 NFS Procedures: Which NFS command were called how often. Only NFSv2 and
230 NFSv3 right now.
232 - nginx
233 Collects statistics from `nginx' (speak: engine X), a HTTP and mail
234 server/proxy.
236 - ntpd
237 NTP daemon statistics: Local clock drift, offset to peers, etc.
239 - numa
240 Information about Non-Uniform Memory Access (NUMA).
242 - nut
243 Network UPS tools: UPS current, voltage, power, charge, utilisation,
244 temperature, etc. See upsd(8).
246 - olsrd
247 Queries routing information from the “Optimized Link State Routing”
248 daemon.
250 - onewire (EXPERIMENTAL!)
251 Read onewire sensors using the owcapu library of the owfs project.
252 Please read in collectd.conf(5) why this plugin is experimental.
254 - openldap
255 Read monitoring information from OpenLDAP's cn=Monitor subtree.
257 - openvpn
258 RX and TX of each client in openvpn-status.log (status-version 2).
259 <http://openvpn.net/index.php/documentation/howto.html>
261 - oracle
262 Query data from an Oracle database.
264 - perl
265 The perl plugin implements a Perl-interpreter into collectd. You can
266 write your own plugins in Perl and return arbitrary values using this
267 API. See collectd-perl(5).
269 - pf
270 Query statistics from BSD's packet filter "pf".
272 - pinba
273 Receive and dispatch timing values from Pinba, a profiling extension for
274 PHP.
276 - ping
277 Network latency: Time to reach the default gateway or another given
278 host.
280 - postgresql
281 PostgreSQL database statistics: active server connections, transaction
282 numbers, block IO, table row manipulations.
284 - powerdns
285 PowerDNS name server statistics.
287 - processes
288 Process counts: Number of running, sleeping, zombie, ... processes.
290 - protocols
291 Counts various aspects of network protocols such as IP, TCP, UDP, etc.
293 - python
294 The python plugin implements a Python interpreter into collectd. This
295 makes it possible to write plugins in Python which are executed by
296 collectd without the need to start a heavy interpreter every interval.
297 See collectd-python(5) for details.
299 - redis
300 The redis plugin gathers information from a Redis server, including:
301 uptime, used memory, total connections etc.
303 - routeros
304 Query interface and wireless registration statistics from RouterOS.
306 - rrdcached
307 RRDtool caching daemon (RRDcacheD) statistics.
309 - sensors
310 System sensors, accessed using lm_sensors: Voltages, temperatures and
311 fan rotation speeds.
313 - serial
314 RX and TX of serial interfaces. Linux only; needs root privileges.
316 - sigrok
317 Uses libsigrok as a backend, allowing any sigrok-supported device
318 to have its measurements fed to collectd. This includes multimeters,
319 sound level meters, thermometers, and much more.
321 - smart
322 Collect SMART statistics, notably load cycle count, temperature
323 and bad sectors.
325 - snmp
326 Read values from SNMP (Simple Network Management Protocol) enabled
327 network devices such as switches, routers, thermometers, rack monitoring
328 servers, etc. See collectd-snmp(5).
330 - statsd
331 Acts as a StatsD server, reading values sent over the network from StatsD
332 clients and calculating rates and other aggregates out of these values.
334 - swap
335 Pages swapped out onto hard disk or whatever is called `swap' by the OS..
337 - table
338 Parse table-like structured files.
340 - tail
341 Follows (tails) log files, parses them by lines and submits matched
342 values.
344 - tail_csv
345 Follows (tails) files in CSV format, parses each line and submits
346 extracted values.
348 - tape
349 Bytes and operations read and written on tape devices. Solaris only.
351 - tcpconns
352 Number of TCP connections to specific local and remote ports.
354 - teamspeak2
355 TeamSpeak2 server statistics.
357 - ted
358 Plugin to read values from `The Energy Detective' (TED).
360 - thermal
361 Linux ACPI thermal zone information.
363 - tokyotyrant
364 Reads the number of records and file size from a running Tokyo Tyrant
365 server.
367 - turbostat
368 Reads CPU frequency and C-state residency on modern Intel
369 turbo-capable processors.
371 - uptime
372 System uptime statistics.
374 - users
375 Users currently logged in.
377 - varnish
378 Various statistics from Varnish, an HTTP accelerator.
380 - virt
381 CPU, memory, disk and network I/O statistics from virtual machines.
383 - vmem
384 Virtual memory statistics, e. g. the number of page-ins/-outs or the
385 number of pagefaults.
387 - vserver
388 System resources used by Linux VServers.
389 See <http://linux-vserver.org/>.
391 - wireless
392 Link quality of wireless cards. Linux only.
394 - xencpu
395 XEN Hypervisor CPU stats.
397 - xmms
398 Bitrate and frequency of music played with XMMS.
400 - zfs_arc
401 Statistics for ZFS' “Adaptive Replacement Cache” (ARC).
403 - zone
404 Measures the percentage of cpu load per container (zone) under Solaris 10
405 and higher
407 - zookeeper
408 Read data from Zookeeper's MNTR command.
410 * Output can be written or sent to various destinations by the following
411 plugins:
413 - amqp
414 Sends JSON-encoded data to an Advanced Message Queuing Protocol (AMQP)
415 server, such as RabbitMQ.
417 - csv
418 Write to comma separated values (CSV) files. This needs lots of
419 diskspace but is extremely portable and can be analysed with almost
420 every program that can analyse anything. Even Microsoft's Excel..
422 - network
423 Send the data to a remote host to save the data somehow. This is useful
424 for large setups where the data should be saved by a dedicated machine.
426 - perl
427 Of course the values are propagated to plugins written in Perl, too, so
428 you can easily do weird stuff with the plugins we didn't dare think of
429 ;) See collectd-perl(5).
431 - python
432 It's possible to implement write plugins in Python using the python
433 plugin. See collectd-python(5) for details.
435 - rrdcached
436 Output to round-robin-database (RRD) files using the RRDtool caching
437 daemon (RRDcacheD) - see rrdcached(1). That daemon provides a general
438 implementation of the caching done by the `rrdtool' plugin.
440 - rrdtool
441 Output to round-robin-database (RRD) files using librrd. See rrdtool(1).
442 This is likely the most popular destination for such values. Since
443 updates to RRD-files are somewhat expensive this plugin can cache
444 updates to the files and write a bunch of updates at once, which lessens
445 system load a lot.
447 - unixsock
448 One can query the values from the unixsock plugin whenever they're
449 needed. Please read collectd-unixsock(5) for a description on how that's
450 done.
452 - write_graphite
453 Sends data to Carbon, the storage layer of Graphite using TCP or UDP. It
454 can be configured to avoid logging send errors (especially useful when
455 using UDP).
457 - write_http
458 Sends the values collected by collectd to a web-server using HTTP POST
459 requests. The transmitted data is either in a form understood by the
460 Exec plugin or formatted in JSON.
462 - write_kafka
463 Sends data to Apache Kafka, a distributed queue.
465 - write_log
466 Writes data to the log
468 - write_mongodb
469 Sends data to MongoDB, a NoSQL database.
471 - write_redis
472 Sends the values to a Redis key-value database server.
474 - write_riemann
475 Sends data to Riemann, a stream processing and monitoring system.
477 - write_sensu
478 Sends data to Sensu, a stream processing and monitoring system, via the
479 Sensu client local TCP socket.
481 - write_tsdb
482 Sends data OpenTSDB, a scalable no master, no shared state time series
483 database.
485 * Logging is, as everything in collectd, provided by plugins. The following
486 plugins keep us informed about what's going on:
488 - logfile
489 Writes log messages to a file or STDOUT/STDERR.
491 - perl
492 Log messages are propagated to plugins written in Perl as well.
493 See collectd-perl(5).
495 - python
496 It's possible to implement log plugins in Python using the python plugin.
497 See collectd-python(5) for details.
499 - syslog
500 Logs to the standard UNIX logging mechanism, syslog.
502 - log_logstash
503 Writes log messages formatted as logstash JSON events.
505 * Notifications can be handled by the following plugins:
507 - notify_desktop
508 Send a desktop notification to a notification daemon, as defined in
509 the Desktop Notification Specification. To actually display the
510 notifications, notification-daemon is required.
511 See http://www.galago-project.org/specs/notification/.
513 - notify_email
514 Send an E-mail with the notification message to the configured
515 recipients.
517 - notify_nagios
518 Submit notifications as passive check results to a local nagios instance.
520 - exec
521 Execute a program or script to handle the notification.
522 See collectd-exec(5).
524 - logfile
525 Writes the notification message to a file or STDOUT/STDERR.
527 - network
528 Send the notification to a remote host to handle it somehow.
530 - perl
531 Notifications are propagated to plugins written in Perl as well.
532 See collectd-perl(5).
534 - python
535 It's possible to implement notification plugins in Python using the
536 python plugin. See collectd-python(5) for details.
538 * Value processing can be controlled using the "filter chain" infrastructure
539 and "matches" and "targets". The following plugins are available:
541 - match_empty_counter
542 Match counter values which are currently zero.
544 - match_hashed
545 Match values using a hash function of the hostname.
547 - match_regex
548 Match values by their identifier based on regular expressions.
550 - match_timediff
551 Match values with an invalid timestamp.
553 - match_value
554 Select values by their data sources' values.
556 - target_notification
557 Create and dispatch a notification.
559 - target_replace
560 Replace parts of an identifier using regular expressions.
562 - target_scale
563 Scale (multiply) values by an arbitrary value.
565 - target_set
566 Set (overwrite) entire parts of an identifier.
568 * Miscellaneous plugins:
570 - aggregation
571 Selects multiple value lists based on patterns or regular expressions
572 and creates new aggregated values lists from those.
574 - threshold
575 Checks values against configured thresholds and creates notifications if
576 values are out of bounds. See collectd-threshold(5) for details.
578 - uuid
579 Sets the hostname to a unique identifier. This is meant for setups
580 where each client may migrate to another physical host, possibly going
581 through one or more name changes in the process.
583 * Performance: Since collectd is running as a daemon it doesn't spend much
584 time starting up again and again. With the exception of the exec plugin no
585 processes are forked. Caching in output plugins, such as the rrdtool and
586 network plugins, makes sure your resources are used efficiently. Also,
587 since collectd is programmed multithreaded it benefits from hyper-threading
588 and multicore processors and makes sure that the daemon isn't idle if only
589 one plugin waits for an IO-operation to complete.
591 * Once set up, hardly any maintenance is necessary. Setup is kept as easy
592 as possible and the default values should be okay for most users.
595 Operation
596 ---------
598 * collectd's configuration file can be found at `sysconfdir'/collectd.conf.
599 Run `collectd -h' for a list of built-in defaults. See `collectd.conf(5)'
600 for a list of options and a syntax description.
602 * When the `csv' or `rrdtool' plugins are loaded they'll write the values to
603 files. The usual place for these files is beneath `/var/lib/collectd'.
605 * When using some of the plugins, collectd needs to run as user root, since
606 only root can do certain things, such as craft ICMP packages needed to ping
607 other hosts. collectd should NOT be installed setuid root since it can be
608 used to overwrite valuable files!
610 * Sample scripts to generate graphs reside in `contrib/' in the source
611 package or somewhere near `/usr/share/doc/collectd' in most distributions.
612 Please be aware that those script are meant as a starting point for your
613 own experiments.. Some of them require the `RRDs' Perl module.
614 (`librrds-perl' on Debian) If you have written a more sophisticated
615 solution please share it with us.
617 * The RRAs of the automatically created RRD files depend on the `step'
618 and `heartbeat' settings given. If change these settings you may need to
619 re-create the files, losing all data. Please be aware of that when changing
620 the values and read the rrdtool(1) manpage thoroughly.
623 collectd and chkrootkit
624 -----------------------
626 If you are using the `dns' plugin chkrootkit(1) will report collectd as a
627 packet sniffer ("<iface>: PACKET SNIFFER(/usr/sbin/collectd[<pid>])"). The
628 plugin captures all UDP packets on port 53 to analyze the DNS traffic. In
629 this case, collectd is a legitimate sniffer and the report should be
630 considered to be a false positive. However, you might want to check that
631 this really is collectd and not some other, illegitimate sniffer.
634 Prerequisites
635 -------------
637 To compile collectd from source you will need:
639 * Usual suspects: C compiler, linker, preprocessor, make, ...
641 * A POSIX-threads (pthread) implementation.
642 Since gathering some statistics is slow (network connections, slow devices,
643 etc) collectd is parallelized. The POSIX threads interface is being
644 used and should be found in various implementations for hopefully all
645 platforms.
647 * aerotools-ng (optional)
648 Used by the `aquaero' plugin. Currently, the `libaquaero5' library, which
649 is used by the `aerotools-ng' toolkit, is not compiled as a shared object
650 nor does it feature an installation routine. Therefore, you need to point
651 collectd's configure script at the source directory of the `aerotools-ng'
652 project.
653 <https://github.com/lynix/aerotools-ng>
655 * CoreFoundation.framework and IOKit.framework (optional)
656 For compiling on Darwin in general and the `apple_sensors' plugin in
657 particular.
658 <http://developer.apple.com/corefoundation/>
660 * libatasmart (optional)
661 Used by the `smart' plugin.
662 <http://git.0pointer.de/?p=libatasmart.git>
664 * libcap (optional)
665 The `turbostat' plugin can optionally build Linux Capabilities support,
666 which avoids full privileges requirement (aka. running as root) to read
667 values.
668 <http://sites.google.com/site/fullycapable/>
670 * libclntsh (optional)
671 Used by the `oracle' plugin.
673 * libhiredis (optional)
674 Used by the redis plugin. Please note that you require a 0.10.0 version
675 or higher. <https://github.com/redis/hiredis>
677 * libcurl (optional)
678 If you want to use the `apache', `ascent', `bind', `curl', `curl_json',
679 `curl_xml', `nginx', or `write_http' plugin.
680 <http://curl.haxx.se/>
682 * libdbi (optional)
683 Used by the `dbi' plugin to connect to various databases.
684 <http://libdbi.sourceforge.net/>
686 * libesmtp (optional)
687 For the `notify_email' plugin.
688 <http://www.stafford.uklinux.net/libesmtp/>
690 * libganglia (optional)
691 Used by the `gmond' plugin to process data received from Ganglia.
692 <http://ganglia.info/>
694 * libgrpc (optional)
695 Used by the `grpc' plugin. gRPC requires a C++ compiler supporting the
696 C++11 standard.
697 <https://grpc.io/>
699 * libgcrypt (optional)
700 Used by the `network' plugin for encryption and authentication.
701 <http://www.gnupg.org/>
703 * libhal (optional)
704 If present, the `uuid' plugin will check for UUID from HAL.
705 <http://hal.freedesktop.org/>
707 * libi2c-dev (optional)
708 Used for the plugin `barometer', provides just the i2c-dev.h header file
709 for user space i2c development.
711 * libiptc (optional)
712 For querying iptables counters.
713 <http://netfilter.org/>
715 * libjvm (optional)
716 Library that encapsulates the `Java Virtual Machine' (JVM). This library is
717 used by the `java' plugin to execute Java bytecode. See “Configuring with
718 libjvm” below.
719 <http://openjdk.java.net/> (and others)
721 * libldap (optional)
722 Used by the `openldap' plugin.
723 <http://www.openldap.org/>
725 * liblvm2 (optional)
726 Used by the `lvm' plugin.
727 <ftp://sources.redhat.com/pub/lvm2/>
729 * libmemcached (optional)
730 Used by the `memcachec' plugin to connect to a memcache daemon.
731 <http://tangent.org/552/libmemcached.html>
733 * libmnl (optional)
734 Used by the `netlink' plugin.
735 <http://www.netfilter.org/projects/libmnl/>
737 * libmodbus (optional)
738 Used by the `modbus' plugin to communicate with Modbus/TCP devices. The
739 `modbus' plugin works with version 2.0.3 of the library – due to frequent
740 API changes other versions may or may not compile cleanly.
741 <http://www.libmodbus.org/>
743 * libmysqlclient (optional)
744 Unsurprisingly used by the `mysql' plugin.
745 <http://dev.mysql.com/>
747 * libnetapp (optional)
748 Required for the `netapp' plugin.
749 This library is part of the “Manage ONTAP SDK” published by NetApp.
751 * libnetsnmp (optional)
752 For the `snmp' plugin.
753 <http://www.net-snmp.org/>
755 * libnotify (optional)
756 For the `notify_desktop' plugin.
757 <http://www.galago-project.org/>
759 * libopenipmi (optional)
760 Used by the `ipmi' plugin to prove IPMI devices.
761 <http://openipmi.sourceforge.net/>
763 * liboping (optional)
764 Used by the `ping' plugin to send and receive ICMP packets.
765 <http://octo.it/liboping/>
767 * libowcapi (optional)
768 Used by the `onewire' plugin to read values from onewire sensors (or the
769 owserver(1) daemon).
770 <http://www.owfs.org/>
772 * libpcap (optional)
773 Used to capture packets by the `dns' plugin.
774 <http://www.tcpdump.org/>
776 * libperfstat (optional)
777 Used by various plugins to gather statistics under AIX.
779 * libperl (optional)
780 Obviously used by the `perl' plugin. The library has to be compiled with
781 ithread support (introduced in Perl 5.6.0).
782 <http://www.perl.org/>
784 * libpq (optional)
785 The PostgreSQL C client library used by the `postgresql' plugin.
786 <http://www.postgresql.org/>
788 * libprotobuf, protoc 3.0+ (optional)
789 Used by the `grpc' plugin to generate service stubs and code to handle
790 network packets of collectd's protobuf-based network protocol.
791 <https://developers.google.com/protocol-buffers/>
793 * libprotobuf-c, protoc-c (optional)
794 Used by the `pinba' plugin to generate a parser for the network packets
795 sent by the Pinba PHP extension.
796 <http://code.google.com/p/protobuf-c/>
798 * libpython (optional)
799 Used by the `python' plugin. Currently, Python 2.3 and later and Python 3
800 are supported.
801 <http://www.python.org/>
803 * librabbitmq (optional; also called “rabbitmq-c”)
804 Used by the `amqp' plugin for AMQP connections, for example to RabbitMQ.
805 <http://hg.rabbitmq.com/rabbitmq-c/>
807 * librdkafka (optional; also called “rdkafka”)
808 Used by the `write_kafka' plugin for producing messages and sending them
809 to a Kafka broker.
810 <https://github.com/edenhill/librdkafka>
812 * librouteros (optional)
813 Used by the `routeros' plugin to connect to a device running `RouterOS'.
814 <http://octo.it/librouteros/>
816 * librrd (optional)
817 Used by the `rrdtool' and `rrdcached' plugins. The latter requires RRDtool
818 client support which was added after version 1.3 of RRDtool. Versions 1.0,
819 1.2 and 1.3 are known to work with the `rrdtool' plugin.
820 <http://oss.oetiker.ch/rrdtool/>
822 * librt, libsocket, libkstat, libdevinfo (optional)
823 Various standard Solaris libraries which provide system functions.
824 <http://developers.sun.com/solaris/>
826 * libsensors (optional)
827 To read from `lm_sensors', see the `sensors' plugin.
828 <http://www.lm-sensors.org/>
830 * libsigrok (optional)
831 Used by the `sigrok' plugin. In addition, libsigrok depends on glib,
832 libzip, and optionally (depending on which drivers are enabled) on
833 libusb, libftdi and libudev.
835 * libstatgrab (optional)
836 Used by various plugins to collect statistics on systems other than Linux
837 and/or Solaris.
838 <http://www.i-scream.org/libstatgrab/>
840 * libtokyotyrant (optional)
841 Used by the `tokyotyrant' plugin.
842 <http://1978th.net/tokyotyrant/>
844 * libupsclient/nut (optional)
845 For the `nut' plugin which queries nut's `upsd'.
846 <http://networkupstools.org/>
848 * libvirt (optional)
849 Collect statistics from virtual machines.
850 <http://libvirt.org/>
852 * libxml2 (optional)
853 Parse XML data. This is needed for the `ascent', `bind', `curl_xml' and
854 `virt' plugins.
855 <http://xmlsoft.org/>
857 * libxen (optional)
858 Used by the `xencpu' plugin.
859 <http://xenbits.xensource.com/>
861 * libxmms (optional)
862 <http://www.xmms.org/>
864 * libyajl (optional)
865 Parse JSON data. This is needed for the `ceph', `curl_json' and
866 `log_logstash' plugins.
867 <http://github.com/lloyd/yajl>
869 * libvarnish (optional)
870 Fetches statistics from a Varnish instance. This is needed for the
871 `varnish' plugin.
872 <http://varnish-cache.org>
874 * riemann-c-client (optional)
875 For the `write_riemann' plugin.
876 <https://github.com/algernon/riemann-c-client>
878 Configuring / Compiling / Installing
879 ------------------------------------
881 To configure, build and install collectd with the default settings, run
882 `./configure && make && make install'. For detailed, generic instructions
883 see INSTALL. For a complete list of configure options and their description,
884 run `./configure --help'.
886 By default, the configure script will check for all build dependencies and
887 disable all plugins whose requirements cannot be fulfilled (any other plugin
888 will be enabled). To enable a plugin, install missing dependencies (see
889 section `Prerequisites' above) and rerun `configure'. If you specify the
890 `--enable-<plugin>' configure option, the script will fail if the depen-
891 dencies for the specified plugin are not met. In that case you can force the
892 plugin to be built using the `--enable-<plugin>=force' configure option.
893 This will most likely fail though unless you're working in a very unusual
894 setup and you really know what you're doing. If you specify the
895 `--disable-<plugin>' configure option, the plugin will not be built. If you
896 specify the `--enable-all-plugins' or `--disable-all-plugins' configure
897 options, all plugins will be enabled or disabled respectively by default.
898 Explicitly enabling or disabling a plugin overwrites the default for the
899 specified plugin. These options are meant for package maintainers and should
900 not be used in everyday situations.
902 By default, collectd will be installed into `/opt/collectd'. You can adjust
903 this setting by specifying the `--prefix' configure option - see INSTALL for
904 details. If you pass DESTDIR=<path> to `make install', <path> will be
905 prefixed to all installation directories. This might be useful when creating
906 packages for collectd.
908 Configuring with libjvm
909 -----------------------
911 To determine the location of the required files of a Java installation is not
912 an easy task, because the locations vary with your kernel (Linux, SunOS, …)
913 and with your architecture (x86, SPARC, …) and there is no ‘java-config’
914 script we could use. Configuration of the JVM library is therefore a bit
915 tricky.
917 The easiest way to use the `--with-java=$JAVA_HOME' option, where
918 `$JAVA_HOME' is usually something like:
919 /usr/lib/jvm/java-1.5.0-sun-1.5.0.14
921 The configure script will then use find(1) to look for the following files:
923 - jni.h
924 - jni_md.h
925 - libjvm.so
927 If found, appropriate CPP-flags and LD-flags are set and the following
928 library checks succeed.
930 If this doesn't work for you, you have the possibility to specify CPP-flags,
931 C-flags, LD-flags and LIBS for the ‘Java’ plugin by hand, using the
932 following environment variables:
934 - JAVA_CPPFLAGS
935 - JAVA_CFLAGS
936 - JAVA_LDFLAGS
937 - JAVA_LIBS
939 For example (shortened for demonstration purposes):
941 ./configure JAVA_CPPFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
943 Adding "-ljvm" to JAVA_LIBS is done automatically, you don't have to
944 do that.
946 Generating the configure script
947 -------------------------------
949 Collectd ships with a `build.sh' script to generate the `configure'
950 script shipped with releases.
952 To generate the `configure` script, you'll need the following dependencies:
954 - autoconf
955 - automake
956 - flex
957 - bison
958 - libtool
959 - libtool-ltdl
960 - pkg-config
962 The `build.sh' script takes no arguments.
964 Crosscompiling
965 --------------
967 To compile correctly collectd needs to be able to initialize static
968 variables to NAN (Not A Number). Some C libraries, especially the GNU
969 libc, have a problem with that.
971 Luckily, with GCC it's possible to work around that problem: One can define
972 NAN as being (0.0 / 0.0) and `isnan' as `f != f'. However, to test this
973 ``implementation'' the configure script needs to compile and run a short
974 test program. Obviously running a test program when doing a cross-
975 compilation is, well, challenging.
977 If you run into this problem, you can use the `--with-nan-emulation'
978 configure option to force the use of this implementation. We can't promise
979 that the compiled binary actually behaves as it should, but since NANs
980 are likely never passed to the libm you have a good chance to be lucky.
982 Likewise, collectd needs to know the layout of doubles in memory, in order
983 to craft uniform network packets over different architectures. For this, it
984 needs to know how to convert doubles into the memory layout used by x86. The
985 configure script tries to figure this out by compiling and running a few
986 small test programs. This is of course not possible when cross-compiling.
987 You can use the `--with-fp-layout' option to tell the configure script which
988 conversion method to assume. Valid arguments are:
990 * `nothing' (12345678 -> 12345678)
991 * `endianflip' (12345678 -> 87654321)
992 * `intswap' (12345678 -> 56781234)
994 Configuring with DPDK
995 ---------------------
997 Note: DPDK 16.04 is the minimum version of DPDK required for the dpdkstat
998 plugin. This is to allow the plugin to take advantage of functions added to
999 detect if the DPDK primary process is alive.
1001 Build DPDK for use with collectd:
1002 To compile DPDK for use with collectd dpdkstat start by:
1003 - Clone DPDK:
1004 $ git clone git://dpdk.org/dpdk
1005 - Checkout the system requirements at
1006 http://dpdk.org/doc/guides/linux_gsg/sys_reqs.html and make sure you have
1007 the required tools and hugepage setup as specified there.
1008 NOTE: It's recommended to use the 1GB hugepage setup for best performance,
1009 please follow the instruction for "Reserving Hugepages for DPDK Use"
1010 in the link above.
1011 However if you plan on configuring 2MB hugepages on the fly please ensure
1012 to add appropriate commands to reserve hugepages in a system startup script
1013 if collectd is booted at system startup time. These commands include:
1014 mkdir -p /mnt/huge
1015 mount -t hugetlbfs nodev /mnt/huge
1016 echo 64 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
1017 - To configure the DPDK build for the combined shared library modify
1018 config/common_base in your DPDK as follows
1019 #
1020 # Compile to share library
1021 #
1022 -CONFIG_RTE_BUILD_SHARED_LIB=n
1023 +CONFIG_RTE_BUILD_SHARED_LIB=y
1024 - Prepare the configuration for the appropriate target as specified at:
1025 http://dpdk.org/doc/guides/linux_gsg/build_dpdk.html.
1026 For example:
1027 $ make config T=x86_64-native-linuxapp-gcc
1028 - Build the target:
1029 $ make
1030 - Install DPDK to /usr
1031 $ sudo make install prefix=/usr
1032 NOTE 1: You must run make install as the configuration of collectd with
1033 DPDK expects DPDK to be installed somewhere.
1034 NOTE 2: If you don't specify a prefix then DPDK will be installed in /usr/local/
1035 NOTE 3: If you are not root then use sudo to make install DPDK to the appropriate
1036 location.
1037 - Check that the DPDK library has been installed in /usr/lib or /lib
1038 $ ls /usr/lib | grep dpdk
1039 - Bind the interfaces to use with dpdkstat to DPDK:
1040 DPDK devices can be setup with either the VFIO (for DPDK 1.7+) or UIO modules.
1041 Note: UIO requires inserting an out of tree driver igb_uio.ko that is available
1042 in DPDK.
1043 UIO Setup:
1044 - Insert uio.ko:
1045 $ sudo modprobe uio
1046 - Insert igb_uio.ko:
1047 $ sudo insmod $DPDK_BUILD/kmod/igb_uio.ko
1048 - Bind network device to igb_uio:
1049 $ sudo $DPDK_DIR/tools/dpdk_nic_bind.py --bind=igb_uio eth1
1050 VFIO Setup:
1051 - VFIO needs to be supported in the kernel and the BIOS. More information can be found
1052 @ http://dpdk.org/doc/guides/linux_gsg/build_dpdk.html.
1053 - Insert the `vfio-pci.ko' module: modprobe vfio-pci
1054 - Set the correct permissions for the vfio device:
1055 $ sudo /usr/bin/chmod a+x /dev/vfio
1056 $ sudo /usr/bin/chmod 0666 /dev/vfio/*
1057 - Bind the network device to vfio-pci:
1058 $ sudo $DPDK_DIR/tools/dpdk_nic_bind.py --bind=vfio-pci eth1
1059 NOTE: Please ensure to add appropriate commands to bind the network
1060 interfaces to DPDK in a system startup script if collectd is
1061 booted at system startup time.
1062 - Run ldconfig to update the shared library cache.
1064 Configure collectd with DPDK:
1065 - Generate the build script as specified below. (i.e. run `build.sh').
1066 - Configure collectd with the DPDK library:
1067 ./configure --with-libdpdk=/usr
1069 Libraries:
1070 ...
1071 libdpdk . . . . . . . . yes
1073 Modules:
1074 ...
1075 dpdkstat . . . . . . .yes
1078 - Make sure that dpdk and dpdkstat are enabled in the configuration log:
1080 - Build collectd:
1081 $ make -j && make -j install.
1082 NOTE: If you are building on Ubuntu 14.04 you need to use:
1083 $ make -j CFLAGS+='-mavx' && make -j install
1085 Usage of dpdkstat:
1086 - The same PCI device configuration should be passed to the primary process
1087 as the secondary process uses the same port indexes as the primary.
1088 NOTE: A blacklist/whitelist of NICs isn't supported yet.
1090 Contact
1091 -------
1093 For questions, bug reports, development information and basically all other
1094 concerns please send an email to collectd's mailing list at
1095 <list at collectd.org>.
1097 For live discussion and more personal contact visit us in IRC, we're in
1098 channel #collectd on freenode.
1101 Author
1102 ------
1104 Florian octo Forster <octo at collectd.org>,
1105 Sebastian tokkee Harl <sh at tokkee.org>,
1106 and many contributors (see `AUTHORS').
1108 Please send bug reports and patches to the mailing list, see `Contact'
1109 above.