1 collectd - System information collection daemon
2 =================================================
3 http://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 transfered, 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, fanspeed and
27 voltage sensors.
29 - ascent
30 Statistics about Ascent, a free server for the game `World of Warcraft'.
32 - battery
33 Batterycharge, -current and voltage of ACPI and PMU based laptop
34 batteries.
36 - bind
37 Name server and resolver statistics from the `statistics-channel'
38 interface of BIND 9.5, 9,6 and later.
40 - conntrack
41 Number of nf_conntrack entries.
43 - cpu
44 CPU utilization: Time spent in the system, user, nice, idle, and related
45 states.
47 - cpufreq
48 CPU frequency (For laptops with speed step or a similar technology)
50 - curl
51 Parse statistics from websites using regular expressions.
53 - dbi
54 Executes SQL statements on various databases and interprets the returned
55 data.
57 - df
58 Mountpoint usage (Basically the values `df(1)' delivers)
60 - disk
61 Disk utilization: Sectors read/written, number of read/write actions,
62 average time an IO-operation took to complete.
64 - dns
65 DNS traffic: Query types, response codes, opcodes and traffic/octets
66 transfered.
68 - email
69 Email statistics: Count, traffic, spam scores and checks.
70 See collectd-email(5).
72 - entropy
73 Amount of entropy available to the system.
75 - exec
76 Values gathered by a custom program or script.
77 See collectd-exec(5).
79 - filecount
80 Count the number of files in directories.
82 - fscache
83 Linux file-system based caching framework statistics.
85 - gmond
86 Receive multicast traffic from Ganglia instances.
88 - hddtemp
89 Harddisk temperatures using hddtempd.
91 - interface
92 Interface traffic: Number of octets, packets and errors for each
93 interface.
95 - iptables
96 Iptables' counters: Number of bytes that were matched by a certain
97 iptables rule.
99 - ipmi
100 IPMI (Intelligent Platform Management Interface) sensors information.
102 - ipvs
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.
107 - irq
108 IRQ counters: Frequency in which certain interrupts occur.
110 - java
111 Integrates a `Java Virtual Machine' (JVM) to execute plugins in Java
112 bytecode. See “Configuring with libjvm” below.
114 - load
115 System load average over the last 1, 5 and 15 minutes.
117 - libvirt
118 CPU, disk and network I/O statistics from virtual machines.
120 - mbmon
121 Motherboard sensors: temperature, fanspeed and voltage information,
122 using mbmon(1).
124 - memcachec
125 Query and parse data from a memcache daemon (memcached).
127 - memcached
128 Statistics of the memcached distributed caching system.
129 <http://www.danga.com/memcached/>
131 - memory
132 Memory utilization: Memory occupied by running processes, page cache,
133 buffer cache and free.
135 - multimeter
136 Information provided by serial multimeters, such as the `Metex
137 M-4650CR'.
139 - mysql
140 MySQL server statistics: Commands issued, handlers triggered, thread
141 usage, query cache utilization and traffic/octets sent and received.
143 - netlink
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.
148 - network
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.
153 - nfs
154 NFS Procedures: Which NFS command were called how often. Only NFSv2 and
155 NFSv3 right now.
157 - nginx
158 Collects statistics from `nginx' (speak: engine X), a HTTP and mail
159 server/proxy.
161 - ntpd
162 NTP daemon statistics: Local clock drift, offset to peers, etc.
164 - nut
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.
172 - openvpn
173 RX and TX of each client in openvpn-status.log (status-version 2).
174 <http://openvpn.net/index.php/documentation/howto.html>
176 - oracle
177 Query data from an Oracle database.
179 - perl
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).
184 - ping
185 Network latency: Time to reach the default gateway or another given
186 host.
188 - postgresql
189 PostgreSQL database statistics: active server connections, transaction
190 numbers, block IO, table row manipulations.
192 - powerdns
193 PowerDNS name server statistics.
195 - processes
196 Process counts: Number of running, sleeping, zombie, ... processes.
198 - protocols
199 Counts various aspects of network protocols such as IP, TCP, UDP, etc.
201 - rrdcached
202 RRDtool caching daemon (RRDcacheD) statistics.
204 - sensors
205 System sensors, accessed using lm_sensors: Voltages, temperatures and
206 fan rotation speeds.
208 - serial
209 RX and TX of serial interfaces. Linux only; needs root privileges.
211 - snmp
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).
216 - swap
217 Pages swapped out onto harddisk or whatever is called `swap' by the OS..
219 - table
220 Parse table-like structured files.
222 - tail
223 Follows (tails) logfiles, parses them by lines and submits matched
224 values.
226 - tape
227 Bytes and operations read and written on tape devices. Solaris only.
229 - tcpconns
230 Number of TCP connections to specific local and remote ports.
232 - teamspeak2
233 TeamSpeak2 server statistics.
235 - ted
236 Plugin to read values from `The Energy Detective' (TED).
238 - thermal
239 Linux ACPI thermal zone information.
241 - uptime
242 System uptime statistics.
244 - users
245 Users currently logged in.
247 - vmem
248 Virtual memory statistics, e. g. the number of page-ins/-outs or the
249 number of pagefaults.
251 - vserver
252 System resources used by Linux VServers.
253 See <http://linux-vserver.org/>.
255 - wireless
256 Link quality of wireless cards. Linux only.
258 - xmms
259 Bitrate and frequency of music played with XMMS.
261 * Output can be written or send to various destinations by the following
262 plugins:
264 - csv
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..
269 - network
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.
273 - perl
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).
278 - rrdcached
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.
283 - rrdtool
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
288 system load a lot.
290 - unixsock
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
293 done.
295 * Logging is, as everything in collectd, provided by plugins. The following
296 plugins keep up informed about what's going on:
298 - logfile
299 Writes logmessages to a file or STDOUT/STDERR.
301 - perl
302 Log messages are propagated to plugins written in Perl as well.
303 See collectd-perl(5).
305 - syslog
306 Logs to the standard UNIX logging mechanism, syslog.
308 * Notifications can be handled by the following plugins:
310 - notify_desktop
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/.
316 - notify_email
317 Send an E-mail with the notification message to the configured
318 recipients.
320 - exec
321 Execute a program or script to handle the notification.
322 See collectd-exec(5).
324 - logfile
325 Writes the notification message to a file or STDOUT/STDERR.
327 - network
328 Send the notification to a remote host to handle it somehow.
330 - perl
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:
337 - match_regex
338 Match values by their identifier based on regular expressions.
340 - match_timediff
341 Match values with an invalid timestamp.
343 - match_value
344 Select values by their data sources' values.
346 - target_notification
347 Create and dispatch a notification.
349 - target_replace
350 Replace parts of an identifier using regular expressions.
352 - target_set
353 Set (overwrite) entire parts of an identifier.
355 * Miscellaneous plugins:
357 - uuid
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.
374 Operation
375 ---------
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.
413 Prerequisites
414 -------------
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
424 platforms.
426 * CoreFoundation.framework and IOKit.framework (optional)
427 For compiling on Darwin in general and the `apple_sensors' plugin in
428 particular.
429 <http://developer.apple.com/corefoundation/>
431 * libclntsh (optional)
432 Used by the `oracle' plugin.
434 * libcurl (optional)
435 If you want to use the `apache', `ascent', `curl' or `nginx' plugin.
436 <http://curl.haxx.se/>
438 * libdbi (optional)
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.
452 * libhal (optional)
453 If present, the uuid plugin will check for UUID from HAL.
454 <http://hal.freedesktop.org/>
456 * libiptc (optional)
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.
466 * libjvm (optional)
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
469 libjvm” below.
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
496 owserver(1) daemon).
497 <http://www.owfs.org/>
499 * libpcap (optional)
500 Used to capture packets by the `dns' plugin.
501 <http://www.tcpdump.org/>
503 * libperl (optional)
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/>
508 * libpq (optional)
509 The PostgreSQL C client library used by the `postgresql' plugin.
510 <http://www.postgresql.org/>
512 * librrd (optional)
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
528 and/or Solaris.
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/>
535 * libvirt (optional)
536 Collect statistics from virtual machines.
537 <http://libvirt.org/>
539 * libxml2 (optional)
540 Parse XML data. This is needed for the `ascent' and `libvirt' plugins.
541 <http://xmlsoft.org/>
543 * libxmms (optional)
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
584 tricky.
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:
592 - jni.h
593 - jni_md.h
594 - libjvm.so
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:
603 - JAVA_CPPFLAGS
604 - JAVA_CFLAGS
605 - JAVA_LDFLAGS
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
612 do that.
614 Crosscompiling
615 --------------
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)
645 Contact
646 -------
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.
656 Author
657 ------
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'
664 above.