3 collectd - System statistics collection daemon
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:
19 Battery status (I<battery>)
23 CPU utilization (I<cpu>)
27 Mountpoint usage (I<df>)
31 Disk and partition usage/throughput (I<disk>)
35 Harddisk temperatures (I<hddtemp>)
39 System load averages (I<load>)
43 Memory usage (I<memory>)
47 MySQL statistics (I<mysql>)
51 NFS utilization (I<nfs>, Linux only)
55 Network latency (I<ping>)
59 Number of processes (I<processes>, Linux only)
63 lm_sensors information (I<sensors>, Linux only)
67 Serial port traffic (I<serial>, Linux only)
75 Tape drive usage (I<tape>, Solaris only)
79 Network traffic (I<traffic>)
83 Number of users logged into the system (I<users>)
87 System ressources used by VServers (I<vserver>)
95 =item B<-C> I<E<lt>config-fileE<gt>>
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
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>.
109 Output usage information and exit.
115 collectd can operate in three different operating modes. The modes are
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>.
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.
125 In B<client mode> the daemon collects the data locally and sends it's results
126 to one or more network addresses. No RRD files are written in this case. This
127 is the only mode available if collectd is not linked against C<librrd>.
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.
132 Please refer to L<collectd.conf(5)> for the configuration options and default
135 =head1 SPECIAL PLUGINS
139 This module connects to an Apache webserver and expects the output produced by
140 B<mod_status.c>. If requires B<libcurl> to set up the HTTP connection and issue
141 the request(s). The following is a sample config for the Apache webserver. The
142 use of C<ExtendedStatus on> is mandatory.
145 <IfModule mod_status.c>
146 <Location /mod_status>
147 SetHandler server-status
151 This plugin requires further configuration. Please read L<collectd.conf(5)>.
155 This module reads F</sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq> (for
156 the first CPU installed) to get the current CPU frequency. If this file does
157 not exist make sure B<cpufreqd> (L<http://cpufreqd.sourceforge.net/>) or a
158 similar tool is installed and an "cpu governor" (that's kernel module) is
163 Requires B<mysqlclient> to be installed. It connects to the database when
164 started and keeps the connection up as long as possible. When the connection is
165 interrupted for whatever reason it will try to re-connect. The syslog will
166 contain loud complaints in case anything goes wrong.
168 This plugin issues C<SHOW STATUS> and evaluates C<Bytes_{received,sent}>,
169 C<Com_*> and C<Handler_*> which correspond to F<traffic-mysql.rrd>,
170 F<mysql_commands-*.rrd> and F<mysql_handler-*.rrd>. Also, the values of
171 C<Qcache_*> are put in F<mysql_qcache.rrd> and values of C<Threads_*> are put
172 in F<mysql_threads.rrd>. Please refer to the B<MySQL reference manual>,
173 I<5.2.4. Server Status Variables> for an explanation of these values.
177 The B<sensors> module uses lm_sensors to retrieve sensor-values. This means
178 that all the needed modules have to be loaded and lm_sensors has to be
179 configured (most likely by editing F</etc/sensors.conf>. Read
180 L<sensors.conf(5)> for details.
182 The B<lm_sensors> homepage can be found at
183 L<http://secure.netroedge.com/~lm78/>.
187 To get values from B<hddtemp> collectd connects to B<localhost> (127.0.0.1),
188 port B<7634/tcp>. The B<Host> and B<Port> options can be used to change these
189 default values. See L<collectd.conf(5)> for details. C<hddtemp> has to be
190 running to work correctly. If C<hddtemp> is not running timeouts may appear
191 which may interfere with other statistics..
193 The B<hddtemp> homepage can be found at
194 L<http://www.guzu.net/linux/hddtemp.php>.
198 B<VServer> support is only available for Linux. It cannot yet be found in a
199 vanilla kernel, though. To make use of this plugin you need a kernel that has
200 B<VServer> support built in, i.e. you need to apply the patches and compile
201 your own kernel, which will then provide the /proc/virtual filesystem that is
202 required by this plugin.
204 The B<VServer> homepage can be found at L<http://linux-vserver.org/>.
208 The RRD files are created automatically. The size of the RRAs depend on the
209 compile time settings of I<step> and I<width>. With the default values (I<step>
210 = B<10>, I<width> = B<1200>) the following RRAs are created:
212 RRA:AVERAGE:0.1:1:8640
213 RRA:AVERAGE:0.1:50:1210
214 RRA:AVERAGE:0.1:223:1202
215 RRA:AVERAGE:0.1:2635:1201
219 RRA:MIN:0.1:2635:1201
223 RRA:MAX:0.1:2635:1201
225 By default collectd uses a 10 second I<step>. Thus the RRAs contain the
226 following timespans. If you've changed the I<step> at compile time you will
227 have calculate resolution and timespan yourself.
229 PDP per CDP | Resolution | Data points | Timespan
230 ------------+--------------+-------------+---------
231 1 | 10.0 seconds ! 8640 ! 1 day
232 50 | 8.3 minutes | 1210 | 1 week
233 223 | 37.2 minutes | 1202 | 1 month
234 2635 | 7.3 hours | 1201 | 1 year
236 The DS'es depend on the module creating the RRD files:
240 =item Battery charge (F<battery-I<E<lt>nameE<gt>>/charge.rrd>)
242 DS:charge:GAUGE:25:0:U
244 =item Battery current (F<battery-I<E<lt>nameE<gt>>/current.rrd>)
246 DS:current:GAUGE:25:U:U
248 =item Battery voltage (F<battery-I<E<lt>nameE<gt>>/voltage.rrd>)
250 DS:voltage:GAUGE:25:U:U
252 =item CPU (F<cpu-I<E<lt>numE<gt>>.rrd>)
254 DS:user:COUNTER:25:0:100
255 DS:nice:COUNTER:25:0:100
256 DS:syst:COUNTER:25:0:100
257 DS:idle:COUNTER:25:0:100
258 DS:wait:COUNTER:25:0:100
260 =item Mountpoints (F<df-I<E<lt>pathE<gt>>.rrd>)
265 =item Diskstats (F<disk-I<E<lt>majorE<gt>>-I<E<lt>minorE<gt>>.rrd>)
267 DS:rcount:COUNTER:25:0:U
268 DS:rmerged:COUNTER:25:0:U
269 DS:rbytes:COUNTER:25:0:U
270 DS:rtime:COUNTER:25:0:U
271 DS:wcount:COUNTER:25:0:U
272 DS:wmerged:COUNTER:25:0:U
273 DS:wbytes:COUNTER:25:0:U
274 DS:wtime:COUNTER:25:0:U
276 =item Diskstats (F<partition-I<E<lt>majorE<gt>>-I<E<lt>minorE<gt>>.rrd>)
278 DS:rcount:COUNTER:25:0:U
279 DS:rbytes:COUNTER:25:0:U
280 DS:wcount:COUNTER:25:0:U
281 DS:wbytes:COUNTER:25:0:U
283 =item HDD Temperature (F<hddtemp-I<E<lt>majorE<gt>>-I<E<lt>minorE<gt>>.rrd>)
285 DS:value:GAUGE:25:U:U
287 =item System load (F<load.rrd>)
289 DS:shortterm:GAUGE:25:0:100
290 DS:midterm:GAUGE:25:0:100
291 DS:longterm:GAUGE:25:0:100
293 =item Memory usage (F<memory.rrd>)
295 DS:used:GAUGE:25:0:9223372036854775807
296 DS:free:GAUGE:25:0:9223372036854775807
297 DS:buffers:GAUGE:25:0:9223372036854775807
298 DS:cached:GAUGE:25:0:9223372036854775807
300 =item MySQL commands and handlers (F<mysql_commands-I<E<lt>commandE<gt>>.rrd> and F<mysql_handler-I<E<lt>handlerE<gt>>.rrd>)
302 DS:value:COUNTER:25:0:U
304 =item MySQL query cache (F<mysql_qcache.rrd>)
306 DS:hits:COUNTER:25:0:U
307 DS:inserts:COUNTER:25:0:U
308 DS:not_cached:COUNTER:25:0:U
309 DS:lowmem_prunes:COUNTER:25:0:U
310 DS:queries_in_cache:GAUGE:25:0:U
312 =item MySQL threads (F<mysql_threads.rrd>)
314 DS:running:GAUGE:25:0:U
315 DS:connected:GAUGE:25:0:U
316 DS:cached:GAUGE:25:0:U
317 DS:created:COUNTER:25:0:U
319 =item NFSv2 Procedures (F<nfs2_procedures-I<(client|server)>.rrd>)
321 DS:null:COUNTER:25:0:U
322 DS:getattr:COUNTER:25:0:U
323 DS:setattr:COUNTER:25:0:U
324 DS:root:COUNTER:25:0:U
325 DS:lookup:COUNTER:25:0:U
326 DS:readlink:COUNTER:25:0:U
327 DS:read:COUNTER:25:0:U
328 DS:wrcache:COUNTER:25:0:U
329 DS:write:COUNTER:25:0:U
330 DS:create:COUNTER:25:0:U
331 DS:remove:COUNTER:25:0:U
332 DS:rename:COUNTER:25:0:U
333 DS:link:COUNTER:25:0:U
334 DS:symlink:COUNTER:25:0:U
335 DS:mkdir:COUNTER:25:0:U
336 DS:rmdir:COUNTER:25:0:U
337 DS:readdir:COUNTER:25:0:U
338 DS:fsstat:COUNTER:25:0:U
340 =item NFSv3 Procedures (F<nfs3_procedures-I<(client|server)>.rrd>)
342 DS:null:COUNTER:25:0:U
343 DS:getattr:COUNTER:25:0:U
344 DS:setattr:COUNTER:25:0:U
345 DS:lookup:COUNTER:25:0:U
346 DS:access:COUNTER:25:0:U
347 DS:readlink:COUNTER:25:0:U
348 DS:read:COUNTER:25:0:U
349 DS:write:COUNTER:25:0:U
350 DS:create:COUNTER:25:0:U
351 DS:mkdir:COUNTER:25:0:U
352 DS:symlink:COUNTER:25:0:U
353 DS:mknod:COUNTER:25:0:U
354 DS:remove:COUNTER:25:0:U
355 DS:rmdir:COUNTER:25:0:U
356 DS:rename:COUNTER:25:0:U
357 DS:link:COUNTER:25:0:U
358 DS:readdir:COUNTER:25:0:U
359 DS:readdirplus:COUNTER:25:0:U
360 DS:fsstat:COUNTER:25:0:U
361 DS:fsinfo:COUNTER:25:0:U
362 DS:pathconf:COUNTER:25:0:U
363 DS:commit:COUNTER:25:0:U
365 =item Network latency / Ping (F<ping-I<E<lt>hostnameE<gt>>.rrd>)
367 DS:ping:GAUGE:25:0:65535
369 =item Processes (F<processes.rrd>)
371 DS:running:GAUGE:25:0:65535
372 DS:sleeping:GAUGE:25:0:65535
373 DS:zombies:GAUGE:25:0:65535
374 DS:stopped:GAUGE:25:0:65535
375 DS:paging:GAUGE:25:0:65535
376 DS:blocked:GAUGE:25:0:65535
378 =item lm_sensors (F<sensors-I<E<lt>chipE<gt>>-I<E<lt>featureE<gt>>.rrd>)
380 DS:value:GAUGE:25:U:U
382 =item Serial port traffic (F<serial-I<E<lt>numE<gt>>.rrd>)
384 DS:incoming:COUNTER:25:0:U
385 DS:outgoing:COUNTER:25:0:U
387 =item Swap usage (F<swap.rrd>)
389 DS:used:GAUGE:25:0:1099511627776
390 DS:free:GAUGE:25:0:1099511627776
391 DS:cached:GAUGE:25:0:1099511627776
392 DS:resv:GAUGE:25:0:1099511627776
394 =item Tape drive usage (F<tape-I<E<lt>nameE<gt>>.rrd>)
396 DS:rcount:COUNTER:25:0:
397 DS:rmerged:COUNTER:25:0:U
398 DS:rbytes:COUNTER:25:0:U
399 DS:rtime:COUNTER:25:0:U
400 DS:wcount:COUNTER:25:0:U
401 DS:wmerged:COUNTER:25:0:U
402 DS:wbytes:COUNTER:25:0:U
403 DS:wtime:COUNTER:25:0:U
405 =item Network traffic (F<traffic-I<E<lt>nameE<gt>>.rrd>)
407 DS:incoming:COUNTER:25:0:U
408 DS:outgoing:COUNTER:25:0:U
410 =item Users (F<users.rrd>)
412 DS:users:GAUGE:25:0:65535
414 =item VServer load (F<vserver-I<E<lt>xidE<gt>>/load.rrd>)
416 DS:shortterm:GAUGE:25:0:100
417 DS:midterm:GAUGE:25:0:100
418 DS:longterm:GAUGE:25:0:100
420 =item VServer threads (F<vserver-I<E<lt>xidE<gt>>/threads.rrd>)
422 DS:total:GAUGE:25:0:65535
423 DS:running:GAUGE:25:0:65535
424 DS:uninterruptible:GAUGE:25:0:65535
425 DS:onhold:GAUGE:25:0:65535
427 =item VServer network traffic (F<vserver-I<E<lt>xidE<gt>>/traffic-I<E<lt>nameE<gt>>.rrd>)
429 DS:incoming:COUNTER:25:0:9223372036854775807
430 DS:outgoing:COUNTER:25:0:9223372036854775807
431 DS:failed:COUNTER:25:0:9223372036854775807
433 =item VServer processes (F<vserver-I<E<lt>xidE<gt>>/vs_processes.rrd>)
435 DS:total:GAUGE:25:0:65535
437 =item VServer memory usage (F<vserver-I<E<lt>xidE<gt>>/vs_memory.rrd>)
439 DS:vm:GAUGE:25:0:9223372036854775807
440 DS:vml:GAUGE:25:0:9223372036854775807
441 DS:rss:GAUGE:25:0:9223372036854775807
442 DS:anon:GAUGE:25:0:9223372036854775807
448 L<collectd.conf(5)>, L<rrdtool(1)>, L<sensors(1)>, L<hddtemp(8)>,
453 Florian Forster E<lt>octo@verplant.orgE<gt>