1 collectd - System information collection daemon
2 =================================================
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
16 * collectd is able to collect the following data:
19 Apache server utilization: Number of bytes transferred, number of
20 requests handled and detailed scoreboard statistics
23 APC UPS Daemon: UPS charge, load, input/output/battery voltage, etc.
26 Sensors in Macs running Mac OS X / Darwin: Temperature, fan speed and
30 Various sensors in the Aquaero 5 water cooling board made by Aquacomputer.
33 Statistics about Ascent, a free server for the game `World of Warcraft'.
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.
41 Batterycharge, -current and voltage of ACPI and PMU based laptop
45 Name server and resolver statistics from the `statistics-channel'
46 interface of BIND 9.5, 9,6 and later.
49 Statistics from the Ceph distributed storage system.
52 CPU accounting information for process groups under Linux.
55 Chrony daemon statistics: Local clock drift, offset to peers, etc.
58 Number of nf_conntrack entries.
61 Number of context switches done by the operating system.
64 CPU utilization: Time spent in the system, user, nice, idle, and related
68 CPU frequency (For laptops with speed step or a similar technology)
71 CPU sleep: Time spent in suspend (For mobile devices which enter suspend automatically)
74 Parse statistics from websites using regular expressions.
77 Retrieves JSON data via cURL and parses it according to user
81 Retrieves XML data via cURL and parses it according to user
85 Executes SQL statements on various databases and interprets the returned
89 Mountpoint usage (Basically the values `df(1)' delivers)
92 Disk utilization: Sectors read/written, number of read/write actions,
93 average time an IO-operation took to complete.
96 DNS traffic: Query types, response codes, opcodes and traffic/octets
100 Collect DPDK interface statistics.
103 Collect individual drbd resource statistics.
106 Email statistics: Count, traffic, spam scores and checks.
107 See collectd-email(5).
110 Amount of entropy available to the system.
113 Network interface card statistics.
116 Values gathered by a custom program or script.
117 See collectd-exec(5).
120 File handles statistics.
123 Count the number of files in directories.
126 Linux file-system based caching framework statistics.
129 Receive multicast traffic from Ganglia instances.
132 Monitor gps related data through gpsd.
135 Send and receive values over the network using the gRPC framework.
138 Hard disk temperatures using hddtempd.
141 Report the number of used and free hugepages. More info on
142 hugepages can be found here:
143 https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt.
146 Interface traffic: Number of octets, packets and errors for each
150 IPC counters: semaphores used, number of allocated segments in shared
154 IPMI (Intelligent Platform Management Interface) sensors information.
157 Iptables' counters: Number of bytes that were matched by a certain
161 IPVS connection statistics (number of connections, octets and packets
162 for each service and destination).
163 See http://www.linuxvirtualserver.org/software/index.html.
166 IRQ counters: Frequency in which certain interrupts occur.
169 Integrates a `Java Virtual Machine' (JVM) to execute plugins in Java
170 bytecode. See “Configuring with libjvm” below.
173 System load average over the last 1, 5 and 15 minutes.
176 Detailed CPU statistics of the “Logical Partitions” virtualization
177 technique built into IBM's POWER processors.
180 The Lua plugin implements a Lua interpreter into collectd. This
181 makes it possible to write plugins in Lua which are executed by
182 collectd without the need to start a heavy interpreter every interval.
183 See collectd-lua(5) for details.
186 Size of “Logical Volumes” (LV) and “Volume Groups” (VG) of Linux'
187 “Logical Volume Manager” (LVM).
190 Queries very detailed usage statistics from wireless LAN adapters and
191 interfaces that use the Atheros chipset and the MadWifi driver.
194 Motherboard sensors: temperature, fan speed and voltage information,
198 Linux software-RAID device information (number of active, failed, spare
202 Query and parse data from a memcache daemon (memcached).
205 Statistics of the memcached distributed caching system.
206 <http://www.danga.com/memcached/>
209 Memory utilization: Memory occupied by running processes, page cache,
210 buffer cache and free.
213 Collects CPU usage, memory usage, temperatures and power consumption from
214 Intel Many Integrated Core (MIC) CPUs.
217 Reads values from Modbus/TCP enabled devices. Supports reading values
218 from multiple "slaves" so gateway devices can be used.
221 Publishes and subscribes to MQTT topics.
224 Information provided by serial multimeters, such as the `Metex
228 MySQL server statistics: Commands issued, handlers triggered, thread
229 usage, query cache utilization and traffic/octets sent and received.
232 Plugin to query performance values from a NetApp storage system using the
233 “Manage ONTAP” SDK provided by NetApp.
236 Very detailed Linux network interface and routing statistics. You can get
237 (detailed) information on interfaces, qdiscs, classes, and, if you can
238 make use of it, filters.
241 Receive values that were collected by other hosts. Large setups will
242 want to collect the data on one dedicated machine, and this is the
243 plugin of choice for that.
246 NFS Procedures: Which NFS command were called how often. Only NFSv2 and
250 Collects statistics from `nginx' (speak: engine X), a HTTP and mail
254 NTP daemon statistics: Local clock drift, offset to peers, etc.
257 Information about Non-Uniform Memory Access (NUMA).
260 Network UPS tools: UPS current, voltage, power, charge, utilisation,
261 temperature, etc. See upsd(8).
264 Queries routing information from the “Optimized Link State Routing”
267 - onewire (EXPERIMENTAL!)
268 Read onewire sensors using the owcapu library of the owfs project.
269 Please read in collectd.conf(5) why this plugin is experimental.
272 Read monitoring information from OpenLDAP's cn=Monitor subtree.
275 RX and TX of each client in openvpn-status.log (status-version 2).
276 <http://openvpn.net/index.php/documentation/howto.html>
279 Query data from an Oracle database.
282 The perl plugin implements a Perl-interpreter into collectd. You can
283 write your own plugins in Perl and return arbitrary values using this
284 API. See collectd-perl(5).
287 Query statistics from BSD's packet filter "pf".
290 Receive and dispatch timing values from Pinba, a profiling extension for
294 Network latency: Time to reach the default gateway or another given
298 PostgreSQL database statistics: active server connections, transaction
299 numbers, block IO, table row manipulations.
302 PowerDNS name server statistics.
305 Process counts: Number of running, sleeping, zombie, ... processes.
308 Counts various aspects of network protocols such as IP, TCP, UDP, etc.
311 The python plugin implements a Python interpreter into collectd. This
312 makes it possible to write plugins in Python which are executed by
313 collectd without the need to start a heavy interpreter every interval.
314 See collectd-python(5) for details.
317 The redis plugin gathers information from a Redis server, including:
318 uptime, used memory, total connections etc.
321 Query interface and wireless registration statistics from RouterOS.
324 RRDtool caching daemon (RRDcacheD) statistics.
327 System sensors, accessed using lm_sensors: Voltages, temperatures and
331 RX and TX of serial interfaces. Linux only; needs root privileges.
334 Uses libsigrok as a backend, allowing any sigrok-supported device
335 to have its measurements fed to collectd. This includes multimeters,
336 sound level meters, thermometers, and much more.
339 Collect SMART statistics, notably load cycle count, temperature
343 Read values from SNMP (Simple Network Management Protocol) enabled
344 network devices such as switches, routers, thermometers, rack monitoring
345 servers, etc. See collectd-snmp(5).
348 Acts as a StatsD server, reading values sent over the network from StatsD
349 clients and calculating rates and other aggregates out of these values.
352 Pages swapped out onto hard disk or whatever is called `swap' by the OS..
355 Parse table-like structured files.
358 Follows (tails) log files, parses them by lines and submits matched
362 Follows (tails) files in CSV format, parses each line and submits
366 Bytes and operations read and written on tape devices. Solaris only.
369 Number of TCP connections to specific local and remote ports.
372 TeamSpeak2 server statistics.
375 Plugin to read values from `The Energy Detective' (TED).
378 Linux ACPI thermal zone information.
381 Reads the number of records and file size from a running Tokyo Tyrant
385 Reads CPU frequency and C-state residency on modern Intel
386 turbo-capable processors.
389 System uptime statistics.
392 Users currently logged in.
395 Various statistics from Varnish, an HTTP accelerator.
398 CPU, memory, disk and network I/O statistics from virtual machines.
401 Virtual memory statistics, e. g. the number of page-ins/-outs or the
402 number of pagefaults.
405 System resources used by Linux VServers.
406 See <http://linux-vserver.org/>.
409 Link quality of wireless cards. Linux only.
412 XEN Hypervisor CPU stats.
415 Bitrate and frequency of music played with XMMS.
418 Statistics for ZFS' “Adaptive Replacement Cache” (ARC).
421 Measures the percentage of cpu load per container (zone) under Solaris 10
425 Read data from Zookeeper's MNTR command.
427 * Output can be written or sent to various destinations by the following
431 Sends JSON-encoded data to an Advanced Message Queuing Protocol (AMQP)
432 server, such as RabbitMQ.
435 Write to comma separated values (CSV) files. This needs lots of
436 diskspace but is extremely portable and can be analysed with almost
437 every program that can analyse anything. Even Microsoft's Excel..
440 It's possible to implement write plugins in Lua using the Lua
441 plugin. See collectd-lua(5) for details.
444 Send the data to a remote host to save the data somehow. This is useful
445 for large setups where the data should be saved by a dedicated machine.
448 Of course the values are propagated to plugins written in Perl, too, so
449 you can easily do weird stuff with the plugins we didn't dare think of
450 ;) See collectd-perl(5).
453 It's possible to implement write plugins in Python using the python
454 plugin. See collectd-python(5) for details.
457 Output to round-robin-database (RRD) files using the RRDtool caching
458 daemon (RRDcacheD) - see rrdcached(1). That daemon provides a general
459 implementation of the caching done by the `rrdtool' plugin.
462 Output to round-robin-database (RRD) files using librrd. See rrdtool(1).
463 This is likely the most popular destination for such values. Since
464 updates to RRD-files are somewhat expensive this plugin can cache
465 updates to the files and write a bunch of updates at once, which lessens
469 One can query the values from the unixsock plugin whenever they're
470 needed. Please read collectd-unixsock(5) for a description on how that's
474 Sends data to Carbon, the storage layer of Graphite using TCP or UDP. It
475 can be configured to avoid logging send errors (especially useful when
479 Sends the values collected by collectd to a web-server using HTTP POST
480 requests. The transmitted data is either in a form understood by the
481 Exec plugin or formatted in JSON.
484 Sends data to Apache Kafka, a distributed queue.
487 Writes data to the log
490 Sends data to MongoDB, a NoSQL database.
493 Sends the values to a Redis key-value database server.
496 Sends data to Riemann, a stream processing and monitoring system.
499 Sends data to Sensu, a stream processing and monitoring system, via the
500 Sensu client local TCP socket.
503 Sends data OpenTSDB, a scalable no master, no shared state time series
506 * Logging is, as everything in collectd, provided by plugins. The following
507 plugins keep us informed about what's going on:
510 Writes log messages to a file or STDOUT/STDERR.
513 Log messages are propagated to plugins written in Perl as well.
514 See collectd-perl(5).
517 It's possible to implement log plugins in Python using the python plugin.
518 See collectd-python(5) for details.
521 Logs to the standard UNIX logging mechanism, syslog.
524 Writes log messages formatted as logstash JSON events.
526 * Notifications can be handled by the following plugins:
529 Send a desktop notification to a notification daemon, as defined in
530 the Desktop Notification Specification. To actually display the
531 notifications, notification-daemon is required.
532 See http://www.galago-project.org/specs/notification/.
535 Send an E-mail with the notification message to the configured
539 Submit notifications as passive check results to a local nagios instance.
542 Execute a program or script to handle the notification.
543 See collectd-exec(5).
546 Writes the notification message to a file or STDOUT/STDERR.
549 Send the notification to a remote host to handle it somehow.
552 Notifications are propagated to plugins written in Perl as well.
553 See collectd-perl(5).
556 It's possible to implement notification plugins in Python using the
557 python plugin. See collectd-python(5) for details.
559 * Value processing can be controlled using the "filter chain" infrastructure
560 and "matches" and "targets". The following plugins are available:
562 - match_empty_counter
563 Match counter values which are currently zero.
566 Match values using a hash function of the hostname.
569 Match values by their identifier based on regular expressions.
572 Match values with an invalid timestamp.
575 Select values by their data sources' values.
577 - target_notification
578 Create and dispatch a notification.
581 Replace parts of an identifier using regular expressions.
584 Scale (multiply) values by an arbitrary value.
587 Set (overwrite) entire parts of an identifier.
589 * Miscellaneous plugins:
592 Selects multiple value lists based on patterns or regular expressions
593 and creates new aggregated values lists from those.
596 Checks values against configured thresholds and creates notifications if
597 values are out of bounds. See collectd-threshold(5) for details.
600 Sets the hostname to a unique identifier. This is meant for setups
601 where each client may migrate to another physical host, possibly going
602 through one or more name changes in the process.
604 * Performance: Since collectd is running as a daemon it doesn't spend much
605 time starting up again and again. With the exception of the exec plugin no
606 processes are forked. Caching in output plugins, such as the rrdtool and
607 network plugins, makes sure your resources are used efficiently. Also,
608 since collectd is programmed multithreaded it benefits from hyper-threading
609 and multicore processors and makes sure that the daemon isn't idle if only
610 one plugin waits for an IO-operation to complete.
612 * Once set up, hardly any maintenance is necessary. Setup is kept as easy
613 as possible and the default values should be okay for most users.
619 * collectd's configuration file can be found at `sysconfdir'/collectd.conf.
620 Run `collectd -h' for a list of built-in defaults. See `collectd.conf(5)'
621 for a list of options and a syntax description.
623 * When the `csv' or `rrdtool' plugins are loaded they'll write the values to
624 files. The usual place for these files is beneath `/var/lib/collectd'.
626 * When using some of the plugins, collectd needs to run as user root, since
627 only root can do certain things, such as craft ICMP packages needed to ping
628 other hosts. collectd should NOT be installed setuid root since it can be
629 used to overwrite valuable files!
631 * Sample scripts to generate graphs reside in `contrib/' in the source
632 package or somewhere near `/usr/share/doc/collectd' in most distributions.
633 Please be aware that those script are meant as a starting point for your
634 own experiments.. Some of them require the `RRDs' Perl module.
635 (`librrds-perl' on Debian) If you have written a more sophisticated
636 solution please share it with us.
638 * The RRAs of the automatically created RRD files depend on the `step'
639 and `heartbeat' settings given. If change these settings you may need to
640 re-create the files, losing all data. Please be aware of that when changing
641 the values and read the rrdtool(1) manpage thoroughly.
644 collectd and chkrootkit
645 -----------------------
647 If you are using the `dns' plugin chkrootkit(1) will report collectd as a
648 packet sniffer ("<iface>: PACKET SNIFFER(/usr/sbin/collectd[<pid>])"). The
649 plugin captures all UDP packets on port 53 to analyze the DNS traffic. In
650 this case, collectd is a legitimate sniffer and the report should be
651 considered to be a false positive. However, you might want to check that
652 this really is collectd and not some other, illegitimate sniffer.
658 To compile collectd from source you will need:
660 * Usual suspects: C compiler, linker, preprocessor, make, ...
662 * A POSIX-threads (pthread) implementation.
663 Since gathering some statistics is slow (network connections, slow devices,
664 etc) collectd is parallelized. The POSIX threads interface is being
665 used and should be found in various implementations for hopefully all
668 * aerotools-ng (optional)
669 Used by the `aquaero' plugin. Currently, the `libaquaero5' library, which
670 is used by the `aerotools-ng' toolkit, is not compiled as a shared object
671 nor does it feature an installation routine. Therefore, you need to point
672 collectd's configure script at the source directory of the `aerotools-ng'
674 <https://github.com/lynix/aerotools-ng>
676 * CoreFoundation.framework and IOKit.framework (optional)
677 For compiling on Darwin in general and the `apple_sensors' plugin in
679 <http://developer.apple.com/corefoundation/>
681 * libatasmart (optional)
682 Used by the `smart' plugin.
683 <http://git.0pointer.de/?p=libatasmart.git>
686 The `turbostat' plugin can optionally build Linux Capabilities support,
687 which avoids full privileges requirement (aka. running as root) to read
689 <http://sites.google.com/site/fullycapable/>
691 * libclntsh (optional)
692 Used by the `oracle' plugin.
694 * libhiredis (optional)
695 Used by the redis plugin. Please note that you require a 0.10.0 version
696 or higher. <https://github.com/redis/hiredis>
699 If you want to use the `apache', `ascent', `bind', `curl', `curl_json',
700 `curl_xml', `nginx', or `write_http' plugin.
701 <http://curl.haxx.se/>
704 Used by the `dbi' plugin to connect to various databases.
705 <http://libdbi.sourceforge.net/>
707 * libesmtp (optional)
708 For the `notify_email' plugin.
709 <http://www.stafford.uklinux.net/libesmtp/>
711 * libganglia (optional)
712 Used by the `gmond' plugin to process data received from Ganglia.
713 <http://ganglia.info/>
716 Used by the `grpc' plugin. gRPC requires a C++ compiler supporting the
720 * libgcrypt (optional)
721 Used by the `network' plugin for encryption and authentication.
722 <http://www.gnupg.org/>
725 Used by the `gps' plugin.
726 <http://developer.berlios.de/projects/gpsd/>
729 If present, the `uuid' plugin will check for UUID from HAL.
730 <http://hal.freedesktop.org/>
732 * libi2c-dev (optional)
733 Used for the plugin `barometer', provides just the i2c-dev.h header file
734 for user space i2c development.
737 For querying iptables counters.
738 <http://netfilter.org/>
741 Library that encapsulates the `Java Virtual Machine' (JVM). This library is
742 used by the `java' plugin to execute Java bytecode. See “Configuring with
744 <http://openjdk.java.net/> (and others)
747 Used by the `openldap' plugin.
748 <http://www.openldap.org/>
751 Used by the `lua' plugin. Currently, Lua 5.1 and later are supported.
752 <https://www.lua.org/>
755 Used by the `lvm' plugin.
756 <ftp://sources.redhat.com/pub/lvm2/>
758 * libmemcached (optional)
759 Used by the `memcachec' plugin to connect to a memcache daemon.
760 <http://tangent.org/552/libmemcached.html>
763 Used by the `netlink' plugin.
764 <http://www.netfilter.org/projects/libmnl/>
766 * libmodbus (optional)
767 Used by the `modbus' plugin to communicate with Modbus/TCP devices. The
768 `modbus' plugin works with version 2.0.3 of the library – due to frequent
769 API changes other versions may or may not compile cleanly.
770 <http://www.libmodbus.org/>
772 * libmysqlclient (optional)
773 Unsurprisingly used by the `mysql' plugin.
774 <http://dev.mysql.com/>
776 * libnetapp (optional)
777 Required for the `netapp' plugin.
778 This library is part of the “Manage ONTAP SDK” published by NetApp.
780 * libnetsnmp (optional)
781 For the `snmp' plugin.
782 <http://www.net-snmp.org/>
784 * libnotify (optional)
785 For the `notify_desktop' plugin.
786 <http://www.galago-project.org/>
788 * libopenipmi (optional)
789 Used by the `ipmi' plugin to prove IPMI devices.
790 <http://openipmi.sourceforge.net/>
792 * liboping (optional)
793 Used by the `ping' plugin to send and receive ICMP packets.
794 <http://octo.it/liboping/>
796 * libowcapi (optional)
797 Used by the `onewire' plugin to read values from onewire sensors (or the
799 <http://www.owfs.org/>
802 Used to capture packets by the `dns' plugin.
803 <http://www.tcpdump.org/>
805 * libperfstat (optional)
806 Used by various plugins to gather statistics under AIX.
809 Obviously used by the `perl' plugin. The library has to be compiled with
810 ithread support (introduced in Perl 5.6.0).
811 <http://www.perl.org/>
814 The PostgreSQL C client library used by the `postgresql' plugin.
815 <http://www.postgresql.org/>
817 * libprotobuf, protoc 3.0+ (optional)
818 Used by the `grpc' plugin to generate service stubs and code to handle
819 network packets of collectd's protobuf-based network protocol.
820 <https://developers.google.com/protocol-buffers/>
822 * libprotobuf-c, protoc-c (optional)
823 Used by the `pinba' plugin to generate a parser for the network packets
824 sent by the Pinba PHP extension.
825 <http://code.google.com/p/protobuf-c/>
827 * libpython (optional)
828 Used by the `python' plugin. Currently, Python 2.6 and later and Python 3
830 <http://www.python.org/>
832 * librabbitmq (optional; also called “rabbitmq-c”)
833 Used by the `amqp' plugin for AMQP connections, for example to RabbitMQ.
834 <http://hg.rabbitmq.com/rabbitmq-c/>
836 * librdkafka (optional; also called “rdkafka”)
837 Used by the `write_kafka' plugin for producing messages and sending them
839 <https://github.com/edenhill/librdkafka>
841 * librouteros (optional)
842 Used by the `routeros' plugin to connect to a device running `RouterOS'.
843 <http://octo.it/librouteros/>
846 Used by the `rrdtool' and `rrdcached' plugins. The latter requires RRDtool
847 client support which was added after version 1.3 of RRDtool. Versions 1.0,
848 1.2 and 1.3 are known to work with the `rrdtool' plugin.
849 <http://oss.oetiker.ch/rrdtool/>
851 * librt, libsocket, libkstat, libdevinfo (optional)
852 Various standard Solaris libraries which provide system functions.
853 <http://developers.sun.com/solaris/>
855 * libsensors (optional)
856 To read from `lm_sensors', see the `sensors' plugin.
857 <http://www.lm-sensors.org/>
859 * libsigrok (optional)
860 Used by the `sigrok' plugin. In addition, libsigrok depends on glib,
861 libzip, and optionally (depending on which drivers are enabled) on
862 libusb, libftdi and libudev.
864 * libstatgrab (optional)
865 Used by various plugins to collect statistics on systems other than Linux
867 <http://www.i-scream.org/libstatgrab/>
869 * libtokyotyrant (optional)
870 Used by the `tokyotyrant' plugin.
871 <http://1978th.net/tokyotyrant/>
873 * libupsclient/nut (optional)
874 For the `nut' plugin which queries nut's `upsd'.
875 <http://networkupstools.org/>
878 Collect statistics from virtual machines.
879 <http://libvirt.org/>
882 Parse XML data. This is needed for the `ascent', `bind', `curl_xml' and
884 <http://xmlsoft.org/>
887 Used by the `xencpu' plugin.
888 <http://xenbits.xensource.com/>
891 <http://www.xmms.org/>
894 Parse JSON data. This is needed for the `ceph', `curl_json' and
895 `log_logstash' plugins.
896 <http://github.com/lloyd/yajl>
898 * libvarnish (optional)
899 Fetches statistics from a Varnish instance. This is needed for the
901 <http://varnish-cache.org>
903 * riemann-c-client (optional)
904 For the `write_riemann' plugin.
905 <https://github.com/algernon/riemann-c-client>
907 Configuring / Compiling / Installing
908 ------------------------------------
910 To configure, build and install collectd with the default settings, run
911 `./configure && make && make install'. For detailed, generic instructions
912 see INSTALL. For a complete list of configure options and their description,
913 run `./configure --help'.
915 By default, the configure script will check for all build dependencies and
916 disable all plugins whose requirements cannot be fulfilled (any other plugin
917 will be enabled). To enable a plugin, install missing dependencies (see
918 section `Prerequisites' above) and rerun `configure'. If you specify the
919 `--enable-<plugin>' configure option, the script will fail if the depen-
920 dencies for the specified plugin are not met. In that case you can force the
921 plugin to be built using the `--enable-<plugin>=force' configure option.
922 This will most likely fail though unless you're working in a very unusual
923 setup and you really know what you're doing. If you specify the
924 `--disable-<plugin>' configure option, the plugin will not be built. If you
925 specify the `--enable-all-plugins' or `--disable-all-plugins' configure
926 options, all plugins will be enabled or disabled respectively by default.
927 Explicitly enabling or disabling a plugin overwrites the default for the
928 specified plugin. These options are meant for package maintainers and should
929 not be used in everyday situations.
931 By default, collectd will be installed into `/opt/collectd'. You can adjust
932 this setting by specifying the `--prefix' configure option - see INSTALL for
933 details. If you pass DESTDIR=<path> to `make install', <path> will be
934 prefixed to all installation directories. This might be useful when creating
935 packages for collectd.
937 Configuring with libjvm
938 -----------------------
940 To determine the location of the required files of a Java installation is not
941 an easy task, because the locations vary with your kernel (Linux, SunOS, …)
942 and with your architecture (x86, SPARC, …) and there is no ‘java-config’
943 script we could use. Configuration of the JVM library is therefore a bit
946 The easiest way to use the `--with-java=$JAVA_HOME' option, where
947 `$JAVA_HOME' is usually something like:
948 /usr/lib/jvm/java-1.5.0-sun-1.5.0.14
950 The configure script will then use find(1) to look for the following files:
956 If found, appropriate CPP-flags and LD-flags are set and the following
957 library checks succeed.
959 If this doesn't work for you, you have the possibility to specify CPP-flags,
960 C-flags, LD-flags and LIBS for the ‘Java’ plugin by hand, using the
961 following environment variables:
968 For example (shortened for demonstration purposes):
970 ./configure JAVA_CPPFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
972 Adding "-ljvm" to JAVA_LIBS is done automatically, you don't have to
975 Generating the configure script
976 -------------------------------
978 Collectd ships with a `build.sh' script to generate the `configure'
979 script shipped with releases.
981 To generate the `configure` script, you'll need the following dependencies:
991 The `build.sh' script takes no arguments.
996 To compile correctly collectd needs to be able to initialize static
997 variables to NAN (Not A Number). Some C libraries, especially the GNU
998 libc, have a problem with that.
1000 Luckily, with GCC it's possible to work around that problem: One can define
1001 NAN as being (0.0 / 0.0) and `isnan' as `f != f'. However, to test this
1002 ``implementation'' the configure script needs to compile and run a short
1003 test program. Obviously running a test program when doing a cross-
1004 compilation is, well, challenging.
1006 If you run into this problem, you can use the `--with-nan-emulation'
1007 configure option to force the use of this implementation. We can't promise
1008 that the compiled binary actually behaves as it should, but since NANs
1009 are likely never passed to the libm you have a good chance to be lucky.
1011 Likewise, collectd needs to know the layout of doubles in memory, in order
1012 to craft uniform network packets over different architectures. For this, it
1013 needs to know how to convert doubles into the memory layout used by x86. The
1014 configure script tries to figure this out by compiling and running a few
1015 small test programs. This is of course not possible when cross-compiling.
1016 You can use the `--with-fp-layout' option to tell the configure script which
1017 conversion method to assume. Valid arguments are:
1019 * `nothing' (12345678 -> 12345678)
1020 * `endianflip' (12345678 -> 87654321)
1021 * `intswap' (12345678 -> 56781234)
1023 Configuring with DPDK
1024 ---------------------
1026 Note: DPDK 16.04 is the minimum version and currently supported version of DPDK
1027 required for the dpdkstat plugin. This is to allow the plugin to take advantage
1028 of functions added to detect if the DPDK primary process is alive.
1030 Note: For Ubuntu, GCC 4.9 is the minimum version required to build collectd
1031 with DPDK. Ubuntu 14.04, for example, has GCC 4.8 by default and will require
1033 $ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
1034 $ sudo apt-get update
1035 $ sudo apt-get install gcc-4.9
1036 Alternatively, if you know that the platform that you wish to run collectd
1037 on supports the SSSE3 instruction set, you can run make as follows:
1038 $ make -j CFLAGS+='-mssse3'
1040 Build DPDK for use with collectd:
1041 To compile DPDK for use with collectd dpdkstat start by:
1043 $ git clone git://dpdk.org/dpdk
1044 - Checkout the system requirements at
1045 http://dpdk.org/doc/guides/linux_gsg/sys_reqs.html and make sure you have
1046 the required tools and hugepage setup as specified there.
1047 NOTE: It's recommended to use the 1GB hugepage setup for best performance,
1048 please follow the instruction for "Reserving Hugepages for DPDK Use"
1050 However if you plan on configuring 2MB hugepages on the fly please ensure
1051 to add appropriate commands to reserve hugepages in a system startup script
1052 if collectd is booted at system startup time. These commands include:
1054 mount -t hugetlbfs nodev /mnt/huge
1055 echo 64 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
1056 - To configure the DPDK build for the combined shared library modify
1057 config/common_base in your DPDK as follows
1059 # Compile to share library
1061 -CONFIG_RTE_BUILD_SHARED_LIB=n
1062 +CONFIG_RTE_BUILD_SHARED_LIB=y
1063 - Prepare the configuration for the appropriate target as specified at:
1064 http://dpdk.org/doc/guides/linux_gsg/build_dpdk.html.
1066 $ make config T=x86_64-native-linuxapp-gcc
1069 - Install DPDK to /usr
1070 $ sudo make install prefix=/usr
1071 NOTE 1: You must run make install as the configuration of collectd with
1072 DPDK expects DPDK to be installed somewhere.
1073 NOTE 2: If you don't specify a prefix then DPDK will be installed in /usr/local/
1074 NOTE 3: If you are not root then use sudo to make install DPDK to the appropriate
1076 - Check that the DPDK library has been installed in /usr/lib or /lib
1077 $ ls /usr/lib | grep dpdk
1078 - Bind the interfaces to use with dpdkstat to DPDK:
1079 DPDK devices can be setup with either the VFIO (for DPDK 1.7+) or UIO modules.
1080 Note: UIO requires inserting an out of tree driver igb_uio.ko that is available
1085 - Insert igb_uio.ko:
1086 $ sudo insmod $DPDK_BUILD/kmod/igb_uio.ko
1087 - Bind network device to igb_uio:
1088 $ sudo $DPDK_DIR/tools/dpdk_nic_bind.py --bind=igb_uio eth1
1090 - VFIO needs to be supported in the kernel and the BIOS. More information can be found
1091 @ http://dpdk.org/doc/guides/linux_gsg/build_dpdk.html.
1092 - Insert the `vfio-pci.ko' module: modprobe vfio-pci
1093 - Set the correct permissions for the vfio device:
1094 $ sudo /usr/bin/chmod a+x /dev/vfio
1095 $ sudo /usr/bin/chmod 0666 /dev/vfio/*
1096 - Bind the network device to vfio-pci:
1097 $ sudo $DPDK_DIR/tools/dpdk_nic_bind.py --bind=vfio-pci eth1
1098 NOTE: Please ensure to add appropriate commands to bind the network
1099 interfaces to DPDK in a system startup script if collectd is
1100 booted at system startup time.
1101 - Run ldconfig to update the shared library cache.
1103 Build static DPDK library for use with collectd:
1104 - To configure DPDK to build the combined static library libdpdk.a
1105 ensure that CONFIG_RTE_BUILD_SHARED_LIB is set to n in
1106 config/common_base in your DPDK as follows:
1108 # Compile to share library
1110 CONFIG_RTE_BUILD_SHARED_LIB=n
1111 - Prepare the configuration for the appropriate target as specified at:
1112 http://dpdk.org/doc/guides/linux_gsg/build_dpdk.html.
1114 $ make config T=x86_64-native-linuxapp-gcc
1115 - Build the target using -fPIC:
1116 $ make EXTRA_CFLAGS=-fPIC -j
1117 - Install DPDK to /usr
1118 $ sudo make install prefix=/usr
1120 Configure collectd with DPDK:
1121 NOTE: The Address-Space Layout Randomization (ASLR) security feature in Linux should
1122 be disabled, in order for the same hugepage memory mappings to be present in all
1123 DPDK multi-process applications. Note that this has security implications.
1125 $ echo 0 > /proc/sys/kernel/randomize_va_space
1126 To fully enable ASLR:
1127 $ echo 2 > /proc/sys/kernel/randomize_va_space
1128 See http://dpdk.org/doc/guides/prog_guide/multi_proc_support.html
1130 - Generate the build script as specified below. (i.e. run `build.sh').
1131 - Configure collectd with the DPDK shared library:
1132 ./configure --with-libdpdk=/usr
1133 NOTE: To configure collectd with the DPDK static library:
1134 ./configure --with-libdpdk=/usr CFLAGS=" -lpthread -Wl,--whole-archive
1135 -Wl,-ldpdk -Wl,-lm -Wl,-lrt -Wl,-lpcap -Wl,-ldl -Wl,--no-whole-archive"
1139 libdpdk . . . . . . . . yes
1143 dpdkstat . . . . . . .yes
1146 - Make sure that dpdk and dpdkstat are enabled in the configuration log:
1149 $ make -j && make -j install.
1150 NOTE: As mentioned above, if you are building on Ubuntu 14.04 with GCC <= 4.8.X,
1152 $ make -j CFLAGS+='-mssse3' && make -j install
1155 - The same PCI device configuration should be passed to the primary process
1156 as the secondary process uses the same port indexes as the primary.
1157 NOTE: A blacklist/whitelist of NICs isn't supported yet.
1162 For questions, bug reports, development information and basically all other
1163 concerns please send an email to collectd's mailing list at
1164 <list at collectd.org>.
1166 For live discussion and more personal contact visit us in IRC, we're in
1167 channel #collectd on freenode.
1173 Florian octo Forster <octo at collectd.org>,
1174 Sebastian tokkee Harl <sh at tokkee.org>,
1175 and many contributors (see `AUTHORS').
1177 Please use GitHub reporting bugs and submitting pull requests.
1178 See CONTRIBUTING.md for details.