configure.in: Check libgcrypt minimum version 1.2.0.
[collectd.git] / README
1  collectd - System information collection daemon
2 =================================================
3 http://collectd.org/
4
5 About
6 -----
7
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.
11
12
13 Features
14 --------
15
16   * collectd is able to collect the following data:
17
18     - apache
19       Apache server utilization: Number of bytes transfered, number of
20       requests handled and detailed scoreboard statistics
21
22     - apcups
23       APC UPS Daemon: UPS charge, load, input/output/battery voltage, etc.
24
25     - apple_sensors
26       Sensors in Macs running Mac OS X / Darwin: Temperature, fanspeed and
27       voltage sensors.
28
29     - ascent
30       Statistics about Ascent, a free server for the game `World of Warcraft'.
31
32     - battery
33       Batterycharge, -current and voltage of ACPI and PMU based laptop
34       batteries.
35
36     - curl
37       Parse statistics from websites using regular expressions.
38
39     - bind
40       Name server and resolver statistics from the `statistics-channel'
41       interface of BIND 9.5, 9,6 and later.
42
43     - conntrack
44       Number of nf_conntrack entries.
45
46     - cpu
47       CPU utilization: Time spent in the system, user, nice, idle, and related
48       states.
49
50     - cpufreq
51       CPU frequency (For laptops with speed step or a similar technology)
52
53     - dbi
54       Executes SQL statements on various databases and interprets the returned
55       data.
56
57     - df
58       Mountpoint usage (Basically the values `df(1)' delivers)
59
60     - disk
61       Disk utilization: Sectors read/written, number of read/write actions,
62       average time an IO-operation took to complete.
63
64     - dns
65       DNS traffic: Query types, response codes, opcodes and traffic/octets
66       transfered.
67
68     - email
69       Email statistics: Count, traffic, spam scores and checks.
70       See collectd-email(5).
71
72     - entropy
73       Amount of entropy available to the system.
74
75     - exec
76       Values gathered by a custom program or script.
77       See collectd-exec(5).
78
79     - filecount
80       Count the number of files in directories.
81
82     - gmond
83       Receive multicast traffic from Ganglia instances.
84
85     - hddtemp
86       Harddisk temperatures using hddtempd.
87
88     - interface
89       Interface traffic: Number of octets, packets and errors for each
90       interface.
91
92     - iptables
93       Iptables' counters: Number of bytes that were matched by a certain
94       iptables rule.
95
96     - ipmi
97       IPMI (Intelligent Platform Management Interface) sensors information.
98
99     - ipvs
100       IPVS connection statistics (number of connections, octets and packets
101       for each service and destination).
102       See http://www.linuxvirtualserver.org/software/index.html.
103
104     - irq
105       IRQ counters: Frequency in which certain interrupts occur.
106
107     - java
108       Integrates a `Java Virtual Machine' (JVM) to execute plugins in Java
109       bytecode. See “Configuring with libjvm” below.
110
111     - load
112       System load average over the last 1, 5 and 15 minutes.
113
114     - libvirt
115       CPU, disk and network I/O statistics from virtual machines.
116
117     - mbmon
118       Motherboard sensors: temperature, fanspeed and voltage information,
119       using mbmon(1).
120
121     - memcached
122       Statistics of the memcached distributed caching system.
123       <http://www.danga.com/memcached/>
124
125     - memory
126       Memory utilization: Memory occupied by running processes, page cache,
127       buffer cache and free.
128
129     - multimeter
130       Information provided by serial multimeters, such as the `Metex
131       M-4650CR'.
132
133     - mysql
134       MySQL server statistics: Commands issued, handlers triggered, thread
135       usage, query cache utilization and traffic/octets sent and received.
136
137     - netlink
138       Very detailed Linux network interface and routing statistics. You can get
139       (detailed) information on interfaces, qdiscs, classes, and, if you can
140       make use of it, filters.
141
142     - network
143       Receive values that were collected by other hosts. Large setups will
144       want to collect the data on one dedicated machine, and this is the
145       plugin of choice for that.
146
147     - nfs
148       NFS Procedures: Which NFS command were called how often. Only NFSv2 and
149       NFSv3 right now.
150
151     - nginx
152       Collects statistics from `nginx' (speak: engine X), a HTTP and mail
153       server/proxy.
154
155     - ntpd
156       NTP daemon statistics: Local clock drift, offset to peers, etc.
157
158     - nut
159       Network UPS tools: UPS current, voltage, power, charge, utilisation,
160       temperature, etc. See upsd(8).
161
162     - onewire (EXPERIMENTAL!)
163       Read onewire sensors using the owcapu library of the owfs project.
164       Please read in collectd.conf(5) why this plugin is experimental.
165
166     - openvpn
167       RX and TX of each client in openvpn-status.log (status-version 2).
168       <http://openvpn.net/index.php/documentation/howto.html>
169
170     - oracle
171       Query data from an Oracle database.
172
173     - perl
174       The perl plugin implements a Perl-interpreter into collectd. You can
175       write your own plugins in Perl and return arbitrary values using this
176       API. See collectd-perl(5).
177
178     - ping
179       Network latency: Time to reach the default gateway or another given
180       host.
181
182     - postgresql
183       PostgreSQL database statistics: active server connections, transaction
184       numbers, block IO, table row manipulations.
185
186     - powerdns
187       PowerDNS name server statistics.
188
189     - processes
190       Process counts: Number of running, sleeping, zombie, ... processes.
191
192     - protocols
193       Counts various aspects of network protocols such as IP, TCP, UDP, etc.
194
195     - rrdcached
196       RRDtool caching daemon (RRDcacheD) statistics.
197
198     - sensors
199       System sensors, accessed using lm_sensors: Voltages, temperatures and
200       fan rotation speeds.
201
202     - serial
203       RX and TX of serial interfaces. Linux only; needs root privileges.
204
205     - snmp
206       Read values from SNMP (Simple Network Management Protocol) enabled
207       network devices such as switches, routers, thermometers, rack monitoring
208       servers, etc. See collectd-snmp(5).
209
210     - swap
211       Pages swapped out onto harddisk or whatever is called `swap' by the OS..
212
213     - tail
214       Follows (tails) logfiles, parses them by lines and submits matched
215       values.
216
217     - tape
218       Bytes and operations read and written on tape devices. Solaris only.
219
220     - tcpconns
221       Number of TCP connections to specific local and remote ports.
222
223     - teamspeak2
224       TeamSpeak2 server statistics.
225
226     - ted
227       Plugin to read values from `The Energy Detective' (TED).
228
229     - thermal
230       Linux ACPI thermal zone information.
231
232     - users
233       Users currently logged in.
234
235     - vmem
236       Virtual memory statistics, e. g. the number of page-ins/-outs or the
237       number of pagefaults.
238
239     - vserver
240       System resources used by Linux VServers.
241       See <http://linux-vserver.org/>.
242
243     - wireless
244       Link quality of wireless cards. Linux only.
245
246     - xmms
247       Bitrate and frequency of music played with XMMS.
248
249   * Output can be written or send to various destinations by the following
250     plugins:
251
252     - csv
253       Write to comma separated values (CSV) files. This needs lots of
254       diskspace but is extremely portable and can be analysed with almost
255       every program that can analyse anything. Even Microsoft's Excel..
256
257     - network
258       Send the data to a remote host to save the data somehow. This is useful
259       for large setups where the data should be saved by a dedicated machine.
260
261     - perl
262       Of course the values are propagated to plugins written in Perl, too, so
263       you can easily do weird stuff with the plugins we didn't dare think of
264       ;) See collectd-perl(5).
265
266     - rrdcached
267       Output to round-robin-database (RRD) files using the RRDtool caching
268       daemon (RRDcacheD) - see rrdcached(1). That daemon provides a general
269       implementation of the caching done by the `rrdtool' plugin.
270
271     - rrdtool
272       Output to round-robin-database (RRD) files using librrd. See rrdtool(1).
273       This is likely the most popular destination for such values. Since
274       updates to RRD-files are somewhat expensive this plugin can cache
275       updates to the files and write a bunch of updates at once, which lessens
276       system load a lot.
277
278     - unixsock
279       One can query the values from the unixsock plugin whenever they're
280       needed. Please read collectd-unixsock(5) for a description on how that's
281       done.
282
283   * Logging is, as everything in collectd, provided by plugins. The following
284     plugins keep up informed about what's going on:
285
286     - logfile
287       Writes logmessages to a file or STDOUT/STDERR.
288
289     - perl
290       Log messages are propagated to plugins written in Perl as well.
291       See collectd-perl(5).
292
293     - syslog
294       Logs to the standard UNIX logging mechanism, syslog.
295
296   * Notifications can be handled by the following plugins:
297
298     - notify_desktop
299       Send a desktop notification to a notification daemon, as defined in
300       the Desktop Notification Specification. To actually display the
301       notifications, notification-daemon is required.
302       See http://www.galago-project.org/specs/notification/.
303
304     - notify_email
305       Send an E-mail with the notification message to the configured
306       recipients.
307
308     - exec
309       Execute a program or script to handle the notification.
310       See collectd-exec(5).
311
312     - logfile
313       Writes the notification message to a file or STDOUT/STDERR.
314
315     - network
316       Send the notification to a remote host to handle it somehow.
317
318     - perl
319       Notifications are propagated to plugins written in Perl as well.
320       See collectd-perl(5).
321
322   * Value processing can be controlled using the "filter chain" infrastructure
323     and "matches" and "targets". The following plugins are available:
324
325     - match_regex
326       Match values by their identifier based on regular expressions.
327
328     - match_timediff
329       Match values with an invalid timestamp.
330
331     - match_value
332       Select values by their data sources' values.
333
334     - target_notification
335       Create and dispatch a notification.
336
337     - target_replace
338       Replace parts of an identifier using regular expressions.
339
340     - target_set
341       Set (overwrite) entire parts of an identifier.
342
343   * Miscellaneous plugins:
344
345     - uuid
346       Sets the hostname to an unique identifier. This is meant for setups
347       where each client may migrate to another physical host, possibly going
348       through one or more name changes in the process.
349
350   * Performance: Since collectd is running as a daemon it doesn't spend much
351     time starting up again and again. With the exception of the exec plugin no
352     processes are forked. Caching in output plugins, such as the rrdtool and
353     network plugins, makes sure your resources are used efficiently. Also,
354     since collectd is programmed multithreaded it benefits from hyperthreading
355     and multicore processors and makes sure that the daemon isn't idle if only
356     one plugins waits for an IO-operation to complete.
357
358   * Once set up, hardly any maintenance is necessary. Setup is kept as easy
359     as possible and the default values should be okay for most users.
360
361
362 Operation
363 ---------
364
365   * collectd's configuration file can be found at `sysconfdir'/collectd.conf.
366     Run `collectd -h' for a list of builtin defaults. See `collectd.conf(5)'
367     for a list of options and a syntax description.
368
369   * When the `csv' or `rrdtool' plugins are loaded they'll write the values to
370     files. The usual place for these files is beneath `/var/lib/collectd'.
371
372   * When using some of the plugins, collectd needs to run as user root, since
373     only root can do certain things, such as craft ICMP packages needed to ping
374     other hosts. collectd should NOT be installed setuid root since it can be
375     used to overwrite valuable files!
376
377   * Sample scripts to generate graphs reside in `contrib/' in the source
378     package or somewhere near `/usr/share/doc/collectd' in most distributions.
379     Please be aware that those script are meant as a starting point for your
380     own experiments.. Some of them require the `RRDs' Perl module.
381     (`librrds-perl' on Debian) If you have written a more sophisticated
382     solution please share it with us.
383
384   * The RRAs of the automatically created RRD files depend on the `step'
385     and `heartbeat' settings given. If change these settings you may need to
386     re-create the files, losing all data. Please be aware of that when changing
387     the values and read the rrdtool(1) manpage thoroughly.
388
389
390 collectd and chkrootkit
391 -----------------------
392
393   If you are using the `dns' plugin chkrootkit(1) will report collectd as a
394   packet sniffer ("<iface>: PACKET SNIFFER(/usr/sbin/collectd[<pid>])"). The
395   plugin captures all UDP packets on port 53 to analyze the DNS traffic. In
396   this case, collectd is a legitimate sniffer and the report should be
397   considered to be a false positive. However, you might want to check that
398   this really is collectd and not some other, illegitimate sniffer.
399
400
401 Prerequisites
402 -------------
403
404   To compile collectd from source you will need:
405
406   * Usual suspects: C compiler, linker, preprocessor, make, ...
407
408   * A POSIX-threads (pthread) implementation.
409     Since gathering some statistics is slow (network connections, slow devices,
410     etc) the collectd is parallelized. The POSIX threads interface is being
411     used and should be found in various implementations for hopefully all
412     platforms.
413
414   * CoreFoundation.framework and IOKit.framework (optional)
415     For compiling on Darwin in general and the `apple_sensors' plugin in
416     particular.
417     <http://developer.apple.com/corefoundation/>
418
419   * libclntsh (optional)
420     Used by the `oracle' plugin.
421
422   * libcurl (optional)
423     If you want to use the `apache', `ascent', `curl' or `nginx' plugin.
424     <http://curl.haxx.se/>
425
426   * libdbi (optional)
427     Used by the `dbi' plugin to connect to various databases.
428     <http://libdbi.sourceforge.net/>
429
430   * libesmtp (optional)
431     For the `notify_email' plugin.
432     <http://www.stafford.uklinux.net/libesmtp/>
433
434   * libhal (optional)
435     If present, the uuid plugin will check for UUID from HAL.
436     <http://hal.freedesktop.org/>
437
438   * libiptc (optional, if not found a version shipped with this distribution
439     can be used if the Linux kernel headers are available)
440     For querying iptables counters.
441     <http://netfilter.org/>
442
443   * libjvm (optional)
444     Library that encapsulates the `Java Virtual Machine' (JVM). This library is
445     used by the Java plugin to execute Java bytecode. See “Configuring with
446     libjvm” below.
447
448   * libmysqlclient (optional)
449     Unsurprisingly used by the `mysql' plugin.
450     <http://dev.mysql.com/>
451
452   * libnetlink (optional)
453     Used, obviously, for the `netlink' plugin.
454     <http://www.linuxfoundation.org/en/Net:Iproute2>
455
456   * libnetsnmp (optional)
457     For the `snmp' plugin.
458     <http://www.net-snmp.org/>
459
460   * libnotify (optional)
461     For the `notify_desktop' plugin.
462     <http://www.galago-project.org/>
463
464   * liboping (optional, if not found a version shipped with this distribution
465     can be used)
466     Used by the `ping' plugin to send and receive ICMP packets.
467     <http://verplant.org/liboping/>
468
469   * libowcapi (optional)
470     Used by the `onewire' plugin to read values from onewire sensors (or the
471     owserver(1) daemon).
472     <http://www.owfs.org/>
473
474   * libpcap (optional)
475     Used to capture packets by the `dns' plugin.
476     <http://www.tcpdump.org/>
477
478   * libperl (optional)
479     Obviously used by the `perl' plugin. The library has to be compiled with
480     ithread support (introduced in Perl 5.6.0).
481     <http://www.perl.org/>
482
483   * libpq (optional)
484     The PostgreSQL C client library used by the `postgresql' plugin.
485     <http://www.postgresql.org/>
486
487   * librrd (optional)
488     Used by the `rrdtool' and `rrdcached' plugins. The latter requires RRDtool
489     client support which was added after version 1.3 of RRDtool. Versions 1.0,
490     1.2 and 1.3 are known to work with the `rrdtool' plugin.
491     <http://oss.oetiker.ch/rrdtool/>
492
493   * librt, libsocket, libkstat, libdevinfo (optional)
494     Various standard Solaris libraries which provide system functions.
495     <http://developers.sun.com/solaris/>
496
497   * libsensors (optional)
498     To read from `lm_sensors', see the `sensors' plugin.
499     <http://www.lm-sensors.org/>
500
501   * libstatgrab (optional)
502     Used by various plugins to collect statistics on systems other than Linux
503     and/or Solaris.
504     <http://www.i-scream.org/libstatgrab/>
505
506   * libupsclient/nut (optional)
507     For the `nut' plugin which queries nut's `upsd'.
508     <http://networkupstools.org/>
509
510   * libvirt (optional)
511     Collect statistics from virtual machines.
512     <http://libvirt.org/>
513
514   * libxml2 (optional)
515     Parse XML data. This is needed for the `ascent' and `libvirt' plugins.
516     <http://xmlsoft.org/>
517
518   * libxmms (optional)
519     <http://www.xmms.org/>
520
521
522 Configuring / Compiling / Installing
523 ------------------------------------
524
525   To configure, build and install collectd with the default settings, run
526   `./configure && make && make install'.  For detailed, generic instructions
527   see INSTALL. For a complete list of configure options and their description,
528   run `./configure --help'.
529
530   By default, the configure script will check for all build dependencies and
531   disable all plugins whose requirements cannot be fulfilled (any other plugin
532   will be enabled). To enable a plugin, install missing dependencies (see
533   section `Prerequisites' above) and rerun `configure'. If you specify the
534   `--enable-<plugin>' configure option, the script will fail if the depen-
535   dencies for the specified plugin are not met. If you specify the
536   `--disable-<plugin>' configure option, the plugin will not be built. Both
537   options are meant for package maintainers and should not be used in everyday
538   situations.
539
540   By default, collectd will be installed into `/opt/collectd'. You can adjust
541   this setting by specifying the `--prefix' configure option - see INSTALL for
542   details. If you pass DESTDIR=<path> to `make install', <path> will be
543   prefixed to all installation directories. This might be useful when creating
544   packages for collectd.
545
546 Configuring with libjvm
547 -----------------------
548
549   To determine the location of the required files of a Java installation is not
550   an easy task, because the locations vary with your kernel (Linux, SunOS, …)
551   and with your architecture (x86, SPARC, …) and there is no ‘java-config’
552   script we could use. Configuration of the JVM library is therefore a bit
553   tricky.
554
555   The easiest way to use the `--with-java=$JAVA_HOME' option, where
556   `$JAVA_HOME' is usually something like:
557     /usr/lib/jvm/java-1.5.0-sun-1.5.0.14
558
559   The configure script will then use find(1) to look for the following files:
560
561     - jni.h
562     - jni_md.h
563     - libjvm.so
564
565   If found, appropriate CPP-flags and LD-flags are set and the following
566   library checks succeed.
567
568   If this doesn't work for you, you have the possibility to specify CPP-flags,
569   C-flags and LD-flags for the ‘Java’ plugin by hand, using the following three
570   (environment) variables:
571
572     - JAVA_CPPFLAGS
573     - JAVA_CFLAGS
574     - JAVA_LDFLAGS
575
576   For example (shortened for demonstration purposes):
577
578     ./configure JAVA_CPPFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
579
580   Adding "-ljvm" to the JAVA_LDFLAGS is done automatically, you don't have to
581   do that.
582
583 Crosscompiling
584 --------------
585
586   To compile correctly collectd needs to be able to initialize static
587   variables to NAN (Not A Number). Some C libraries, especially the GNU
588   libc, have a problem with that.
589
590   Luckily, with GCC it's possible to work around that problem: One can define
591   NAN as being (0.0 / 0.0) and `isnan' as `f != f'. However, to test this
592   ``implementation'' the configure script needs to compile and run a short
593   test program. Obviously running a test program when doing a cross-
594   compilation is, well, challenging.
595
596   If you run into this problem, you can use the `--with-nan-emulation'
597   configure option to force the use of this implementation. We can't promise
598   that the compiled binary actually behaves as it should, but since NANs
599   are likely never passed to the libm you have a good chance to be lucky.
600
601   Likewise, collectd needs to know the layout of doubles in memory, in order
602   to craft uniform network packets over different architectures. For this, it
603   needs to know how to convert doubles into the memory layout used by x86. The
604   configure script tries to figure this out by compiling and running a few
605   small test programs. This is of course not possible when cross-compiling.
606   You can use the `--with-fp-layout' option to tell the configure script which
607   conversion method to assume. Valid arguments are:
608
609     * `nothing'    (12345678 -> 12345678)
610     * `endianflip' (12345678 -> 87654321)
611     * `intswap'    (12345678 -> 56781234)
612
613
614 Contact
615 -------
616
617   For questions, bug reports, development information and basically all other
618   concerns please send an email to collectd's mailing list at
619   <collectd at verplant.org>.
620
621   For live discussion and more personal contact visit us in IRC, we're in
622   channel #collectd on freenode.
623
624
625 Author
626 ------
627
628   Florian octo Forster <octo at verplant.org>,
629   Sebastian tokkee Harl <sh at tokkee.org>,
630   and many contributors (see `AUTHORS').
631
632   Please send bug reports and patches to the mailing list, see `Contact'
633   above.
634