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