0a3b91f46050dbef95fc48402607be20e5c446a5
[collectd.git] / src / collectd.pod
1 =head1 NAME
2
3 collectd - System statistics collection daemon
4
5 =head1 SYNOPSIS
6
7 collectd I<[options]>
8
9 =head1 DESCRIPTION
10
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:
14
15 =over 4
16
17 =item
18
19 Battery status (I<battery>)
20
21 =item
22
23 CPU utilization (I<cpu>)
24
25 =item
26
27 Mountpoint usage (I<df>)
28
29 =item
30
31 Disk and partition usage/throughput (I<disk>)
32
33 =item
34
35 Harddisk temperatures (I<hddtemp>)
36
37 =item
38
39 System load averages (I<load>)
40
41 =item
42
43 Memory usage (I<memory>)
44
45 =item
46
47 MySQL statistics (I<mysql>)
48
49 =item
50
51 NFS utilization (I<nfs>, Linux only)
52
53 =item
54
55 Network latency (I<ping>)
56
57 =item
58
59 Number of processes (I<processes>, Linux only)
60
61 =item
62
63 lm_sensors information (I<sensors>, Linux only)
64
65 =item
66
67 Serial port traffic (I<serial>, Linux only)
68
69 =item
70
71 Swap usage (I<swap>)
72
73 =item
74
75 Tape drive usage (I<tape>, Solaris only)
76
77 =item
78
79 Network traffic (I<traffic>)
80
81 =item
82
83 Number of users logged into the system (I<users>)
84
85 =item
86
87 System ressources used by VServers (I<vserver>)
88
89 =back
90
91 =head1 OPTIONS
92
93 =over 4
94
95 =item B<-C> I<E<lt>config-fileE<gt>>
96
97 Specify an alternative config file. This is the place to go when you wish to
98 change B<collectd>'s behavior. The path may be relative to the current working
99 directory.
100
101 =item B<-f>
102
103 Don't fork to the background. I<collectd> will also B<not> close standard file
104 descriptors, detach from the session nor write a pid file. This is mainly
105 thought for 'supervisioning' init replacements such as I<runit>.
106
107 =item B<-h>
108
109 Output usage information and exit.
110
111 =back
112
113 =head1 MODES
114
115 collectd can operate in three different operating modes. The modes are
116 described below.
117
118 The simplest mode is the so called B<local mode>. Data is collected locally and
119 written in RRD files that reside in I<DataDir>. This is the default mode when
120 collectd is linked against C<librrd>.
121
122 The other two modes, B<client mode> and B<server mode>, are used to send data
123 over a network and receive it again.
124
125 In B<client mode> the daemon collectd the data locally and send it's result to
126 one or more network addresses. No RRD files are written in this case. This is
127 the only mode available if collectd is not linked against C<librrd>.
128
129 If started in B<server mode> the daemon will listen on one or more interfaces
130 and write the data it receives to RRD files. No data is collected locally.
131
132 Please refer to L<collectd.conf(5)> for the configuration options and default
133 values.
134
135 =head1 SPECIAL PLUGINS
136
137 =head2 cpufreq
138
139 This module reads F</sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq> (for
140 the first CPU installed) to get the current CPU frequency. If this file does
141 not exist make sure B<cpufreqd> (L<http://cpufreqd.sourceforge.net/>) or a
142 similar tool is installed.
143
144 =head2 mysql
145
146 Requires B<mysqlclient> to be installed. It connects to the database when
147 started and keeps the connection up as long as possible. When the connection is
148 interrupted for whatever reason it will try to re-connect. The syslog will
149 contain loud complaints in case anything goes wrong.
150
151 This plugin issues C<SHOW STATUS> and evaluates C<Bytes_{received,sent}>,
152 C<Com_*> and C<Handler_*> which correspond to F<traffic-mysql.rrd>,
153 F<mysql_commands-*.rrd> and F<mysql_handler-*.rrd>. Also, the values of
154 C<Qcache_*> are put in F<mysql_qcache.rrd> and values of C<Threads_*> are put
155 in F<mysql_threads.rrd>. Please refer to the B<MySQL reference manual>,
156 I<5.2.4. Server Status Variables> for an explanation of these values.
157
158 =head2 sensors
159
160 The B<sensors> module uses lm_sensors to retrieve sensor-values. This means
161 that all the needed modules have to be loaded and lm_sensors has to be
162 configured (most likely by editing F</etc/sensors.conf>. Read
163 L<sensors.conf(5)> for details.
164
165 The B<lm_sensors> homepage can be found at
166 L<http://secure.netroedge.com/~lm78/>.
167
168 =head2 hddtemp
169
170 To get values from B<hddtemp> collectd connects to B<localhost> (127.0.0.1),
171 port B<7634/tcp>. The B<Host> and B<Port> options can be used to change these
172 default values. See L<collectd.conf(5)> for details. C<hddtemp> has to be
173 running to work correctly. If C<hddtemp> is not running timeouts may appear
174 which may interfere with other statistics..
175
176 The B<hddtemp> homepage can be found at
177 L<http://www.guzu.net/linux/hddtemp.php>.
178
179 =head2 vserver
180
181 B<VServer> support is only available for Linux. It cannot yet be found in a 
182 vanilla kernel, though. To make use of this plugin you need a kernel that has 
183 B<VServer> support built in, i.e. you need to apply the patches and compile 
184 your own kernel, which will then provide the /proc/virtual filesystem that is
185 required by this plugin.
186
187 The B<VServer> homepage can be found at L<http://linux-vserver.org/>.
188
189 =head1 RRD FILES
190
191 The RRD files are created automatically with the following RRAs:
192
193   RRA:AVERAGE:0.2:6:1500
194   RRA:AVERAGE:0.1:180:1680
195   RRA:AVERAGE:0.1:2160:1520
196   RRA:MIN:0.2:6:1500
197   RRA:MIN:0.1:180:1680
198   RRA:MIN:0.1:2160:1520
199   RRA:MAX:0.2:6:1500
200   RRA:MAX:0.1:180:1680
201   RRA:MAX:0.1:2160:1520
202
203 Since collectd uses a 10 second I<step> the RRAs contain the following
204 timespans:
205
206   Resolution | Data points |  Timespan
207   -----------+-------------+----------
208   60 seconds |        1500 |  25 hours
209   30 minutes |        1680 |  35 days
210    6 hours   |        1520 | 380 days
211
212 The DS'es depend on the module creating the RRD files:
213
214 =over 4
215
216 =item Battery charge (F<battery-I<E<lt>nameE<gt>>/charge.rrd>)
217
218   DS:charge:GAUGE:25:0:U
219
220 =item Battery current (F<battery-I<E<lt>nameE<gt>>/current.rrd>)
221
222   DS:current:GAUGE:25:U:U
223
224 =item Battery voltage (F<battery-I<E<lt>nameE<gt>>/voltage.rrd>)
225
226   DS:voltage:GAUGE:25:U:U
227
228 =item CPU (F<cpu-I<E<lt>numE<gt>>.rrd>)
229
230   DS:user:COUNTER:25:0:100
231   DS:nice:COUNTER:25:0:100
232   DS:syst:COUNTER:25:0:100
233   DS:idle:COUNTER:25:0:100
234   DS:wait:COUNTER:25:0:100
235
236 =item Mountpoints (F<df-I<E<lt>pathE<gt>>.rrd>)
237
238   DS:used:GAUGE:25:0:U
239   DS:free:GAUGE:25:0:U
240
241 =item Diskstats (F<disk-I<E<lt>majorE<gt>>-I<E<lt>minorE<gt>>.rrd>)
242
243   DS:rcount:COUNTER:25:0:U
244   DS:rmerged:COUNTER:25:0:U
245   DS:rbytes:COUNTER:25:0:U
246   DS:rtime:COUNTER:25:0:U
247   DS:wcount:COUNTER:25:0:U
248   DS:wmerged:COUNTER:25:0:U
249   DS:wbytes:COUNTER:25:0:U
250   DS:wtime:COUNTER:25:0:U
251
252 =item Diskstats (F<partition-I<E<lt>majorE<gt>>-I<E<lt>minorE<gt>>.rrd>)
253
254   DS:rcount:COUNTER:25:0:U
255   DS:rbytes:COUNTER:25:0:U
256   DS:wcount:COUNTER:25:0:U
257   DS:wbytes:COUNTER:25:0:U
258
259 =item HDD Temperature (F<hddtemp-I<E<lt>majorE<gt>>-I<E<lt>minorE<gt>>.rrd>)
260
261   DS:value:GAUGE:25:U:U
262
263 =item System load (F<load.rrd>)
264
265   DS:shortterm:GAUGE:25:0:100
266   DS:midterm:GAUGE:25:0:100
267   DS:longterm:GAUGE:25:0:100
268
269 =item Memory usage (F<memory.rrd>)
270
271   DS:used:GAUGE:25:0:9223372036854775807
272   DS:free:GAUGE:25:0:9223372036854775807
273   DS:buffers:GAUGE:25:0:9223372036854775807
274   DS:cached:GAUGE:25:0:9223372036854775807
275
276 =item MySQL commands and handlers (F<mysql_commands-I<E<lt>commandE<gt>>.rrd> and F<mysql_handler-I<E<lt>handlerE<gt>>.rrd>)
277
278   DS:value:COUNTER:25:0:U
279
280 =item MySQL query cache (F<mysql_qcache.rrd>)
281
282   DS:hits:COUNTER:25:0:U
283   DS:inserts:COUNTER:25:0:U
284   DS:not_cached:COUNTER:25:0:U
285   DS:lowmem_prunes:COUNTER:25:0:U
286   DS:queries_in_cache:GAUGE:25:0:U
287
288 =item MySQL threads (F<mysql_threads.rrd>)
289
290   DS:running:GAUGE:25:0:U
291   DS:connected:GAUGE:25:0:U
292   DS:cached:GAUGE:25:0:U
293   DS:created:COUNTER:25:0:U
294
295 =item NFSv2 Procedures (F<nfs2_procedures-I<(client|server)>.rrd>)
296
297   DS:null:COUNTER:25:0:U
298   DS:getattr:COUNTER:25:0:U
299   DS:setattr:COUNTER:25:0:U
300   DS:root:COUNTER:25:0:U
301   DS:lookup:COUNTER:25:0:U
302   DS:readlink:COUNTER:25:0:U
303   DS:read:COUNTER:25:0:U
304   DS:wrcache:COUNTER:25:0:U
305   DS:write:COUNTER:25:0:U
306   DS:create:COUNTER:25:0:U
307   DS:remove:COUNTER:25:0:U
308   DS:rename:COUNTER:25:0:U
309   DS:link:COUNTER:25:0:U
310   DS:symlink:COUNTER:25:0:U
311   DS:mkdir:COUNTER:25:0:U
312   DS:rmdir:COUNTER:25:0:U
313   DS:readdir:COUNTER:25:0:U
314   DS:fsstat:COUNTER:25:0:U
315
316 =item NFSv3 Procedures (F<nfs3_procedures-I<(client|server)>.rrd>)
317
318   DS:null:COUNTER:25:0:U
319   DS:getattr:COUNTER:25:0:U
320   DS:setattr:COUNTER:25:0:U
321   DS:lookup:COUNTER:25:0:U
322   DS:access:COUNTER:25:0:U
323   DS:readlink:COUNTER:25:0:U
324   DS:read:COUNTER:25:0:U
325   DS:write:COUNTER:25:0:U
326   DS:create:COUNTER:25:0:U
327   DS:mkdir:COUNTER:25:0:U
328   DS:symlink:COUNTER:25:0:U
329   DS:mknod:COUNTER:25:0:U
330   DS:remove:COUNTER:25:0:U
331   DS:rmdir:COUNTER:25:0:U
332   DS:rename:COUNTER:25:0:U
333   DS:link:COUNTER:25:0:U
334   DS:readdir:COUNTER:25:0:U
335   DS:readdirplus:COUNTER:25:0:U
336   DS:fsstat:COUNTER:25:0:U
337   DS:fsinfo:COUNTER:25:0:U
338   DS:pathconf:COUNTER:25:0:U
339   DS:commit:COUNTER:25:0:U
340
341 =item Network latency / Ping (F<ping-I<E<lt>hostnameE<gt>>.rrd>)
342
343   DS:ping:GAUGE:25:0:65535
344
345 =item Processes (F<processes.rrd>)
346
347   DS:running:GAUGE:25:0:65535
348   DS:sleeping:GAUGE:25:0:65535
349   DS:zombies:GAUGE:25:0:65535
350   DS:stopped:GAUGE:25:0:65535
351   DS:paging:GAUGE:25:0:65535
352   DS:blocked:GAUGE:25:0:65535
353
354 =item lm_sensors (F<sensors-I<E<lt>chipE<gt>>-I<E<lt>featureE<gt>>.rrd>)
355
356   DS:value:GAUGE:25:U:U
357
358 =item Serial port traffic (F<serial-I<E<lt>numE<gt>>.rrd>)
359
360   DS:incoming:COUNTER:25:0:U
361   DS:outgoing:COUNTER:25:0:U
362
363 =item Swap usage (F<swap.rrd>)
364
365   DS:used:GAUGE:25:0:1099511627776
366   DS:free:GAUGE:25:0:1099511627776
367   DS:cached:GAUGE:25:0:1099511627776
368   DS:resv:GAUGE:25:0:1099511627776
369
370 =item Tape drive usage (F<tape-I<E<lt>nameE<gt>>.rrd>)
371
372   DS:rcount:COUNTER:25:0:
373   DS:rmerged:COUNTER:25:0:U
374   DS:rbytes:COUNTER:25:0:U
375   DS:rtime:COUNTER:25:0:U
376   DS:wcount:COUNTER:25:0:U
377   DS:wmerged:COUNTER:25:0:U
378   DS:wbytes:COUNTER:25:0:U
379   DS:wtime:COUNTER:25:0:U
380
381 =item Network traffic (F<traffic-I<E<lt>nameE<gt>>.rrd>)
382
383   DS:incoming:COUNTER:25:0:U
384   DS:outgoing:COUNTER:25:0:U
385
386 =item Users (F<users.rrd>)
387
388   DS:users:GAUGE:25:0:65535
389
390 =item VServer load (F<vserver-I<E<lt>xidE<gt>>/load.rrd>)
391
392   DS:shortterm:GAUGE:25:0:100
393   DS:midterm:GAUGE:25:0:100
394   DS:longterm:GAUGE:25:0:100
395
396 =item VServer threads (F<vserver-I<E<lt>xidE<gt>>/threads.rrd>)
397
398   DS:total:GAUGE:25:0:65535
399   DS:running:GAUGE:25:0:65535
400   DS:uninterruptible:GAUGE:25:0:65535
401   DS:onhold:GAUGE:25:0:65535
402
403 =item VServer network traffic (F<vserver-I<E<lt>xidE<gt>>/traffic-I<E<lt>nameE<gt>>.rrd>)
404
405   DS:incoming:COUNTER:25:0:9223372036854775807
406   DS:outgoing:COUNTER:25:0:9223372036854775807
407   DS:failed:COUNTER:25:0:9223372036854775807
408
409 =item VServer processes (F<vserver-I<E<lt>xidE<gt>>/vs_processes.rrd>)
410
411   DS:total:GAUGE:25:0:65535
412
413 =item VServer memory usage (F<vserver-I<E<lt>xidE<gt>>/vs_memory.rrd>)
414
415   DS:vm:GAUGE:25:0:9223372036854775807
416   DS:vml:GAUGE:25:0:9223372036854775807
417   DS:rss:GAUGE:25:0:9223372036854775807
418   DS:anon:GAUGE:25:0:9223372036854775807
419
420 =back
421
422 =head1 SEE ALSO
423
424 L<collectd.conf(5)>, L<rrdtool(1)>, L<sensors(1)>, L<hddtemp(8)>,
425 L<kstat(3KSTAT)>
426
427 =head1 AUTHOR
428
429 Florian Forster E<lt>octo@verplant.orgE<gt>
430
431 =cut