8deaf0eb0adbc52e400c1f8110fd6e0c75b5f059
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 - curl
37 Parse statistics from websites using regular expressions.
39 - bind
40 Name server and resolver statistics from the `statistics-channel'
41 interface of BIND 9.5, 9,6 and later.
43 - conntrack
44 Number of nf_conntrack entries.
46 - cpu
47 CPU utilization: Time spent in the system, user, nice, idle, and related
48 states.
50 - cpufreq
51 CPU frequency (For laptops with speed step or a similar technology)
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, if not found a version shipped with this distribution
457 can be used if the Linux kernel headers are available)
458 For querying iptables counters.
459 <http://netfilter.org/>
461 * libjvm (optional)
462 Library that encapsulates the `Java Virtual Machine' (JVM). This library is
463 used by the Java plugin to execute Java bytecode. See “Configuring with
464 libjvm” below.
466 * libmemcached (optional)
467 Used by the `memcachec' plugin to connect to a memcache daemon.
469 * libmysqlclient (optional)
470 Unsurprisingly used by the `mysql' plugin.
471 <http://dev.mysql.com/>
473 * libnetlink (optional)
474 Used, obviously, for the `netlink' plugin.
475 <http://www.linuxfoundation.org/en/Net:Iproute2>
477 * libnetsnmp (optional)
478 For the `snmp' plugin.
479 <http://www.net-snmp.org/>
481 * libnotify (optional)
482 For the `notify_desktop' plugin.
483 <http://www.galago-project.org/>
485 * liboping (optional, if not found a version shipped with this distribution
486 can be used)
487 Used by the `ping' plugin to send and receive ICMP packets.
488 <http://verplant.org/liboping/>
490 * libowcapi (optional)
491 Used by the `onewire' plugin to read values from onewire sensors (or the
492 owserver(1) daemon).
493 <http://www.owfs.org/>
495 * libpcap (optional)
496 Used to capture packets by the `dns' plugin.
497 <http://www.tcpdump.org/>
499 * libperl (optional)
500 Obviously used by the `perl' plugin. The library has to be compiled with
501 ithread support (introduced in Perl 5.6.0).
502 <http://www.perl.org/>
504 * libpq (optional)
505 The PostgreSQL C client library used by the `postgresql' plugin.
506 <http://www.postgresql.org/>
508 * librrd (optional)
509 Used by the `rrdtool' and `rrdcached' plugins. The latter requires RRDtool
510 client support which was added after version 1.3 of RRDtool. Versions 1.0,
511 1.2 and 1.3 are known to work with the `rrdtool' plugin.
512 <http://oss.oetiker.ch/rrdtool/>
514 * librt, libsocket, libkstat, libdevinfo (optional)
515 Various standard Solaris libraries which provide system functions.
516 <http://developers.sun.com/solaris/>
518 * libsensors (optional)
519 To read from `lm_sensors', see the `sensors' plugin.
520 <http://www.lm-sensors.org/>
522 * libstatgrab (optional)
523 Used by various plugins to collect statistics on systems other than Linux
524 and/or Solaris.
525 <http://www.i-scream.org/libstatgrab/>
527 * libupsclient/nut (optional)
528 For the `nut' plugin which queries nut's `upsd'.
529 <http://networkupstools.org/>
531 * libvirt (optional)
532 Collect statistics from virtual machines.
533 <http://libvirt.org/>
535 * libxml2 (optional)
536 Parse XML data. This is needed for the `ascent' and `libvirt' plugins.
537 <http://xmlsoft.org/>
539 * libxmms (optional)
540 <http://www.xmms.org/>
543 Configuring / Compiling / Installing
544 ------------------------------------
546 To configure, build and install collectd with the default settings, run
547 `./configure && make && make install'. For detailed, generic instructions
548 see INSTALL. For a complete list of configure options and their description,
549 run `./configure --help'.
551 By default, the configure script will check for all build dependencies and
552 disable all plugins whose requirements cannot be fulfilled (any other plugin
553 will be enabled). To enable a plugin, install missing dependencies (see
554 section `Prerequisites' above) and rerun `configure'. If you specify the
555 `--enable-<plugin>' configure option, the script will fail if the depen-
556 dencies for the specified plugin are not met. If you specify the
557 `--disable-<plugin>' configure option, the plugin will not be built. If you
558 specify the `--enable-all-plugins' or `--disable-all-plugins' configure
559 options, all plugins will be enabled or disabled respectively by default.
560 Explicitly enabling or disabling a plugin overwrites the default for the
561 specified plugin. These options are meant for package maintainers and should
562 not be used in everyday situations.
564 By default, collectd will be installed into `/opt/collectd'. You can adjust
565 this setting by specifying the `--prefix' configure option - see INSTALL for
566 details. If you pass DESTDIR=<path> to `make install', <path> will be
567 prefixed to all installation directories. This might be useful when creating
568 packages for collectd.
570 Configuring with libjvm
571 -----------------------
573 To determine the location of the required files of a Java installation is not
574 an easy task, because the locations vary with your kernel (Linux, SunOS, …)
575 and with your architecture (x86, SPARC, …) and there is no ‘java-config’
576 script we could use. Configuration of the JVM library is therefore a bit
577 tricky.
579 The easiest way to use the `--with-java=$JAVA_HOME' option, where
580 `$JAVA_HOME' is usually something like:
581 /usr/lib/jvm/java-1.5.0-sun-1.5.0.14
583 The configure script will then use find(1) to look for the following files:
585 - jni.h
586 - jni_md.h
587 - libjvm.so
589 If found, appropriate CPP-flags and LD-flags are set and the following
590 library checks succeed.
592 If this doesn't work for you, you have the possibility to specify CPP-flags,
593 C-flags and LD-flags for the ‘Java’ plugin by hand, using the following three
594 (environment) variables:
596 - JAVA_CPPFLAGS
597 - JAVA_CFLAGS
598 - JAVA_LDFLAGS
600 For example (shortened for demonstration purposes):
602 ./configure JAVA_CPPFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
604 Adding "-ljvm" to the JAVA_LDFLAGS is done automatically, you don't have to
605 do that.
607 Crosscompiling
608 --------------
610 To compile correctly collectd needs to be able to initialize static
611 variables to NAN (Not A Number). Some C libraries, especially the GNU
612 libc, have a problem with that.
614 Luckily, with GCC it's possible to work around that problem: One can define
615 NAN as being (0.0 / 0.0) and `isnan' as `f != f'. However, to test this
616 ``implementation'' the configure script needs to compile and run a short
617 test program. Obviously running a test program when doing a cross-
618 compilation is, well, challenging.
620 If you run into this problem, you can use the `--with-nan-emulation'
621 configure option to force the use of this implementation. We can't promise
622 that the compiled binary actually behaves as it should, but since NANs
623 are likely never passed to the libm you have a good chance to be lucky.
625 Likewise, collectd needs to know the layout of doubles in memory, in order
626 to craft uniform network packets over different architectures. For this, it
627 needs to know how to convert doubles into the memory layout used by x86. The
628 configure script tries to figure this out by compiling and running a few
629 small test programs. This is of course not possible when cross-compiling.
630 You can use the `--with-fp-layout' option to tell the configure script which
631 conversion method to assume. Valid arguments are:
633 * `nothing' (12345678 -> 12345678)
634 * `endianflip' (12345678 -> 87654321)
635 * `intswap' (12345678 -> 56781234)
638 Contact
639 -------
641 For questions, bug reports, development information and basically all other
642 concerns please send an email to collectd's mailing list at
643 <collectd at verplant.org>.
645 For live discussion and more personal contact visit us in IRC, we're in
646 channel #collectd on freenode.
649 Author
650 ------
652 Florian octo Forster <octo at verplant.org>,
653 Sebastian tokkee Harl <sh at tokkee.org>,
654 and many contributors (see `AUTHORS').
656 Please send bug reports and patches to the mailing list, see `Contact'
657 above.