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 transfered, 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, fanspeed and
30 Statistics about Ascent, a free server for the game `World of Warcraft'.
33 Batterycharge, -current and voltage of ACPI and PMU based laptop
37 Name server and resolver statistics from the `statistics-channel'
38 interface of BIND 9.5, 9,6 and later.
41 Number of nf_conntrack entries.
44 CPU utilization: Time spent in the system, user, nice, idle, and related
48 CPU frequency (For laptops with speed step or a similar technology)
51 Parse statistics from websites using regular expressions.
54 Executes SQL statements on various databases and interprets the returned
58 Mountpoint usage (Basically the values `df(1)' delivers)
61 Disk utilization: Sectors read/written, number of read/write actions,
62 average time an IO-operation took to complete.
65 DNS traffic: Query types, response codes, opcodes and traffic/octets
69 Email statistics: Count, traffic, spam scores and checks.
70 See collectd-email(5).
73 Amount of entropy available to the system.
76 Values gathered by a custom program or script.
80 Count the number of files in directories.
83 Linux file-system based caching framework statistics.
86 Receive multicast traffic from Ganglia instances.
89 Harddisk temperatures using hddtempd.
92 Interface traffic: Number of octets, packets and errors for each
96 Iptables' counters: Number of bytes that were matched by a certain
100 IPMI (Intelligent Platform Management Interface) sensors information.
103 IPVS connection statistics (number of connections, octets and packets
104 for each service and destination).
105 See http://www.linuxvirtualserver.org/software/index.html.
108 IRQ counters: Frequency in which certain interrupts occur.
111 Integrates a `Java Virtual Machine' (JVM) to execute plugins in Java
112 bytecode. See “Configuring with libjvm” below.
115 System load average over the last 1, 5 and 15 minutes.
118 CPU, disk and network I/O statistics from virtual machines.
121 Motherboard sensors: temperature, fanspeed and voltage information,
125 Query and parse data from a memcache daemon (memcached).
128 Statistics of the memcached distributed caching system.
129 <http://www.danga.com/memcached/>
132 Memory utilization: Memory occupied by running processes, page cache,
133 buffer cache and free.
136 Information provided by serial multimeters, such as the `Metex
140 MySQL server statistics: Commands issued, handlers triggered, thread
141 usage, query cache utilization and traffic/octets sent and received.
144 Very detailed Linux network interface and routing statistics. You can get
145 (detailed) information on interfaces, qdiscs, classes, and, if you can
146 make use of it, filters.
149 Receive values that were collected by other hosts. Large setups will
150 want to collect the data on one dedicated machine, and this is the
151 plugin of choice for that.
154 NFS Procedures: Which NFS command were called how often. Only NFSv2 and
158 Collects statistics from `nginx' (speak: engine X), a HTTP and mail
162 NTP daemon statistics: Local clock drift, offset to peers, etc.
165 Network UPS tools: UPS current, voltage, power, charge, utilisation,
166 temperature, etc. See upsd(8).
168 - onewire (EXPERIMENTAL!)
169 Read onewire sensors using the owcapu library of the owfs project.
170 Please read in collectd.conf(5) why this plugin is experimental.
173 RX and TX of each client in openvpn-status.log (status-version 2).
174 <http://openvpn.net/index.php/documentation/howto.html>
177 Query data from an Oracle database.
180 The perl plugin implements a Perl-interpreter into collectd. You can
181 write your own plugins in Perl and return arbitrary values using this
182 API. See collectd-perl(5).
185 Network latency: Time to reach the default gateway or another given
189 PostgreSQL database statistics: active server connections, transaction
190 numbers, block IO, table row manipulations.
193 PowerDNS name server statistics.
196 Process counts: Number of running, sleeping, zombie, ... processes.
199 Counts various aspects of network protocols such as IP, TCP, UDP, etc.
202 RRDtool caching daemon (RRDcacheD) statistics.
205 System sensors, accessed using lm_sensors: Voltages, temperatures and
209 RX and TX of serial interfaces. Linux only; needs root privileges.
212 Read values from SNMP (Simple Network Management Protocol) enabled
213 network devices such as switches, routers, thermometers, rack monitoring
214 servers, etc. See collectd-snmp(5).
217 Pages swapped out onto harddisk or whatever is called `swap' by the OS..
220 Parse table-like structured files.
223 Follows (tails) logfiles, parses them by lines and submits matched
227 Bytes and operations read and written on tape devices. Solaris only.
230 Number of TCP connections to specific local and remote ports.
233 TeamSpeak2 server statistics.
236 Plugin to read values from `The Energy Detective' (TED).
239 Linux ACPI thermal zone information.
242 System uptime statistics.
245 Users currently logged in.
248 Virtual memory statistics, e. g. the number of page-ins/-outs or the
249 number of pagefaults.
252 System resources used by Linux VServers.
253 See <http://linux-vserver.org/>.
256 Link quality of wireless cards. Linux only.
259 Bitrate and frequency of music played with XMMS.
261 * Output can be written or send to various destinations by the following
265 Write to comma separated values (CSV) files. This needs lots of
266 diskspace but is extremely portable and can be analysed with almost
267 every program that can analyse anything. Even Microsoft's Excel..
270 Send the data to a remote host to save the data somehow. This is useful
271 for large setups where the data should be saved by a dedicated machine.
274 Of course the values are propagated to plugins written in Perl, too, so
275 you can easily do weird stuff with the plugins we didn't dare think of
276 ;) See collectd-perl(5).
279 Output to round-robin-database (RRD) files using the RRDtool caching
280 daemon (RRDcacheD) - see rrdcached(1). That daemon provides a general
281 implementation of the caching done by the `rrdtool' plugin.
284 Output to round-robin-database (RRD) files using librrd. See rrdtool(1).
285 This is likely the most popular destination for such values. Since
286 updates to RRD-files are somewhat expensive this plugin can cache
287 updates to the files and write a bunch of updates at once, which lessens
291 One can query the values from the unixsock plugin whenever they're
292 needed. Please read collectd-unixsock(5) for a description on how that's
295 * Logging is, as everything in collectd, provided by plugins. The following
296 plugins keep up informed about what's going on:
299 Writes logmessages to a file or STDOUT/STDERR.
302 Log messages are propagated to plugins written in Perl as well.
303 See collectd-perl(5).
306 Logs to the standard UNIX logging mechanism, syslog.
308 * Notifications can be handled by the following plugins:
311 Send a desktop notification to a notification daemon, as defined in
312 the Desktop Notification Specification. To actually display the
313 notifications, notification-daemon is required.
314 See http://www.galago-project.org/specs/notification/.
317 Send an E-mail with the notification message to the configured
321 Execute a program or script to handle the notification.
322 See collectd-exec(5).
325 Writes the notification message to a file or STDOUT/STDERR.
328 Send the notification to a remote host to handle it somehow.
331 Notifications are propagated to plugins written in Perl as well.
332 See collectd-perl(5).
334 * Value processing can be controlled using the "filter chain" infrastructure
335 and "matches" and "targets". The following plugins are available:
338 Match values by their identifier based on regular expressions.
341 Match values with an invalid timestamp.
344 Select values by their data sources' values.
346 - target_notification
347 Create and dispatch a notification.
350 Replace parts of an identifier using regular expressions.
353 Set (overwrite) entire parts of an identifier.
355 * Miscellaneous plugins:
358 Sets the hostname to an unique identifier. This is meant for setups
359 where each client may migrate to another physical host, possibly going
360 through one or more name changes in the process.
362 * Performance: Since collectd is running as a daemon it doesn't spend much
363 time starting up again and again. With the exception of the exec plugin no
364 processes are forked. Caching in output plugins, such as the rrdtool and
365 network plugins, makes sure your resources are used efficiently. Also,
366 since collectd is programmed multithreaded it benefits from hyperthreading
367 and multicore processors and makes sure that the daemon isn't idle if only
368 one plugins waits for an IO-operation to complete.
370 * Once set up, hardly any maintenance is necessary. Setup is kept as easy
371 as possible and the default values should be okay for most users.
377 * collectd's configuration file can be found at `sysconfdir'/collectd.conf.
378 Run `collectd -h' for a list of builtin defaults. See `collectd.conf(5)'
379 for a list of options and a syntax description.
381 * When the `csv' or `rrdtool' plugins are loaded they'll write the values to
382 files. The usual place for these files is beneath `/var/lib/collectd'.
384 * When using some of the plugins, collectd needs to run as user root, since
385 only root can do certain things, such as craft ICMP packages needed to ping
386 other hosts. collectd should NOT be installed setuid root since it can be
387 used to overwrite valuable files!
389 * Sample scripts to generate graphs reside in `contrib/' in the source
390 package or somewhere near `/usr/share/doc/collectd' in most distributions.
391 Please be aware that those script are meant as a starting point for your
392 own experiments.. Some of them require the `RRDs' Perl module.
393 (`librrds-perl' on Debian) If you have written a more sophisticated
394 solution please share it with us.
396 * The RRAs of the automatically created RRD files depend on the `step'
397 and `heartbeat' settings given. If change these settings you may need to
398 re-create the files, losing all data. Please be aware of that when changing
399 the values and read the rrdtool(1) manpage thoroughly.
402 collectd and chkrootkit
403 -----------------------
405 If you are using the `dns' plugin chkrootkit(1) will report collectd as a
406 packet sniffer ("<iface>: PACKET SNIFFER(/usr/sbin/collectd[<pid>])"). The
407 plugin captures all UDP packets on port 53 to analyze the DNS traffic. In
408 this case, collectd is a legitimate sniffer and the report should be
409 considered to be a false positive. However, you might want to check that
410 this really is collectd and not some other, illegitimate sniffer.
416 To compile collectd from source you will need:
418 * Usual suspects: C compiler, linker, preprocessor, make, ...
420 * A POSIX-threads (pthread) implementation.
421 Since gathering some statistics is slow (network connections, slow devices,
422 etc) the collectd is parallelized. The POSIX threads interface is being
423 used and should be found in various implementations for hopefully all
426 * CoreFoundation.framework and IOKit.framework (optional)
427 For compiling on Darwin in general and the `apple_sensors' plugin in
429 <http://developer.apple.com/corefoundation/>
431 * libclntsh (optional)
432 Used by the `oracle' plugin.
435 If you want to use the `apache', `ascent', `curl' or `nginx' plugin.
436 <http://curl.haxx.se/>
439 Used by the `dbi' plugin to connect to various databases.
440 <http://libdbi.sourceforge.net/>
442 * libesmtp (optional)
443 For the `notify_email' plugin.
444 <http://www.stafford.uklinux.net/libesmtp/>
446 * libganglia (optional)
447 Used by the `gmond' plugin to process data received from Ganglia.
449 * libgcrypt (optional)
450 Used by the `network' plugin for encryption and authentication.
453 If present, the uuid plugin will check for UUID from HAL.
454 <http://hal.freedesktop.org/>
457 For querying iptables counters.
458 <http://netfilter.org/>
460 If not found on the system, a version shipped with this distribution can
461 be used. It requires some Linux headers in /usr/include/linux. You can
462 force the build system to use the shipped version by specifying
463 --with-libiptc=shipped
464 when running the configure script.
467 Library that encapsulates the `Java Virtual Machine' (JVM). This library is
468 used by the Java plugin to execute Java bytecode. See “Configuring with
471 * libmemcached (optional)
472 Used by the `memcachec' plugin to connect to a memcache daemon.
474 * libmysqlclient (optional)
475 Unsurprisingly used by the `mysql' plugin.
476 <http://dev.mysql.com/>
478 * libnetlink (optional)
479 Used, obviously, for the `netlink' plugin.
480 <http://www.linuxfoundation.org/en/Net:Iproute2>
482 * libnetsnmp (optional)
483 For the `snmp' plugin.
484 <http://www.net-snmp.org/>
486 * libnotify (optional)
487 For the `notify_desktop' plugin.
488 <http://www.galago-project.org/>
490 * liboping (optional)
491 Used by the `ping' plugin to send and receive ICMP packets.
492 <http://verplant.org/liboping/>
494 * libowcapi (optional)
495 Used by the `onewire' plugin to read values from onewire sensors (or the
497 <http://www.owfs.org/>
500 Used to capture packets by the `dns' plugin.
501 <http://www.tcpdump.org/>
504 Obviously used by the `perl' plugin. The library has to be compiled with
505 ithread support (introduced in Perl 5.6.0).
506 <http://www.perl.org/>
509 The PostgreSQL C client library used by the `postgresql' plugin.
510 <http://www.postgresql.org/>
513 Used by the `rrdtool' and `rrdcached' plugins. The latter requires RRDtool
514 client support which was added after version 1.3 of RRDtool. Versions 1.0,
515 1.2 and 1.3 are known to work with the `rrdtool' plugin.
516 <http://oss.oetiker.ch/rrdtool/>
518 * librt, libsocket, libkstat, libdevinfo (optional)
519 Various standard Solaris libraries which provide system functions.
520 <http://developers.sun.com/solaris/>
522 * libsensors (optional)
523 To read from `lm_sensors', see the `sensors' plugin.
524 <http://www.lm-sensors.org/>
526 * libstatgrab (optional)
527 Used by various plugins to collect statistics on systems other than Linux
529 <http://www.i-scream.org/libstatgrab/>
531 * libupsclient/nut (optional)
532 For the `nut' plugin which queries nut's `upsd'.
533 <http://networkupstools.org/>
536 Collect statistics from virtual machines.
537 <http://libvirt.org/>
540 Parse XML data. This is needed for the `ascent' and `libvirt' plugins.
541 <http://xmlsoft.org/>
544 <http://www.xmms.org/>
547 Configuring / Compiling / Installing
548 ------------------------------------
550 To configure, build and install collectd with the default settings, run
551 `./configure && make && make install'. For detailed, generic instructions
552 see INSTALL. For a complete list of configure options and their description,
553 run `./configure --help'.
555 By default, the configure script will check for all build dependencies and
556 disable all plugins whose requirements cannot be fulfilled (any other plugin
557 will be enabled). To enable a plugin, install missing dependencies (see
558 section `Prerequisites' above) and rerun `configure'. If you specify the
559 `--enable-<plugin>' configure option, the script will fail if the depen-
560 dencies for the specified plugin are not met. In that case you can force the
561 plugin to be built using the `--enable-<plugin>=force' configure option.
562 This will most likely fail though unless you're working in a very unusual
563 setup and you really know what you're doing. If you specify the
564 `--disable-<plugin>' configure option, the plugin will not be built. If you
565 specify the `--enable-all-plugins' or `--disable-all-plugins' configure
566 options, all plugins will be enabled or disabled respectively by default.
567 Explicitly enabling or disabling a plugin overwrites the default for the
568 specified plugin. These options are meant for package maintainers and should
569 not be used in everyday situations.
571 By default, collectd will be installed into `/opt/collectd'. You can adjust
572 this setting by specifying the `--prefix' configure option - see INSTALL for
573 details. If you pass DESTDIR=<path> to `make install', <path> will be
574 prefixed to all installation directories. This might be useful when creating
575 packages for collectd.
577 Configuring with libjvm
578 -----------------------
580 To determine the location of the required files of a Java installation is not
581 an easy task, because the locations vary with your kernel (Linux, SunOS, …)
582 and with your architecture (x86, SPARC, …) and there is no ‘java-config’
583 script we could use. Configuration of the JVM library is therefore a bit
586 The easiest way to use the `--with-java=$JAVA_HOME' option, where
587 `$JAVA_HOME' is usually something like:
588 /usr/lib/jvm/java-1.5.0-sun-1.5.0.14
590 The configure script will then use find(1) to look for the following files:
596 If found, appropriate CPP-flags and LD-flags are set and the following
597 library checks succeed.
599 If this doesn't work for you, you have the possibility to specify CPP-flags,
600 C-flags and LD-flags for the ‘Java’ plugin by hand, using the following three
601 (environment) variables:
607 For example (shortened for demonstration purposes):
609 ./configure JAVA_CPPFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
611 Adding "-ljvm" to the JAVA_LDFLAGS is done automatically, you don't have to
617 To compile correctly collectd needs to be able to initialize static
618 variables to NAN (Not A Number). Some C libraries, especially the GNU
619 libc, have a problem with that.
621 Luckily, with GCC it's possible to work around that problem: One can define
622 NAN as being (0.0 / 0.0) and `isnan' as `f != f'. However, to test this
623 ``implementation'' the configure script needs to compile and run a short
624 test program. Obviously running a test program when doing a cross-
625 compilation is, well, challenging.
627 If you run into this problem, you can use the `--with-nan-emulation'
628 configure option to force the use of this implementation. We can't promise
629 that the compiled binary actually behaves as it should, but since NANs
630 are likely never passed to the libm you have a good chance to be lucky.
632 Likewise, collectd needs to know the layout of doubles in memory, in order
633 to craft uniform network packets over different architectures. For this, it
634 needs to know how to convert doubles into the memory layout used by x86. The
635 configure script tries to figure this out by compiling and running a few
636 small test programs. This is of course not possible when cross-compiling.
637 You can use the `--with-fp-layout' option to tell the configure script which
638 conversion method to assume. Valid arguments are:
640 * `nothing' (12345678 -> 12345678)
641 * `endianflip' (12345678 -> 87654321)
642 * `intswap' (12345678 -> 56781234)
648 For questions, bug reports, development information and basically all other
649 concerns please send an email to collectd's mailing list at
650 <collectd at verplant.org>.
652 For live discussion and more personal contact visit us in IRC, we're in
653 channel #collectd on freenode.
659 Florian octo Forster <octo at verplant.org>,
660 Sebastian tokkee Harl <sh at tokkee.org>,
661 and many contributors (see `AUTHORS').
663 Please send bug reports and patches to the mailing list, see `Contact'