Code

Added RRD layout (RRAs) of `mysql_qcache.rrd' and `mysql_threads.rrd' to the manpage
[collectd.git] / src / collectd.pod
1 =head1 NAME
3 collectd - System statistics collection daemon
5 =head1 SYNOPSIS
7 collectd I<[options]>
9 =head1 DESCRIPTION
11 collectd is a daemon that collects various system statistics periodically and
12 stores them into RRD-files. Which data is collected depends on compile-time
13 settings. The following features may be available:
15 =over 4
17 =item
19 Battery status (I<battery>)
21 =item
23 CPU utilization (I<cpu>)
25 =item
27 Mountpoint usage (I<df>)
29 =item
31 Disk and partition usage/throughput (I<disk>)
33 =item
35 Harddisk temperatures (I<hddtemp>)
37 =item
39 System load averages (I<load>)
41 =item
43 Memory usage (I<memory>)
45 =item
47 MySQL statistics (I<mysql>)
49 =item
51 NFS utilization (I<nfs>, Linux only)
53 =item
55 Network latency (I<ping>)
57 =item
59 Number of processes (I<processes>, Linux only)
61 =item
63 lm_sensors information (I<sensors>, Linux only)
65 =item
67 Serial port traffic (I<serial>, Linux only)
69 =item
71 Swap usage (I<swap>)
73 =item
75 Tape drive usage (I<tape>, Solaris only)
77 =item
79 Network traffic (I<traffic>)
81 =item
83 Number of users logged into the system (I<users>)
85 =back
87 =head1 OPTIONS
89 =over 4
91 =item B<-C> I<E<lt>config-fileE<gt>>
93 Specify an alternative config file. This is the place to go when you wish to
94 change B<collectd>'s behavior. The path may be relative to the current working
95 directory.
97 =item B<-f>
99 Don't fork to the background. I<collectd> will also B<not> close standard file
100 descriptors, detach from the session nor write a pid file. This is mainly
101 thought for 'supervisioning' init replacements such as I<runit>.
103 =item B<-h>
105 Output usage information and exit.
107 =back
109 =head1 RRD FILES
111 The RRD files are created automatically with the following RRAs:
113   RRA:AVERAGE:0.2:6:1500
114   RRA:AVERAGE:0.1:180:1680
115   RRA:AVERAGE:0.1:2160:1520
116   RRA:MIN:0.2:6:1500
117   RRA:MIN:0.1:180:1680
118   RRA:MIN:0.1:2160:1520
119   RRA:MAX:0.2:6:1500
120   RRA:MAX:0.1:180:1680
121   RRA:MAX:0.1:2160:1520
123 Since collectd uses a 10 second I<step> the RRAs contain the following
124 timespans:
126   Resolution | Data points |  Timespan
127   -----------+-------------+----------
128   60 seconds |        1500 |  25 hours
129   30 minutes |        1680 |  35 days
130    6 hours   |        1520 | 380 days
132 The DS'es depend on the module creating the RRD files:
134 =over 4
136 =item Battery charge (F<battery-I<E<lt>nameE<gt>>/charge.rrd>)
138   DS:charge:GAUGE:25:0:U
140 =item Battery current (F<battery-I<E<lt>nameE<gt>>/current.rrd>)
142   DS:current:GAUGE:25:U:U
144 =item Battery voltage (F<battery-I<E<lt>nameE<gt>>/voltage.rrd>)
146   DS:voltage:GAUGE:25:U:U
148 =item CPU (F<cpu-I<E<lt>numE<gt>>.rrd>)
150   DS:user:COUNTER:25:0:100
151   DS:nice:COUNTER:25:0:100
152   DS:syst:COUNTER:25:0:100
153   DS:idle:COUNTER:25:0:100
154   DS:wait:COUNTER:25:0:100
156 =item Mountpoints (F<df-I<E<lt>pathE<gt>>.rrd>)
158   DS:used:GAUGE:25:0:U
159   DS:free:GAUGE:25:0:U
161 =item Diskstats (F<disk-I<E<lt>majorE<gt>>-I<E<lt>minorE<gt>>.rrd>)
163   DS:rcount:COUNTER:25:0:U
164   DS:rmerged:COUNTER:25:0:U
165   DS:rbytes:COUNTER:25:0:U
166   DS:rtime:COUNTER:25:0:U
167   DS:wcount:COUNTER:25:0:U
168   DS:wmerged:COUNTER:25:0:U
169   DS:wbytes:COUNTER:25:0:U
170   DS:wtime:COUNTER:25:0:U
172 =item Diskstats (F<partition-I<E<lt>majorE<gt>>-I<E<lt>minorE<gt>>.rrd>)
174   DS:rcount:COUNTER:25:0:U
175   DS:rbytes:COUNTER:25:0:U
176   DS:wcount:COUNTER:25:0:U
177   DS:wbytes:COUNTER:25:0:U
179 =item HDD Temperature (F<hddtemp-I<E<lt>majorE<gt>>-I<E<lt>minorE<gt>>.rrd>)
181   DS:value:GAUGE:25:U:U
183 =item System load (F<load.rrd>)
185   DS:shortterm:GAUGE:25:0:100
186   DS:midterm:GAUGE:25:0:100
187   DS:longterm:GAUGE:25:0:100
189 =item Memory usage (F<memory.rrd>)
191   DS:used:GAUGE:25:0:9223372036854775807
192   DS:free:GAUGE:25:0:9223372036854775807
193   DS:buffers:GAUGE:25:0:9223372036854775807
194   DS:cached:GAUGE:25:0:9223372036854775807
196 =item MySQL commands and handlers (F<mysql_commands-I<E<lt>commandE<gt>>.rrd> and F<mysql_handler-I<E<lt>handlerE<gt>>.rrd>)
198   DS:value:COUNTER:25:0:U
200 =item MySQL query cache (F<mysql_qcache.rrd>)
202   DS:hits:COUNTER:25:0:U
203   DS:inserts:COUNTER:25:0:U
204   DS:not_cached:COUNTER:25:0:U
205   DS:lowmem_prunes:COUNTER:25:0:U
206   DS:queries_in_cache:GAUGE:25:0:U
208 =item MySQL threads (F<mysql_threads.rrd>)
210   DS:running:GAUGE:25:0:U
211   DS:connected:GAUGE:25:0:U
212   DS:cached:GAUGE:25:0:U
213   DS:created:COUNTER:25:0:U
215 =item NFSv2 Procedures (F<nfs2_procedures-I<(client|server)>.rrd>)
217   DS:null:COUNTER:25:0:U
218   DS:getattr:COUNTER:25:0:U
219   DS:setattr:COUNTER:25:0:U
220   DS:root:COUNTER:25:0:U
221   DS:lookup:COUNTER:25:0:U
222   DS:readlink:COUNTER:25:0:U
223   DS:read:COUNTER:25:0:U
224   DS:wrcache:COUNTER:25:0:U
225   DS:write:COUNTER:25:0:U
226   DS:create:COUNTER:25:0:U
227   DS:remove:COUNTER:25:0:U
228   DS:rename:COUNTER:25:0:U
229   DS:link:COUNTER:25:0:U
230   DS:symlink:COUNTER:25:0:U
231   DS:mkdir:COUNTER:25:0:U
232   DS:rmdir:COUNTER:25:0:U
233   DS:readdir:COUNTER:25:0:U
234   DS:fsstat:COUNTER:25:0:U
236 =item NFSv3 Procedures (F<nfs3_procedures-I<(client|server)>.rrd>)
238   DS:null:COUNTER:25:0:U
239   DS:getattr:COUNTER:25:0:U
240   DS:setattr:COUNTER:25:0:U
241   DS:lookup:COUNTER:25:0:U
242   DS:access:COUNTER:25:0:U
243   DS:readlink:COUNTER:25:0:U
244   DS:read:COUNTER:25:0:U
245   DS:write:COUNTER:25:0:U
246   DS:create:COUNTER:25:0:U
247   DS:mkdir:COUNTER:25:0:U
248   DS:symlink:COUNTER:25:0:U
249   DS:mknod:COUNTER:25:0:U
250   DS:remove:COUNTER:25:0:U
251   DS:rmdir:COUNTER:25:0:U
252   DS:rename:COUNTER:25:0:U
253   DS:link:COUNTER:25:0:U
254   DS:readdir:COUNTER:25:0:U
255   DS:readdirplus:COUNTER:25:0:U
256   DS:fsstat:COUNTER:25:0:U
257   DS:fsinfo:COUNTER:25:0:U
258   DS:pathconf:COUNTER:25:0:U
259   DS:commit:COUNTER:25:0:U
261 =item Network latency / Ping (F<ping-I<E<lt>hostnameE<gt>>.rrd>)
263   DS:ping:GAUGE:25:0:65535
265 =item Processes (F<processes.rrd>)
267   DS:running:GAUGE:25:0:65535
268   DS:sleeping:GAUGE:25:0:65535
269   DS:zombies:GAUGE:25:0:65535
270   DS:stopped:GAUGE:25:0:65535
271   DS:paging:GAUGE:25:0:65535
272   DS:blocked:GAUGE:25:0:65535
274 =item lm_sensors (F<sensors-I<E<lt>chipE<gt>>-I<E<lt>featureE<gt>>.rrd>)
276   DS:value:GAUGE:25:U:U
278 =item Serial port traffic (F<serial-I<E<lt>numE<gt>>.rrd>)
280   DS:incoming:COUNTER:25:0:U
281   DS:outgoing:COUNTER:25:0:U
283 =item Swap usage (F<swap.rrd>)
285   DS:used:GAUGE:25:0:1099511627776
286   DS:free:GAUGE:25:0:1099511627776
287   DS:cached:GAUGE:25:0:1099511627776
288   DS:resv:GAUGE:25:0:1099511627776
290 =item Tape drive usage (F<tape-I<E<lt>nameE<gt>>.rrd>)
292   DS:rcount:COUNTER:25:0:
293   DS:rmerged:COUNTER:25:0:U
294   DS:rbytes:COUNTER:25:0:U
295   DS:rtime:COUNTER:25:0:U
296   DS:wcount:COUNTER:25:0:U
297   DS:wmerged:COUNTER:25:0:U
298   DS:wbytes:COUNTER:25:0:U
299   DS:wtime:COUNTER:25:0:U
301 =item Network traffic (F<traffic-I<E<lt>nameE<gt>>.rrd>)
303   DS:incoming:COUNTER:25:0:U
304   DS:outgoing:COUNTER:25:0:U
306 =item Users (F<users.rrd>)
308   DS:users:GAUGE:25:0:65535
310 =back
312 =head1 MODES
314 By default collectd starts in the so called I<local mode> which is not very
315 interesting. It collects data and writes it into RRD files in
316 F</var/lib/collectd>. There's nothing special so I won't discuss that in more
317 detail..
319 Please be aware that B<client-, local- and server-mode are mutual exclusive>. A
320 later declaration overrides earlier ones. I<collectd -l -c -s> will start in
321 server-mode. If you want statistics of the server too you will have to start a
322 client process as well.
324 Starting with version 3 collectd may send data over a network. As common with
325 network stuff there are two modes: A I<sender> and a I<listener>. Since one
326 usually has many senders and only a few listeners the sender is also called
327 I<client> (using the option B<-c>) and the listener is called I<server> (using
328 the option B<-s>).
330 Communication happends using the (IPv4) multicast group B<239.192.74.66> and
331 packets sent to the port B<25826/udp>. Every ten seconds the I<client> queries
332 all the modules and sends the collected data to the multicast group. The
333 I<server> subscribes to the multicast group upon startup and then waits for
334 incoming packets. As it receives the packets it checks wether it has the
335 neccessary module and, if found, writes the data to an RRD file, creating
336 directories and files as needed.
338 The multicast group used is within the I<Organization Local Scope> as defined
339 by L<RFC2365>. Addresses within that space are meant to be routed within an AS
340 but not to the outside. However collectd cannot control this and won't try. So
341 it's totally up to you to secure your net.
343 The UDP port used has been checked to not be assigned by the IANA.
345 On multi-homed machines you may need to add a route to the multicast net
346 (B<224.0.0.0/4>) if multicast packages take the wrong interface. The listener
347 on the other hand listens on B<all> interfaces.
349 =head1 SPECIAL PLUGINS
351 =head2 cpufreq
353 This module reads F</sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq> (for
354 the first CPU installed) to get the current CPU frequency. If this file does
355 not exist make sure B<cpufreqd> (L<http://cpufreqd.sourceforge.net/>) or a
356 similar tool is installed.
358 =head2 mysql
360 Requires B<mysqlclient> to be installed. It connects to the database when
361 started and keeps the connection up as long as possible. When the connection is
362 interrupted for whatever reason it will try to re-connect. The syslog will
363 contain loud complaints in case anything goes wrong.
365 This plugin issues C<SHOW STATUS> and evaluates C<Bytes_{received,sent}>,
366 C<Com_*> and C<Handler_*> which correspond to F<traffic-mysql.rrd>,
367 F<mysql_commands-*.rrd> and F<mysql_handler-*.rrd>. Also, the values of
368 C<Qcache_*> are put in F<mysql_qcache.rrd> and values of C<Threads_*> are put
369 in F<mysql_threads.rrd>. Please refer to the B<MySQL reference manual>,
370 I<5.2.4. Server Status Variables> for an explanation of these values.
372 =head2 sensors
374 The B<sensors> module uses lm_sensors to retrieve sensor-values. This means
375 that all the needed modules have to be loaded and lm_sensors has to be
376 configured (most likely by editing F</etc/sensors.conf>. Read
377 L<sensors.conf(5)> for details.
379 The B<lm_sensors> homepage can be found at
380 L<http://secure.netroedge.com/~lm78/>.
382 =head2 hddtemp
384 To get values from B<hddtemp> collectd connects to B<localhost> (127.0.0.1),
385 port B<7634/tcp>. hddtemp has to be running to work correctly. If hddtemp is
386 not running timeouts may appear which may interfere with other statistics..
388 The B<hddtemp> homepage can be found at
389 L<http://www.guzu.net/linux/hddtemp.php>.
391 =head1 SEE ALSO
393 L<collectd.conf(5)>, L<rrdtool(1)>, L<sensors(1)>, L<hddtemp(8)>,
394 L<kstat(3KSTAT)>
396 =head1 AUTHOR
398 Florian Forster E<lt>octo@verplant.orgE<gt>
400 =cut