Rechercher une page de manuel
collectd
Langue: en
Version: 2007-05-29 (mandriva - 22/10/07)
Section: 1 (Commandes utilisateur)
NAME
collectd - System statistics collection daemonSYNOPSIS
collectd [options]DESCRIPTION
collectd is a daemon that collects various system statistics periodically and stores them into RRD-files. Which data is collected depends on compile-time settings. The following features may be available:- •
- Apache server stats (apache)
- •
- Apple hardware sensors (apple_sensors, Darwin only)
- •
- Battery status (battery)
- •
- CPU utilization (cpu)
- •
- Mountpoint usage (df)
- •
- Disk and partition usage/throughput (disk)
- •
- DNS traffic (dns)
- •
- Email usage (email)
- •
- Harddisk temperatures (hddtemp)
- •
- System load averages (load)
- •
- Motherboard monitor (mbmon)
- •
- Memory usage (memory)
- •
- MySQL statistics (mysql)
- •
- NFS utilization (nfs, Linux only)
- •
- Network latency (ping)
- •
- Number of processes (processes, Linux only)
- •
- lm_sensors information (sensors, Linux only)
- •
- Serial port traffic (serial, Linux only)
- •
- Swap usage (swap)
- •
- Tape drive usage (tape, Solaris only)
- •
- Network traffic (traffic)
- •
- Number of users logged into the system (users)
- •
- System ressources used by VServers (vserver)
- •
- Wireless network stats (wireless)
OPTIONS
- -C <config-file>
- Specify an alternative config file. This is the place to go when you wish to change collectd's behavior. The path may be relative to the current working directory.
- -P <pid-file>
- Specify an alternative pid file. This overwrites any settings in the config file. This is thought for init-scripts that require the PID-file in a certain directory to work correctly. For everyday-usage use the PIDFile config-option.
- -f
- Don't fork to the background. collectd will also not close standard file descriptors, detach from the session nor write a pid file. This is mainly thought for 'supervisioning' init replacements such as runit.
- -h
- Output usage information and exit.
MODES
collectd can operate in four different operating modes. The modes are described below.The simplest mode is the so called local mode. Data is collected locally and written in RRD files that reside in DataDir. This is the default mode when collectd is linked against "librrd".
The modes client mode and server mode are used to send data over a network and receive it again.
In client mode the daemon collects the data locally and sends its results to one or more network addresses. No RRD files are written locally in this case. If collectd is not linked against "librrd" this is the default mode.
If started in server mode the daemon will listen on one or more interfaces and write the data it receives to RRD files. No data is collected locally.
In the last mode, log mode, data is collected locally and written in text files that reside in DataDir.
Please refer to collectd.conf(5) for the configuration options and default values.
SPECIAL PLUGINS
apache
This module connects to an Apache webserver and expects the output produced by mod_status.c. If requires libcurl to set up the HTTP connection and issue the request(s). The following is a sample config for the Apache webserver. The use of "ExtendedStatus on" is mandatory.
ExtendedStatus on <IfModule mod_status.c> <Location /mod_status> SetHandler server-status </Location> </IfModule>
This plugin requires further configuration. Please read collectd.conf(5).
cpufreq
This module reads /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq (for the first CPU installed) to get the current CPU frequency. If this file does not exist make sure cpufreqd (<http://cpufreqd.sourceforge.net/>) or a similar tool is installed and an ``cpu governor'' (that's kernel module) is loaded.
This plugin collects data indirectly by providing a UNIX socket that external programs can connect to. A simple line based protocol is used to communicate with the plugin:
E-Mail type (e.g. ``ham'', ``spam'', ``virus'', ...) and size (bytes):
e:<type>:<size>
If "size" is less than or equal to zero, "size" is ignored.
Spam score:
s:<value>
Successful spam checks (e.g. ``BAYES_99'', ``SUBJECT_DRUG_GAP_C'', ...):
c:<type1>[,<type2>,...]
Each line is limited to 256 characters (including the newline character). Longer lines will be ignored.
mysql
Requires mysqlclient to be installed. It connects to the database when started and keeps the connection up as long as possible. When the connection is interrupted for whatever reason it will try to re-connect. The syslog will contain loud complaints in case anything goes wrong.
This plugin issues "SHOW STATUS" and evaluates "Bytes_{received,sent}", "Com_*" and "Handler_*" which correspond to traffic-mysql.rrd, mysql_commands-*.rrd and mysql_handler-*.rrd. Also, the values of "Qcache_*" are put in mysql_qcache.rrd and values of "Threads_*" are put in mysql_threads.rrd. Please refer to the MySQL reference manual, 5.2.4. Server Status Variables for an explanation of these values.
sensors
The sensors module uses lm_sensors to retrieve sensor-values. This means that all the needed modules have to be loaded and lm_sensors has to be configured (most likely by editing /etc/sensors.conf. Read sensors.conf(5) for details.
The lm_sensors homepage can be found at <http://secure.netroedge.com/~lm78/>.
mbmon
The mbmon module uses mbmon to retrieve temperature, voltage, etc.
collectd connects to localhost (127.0.0.1), port 411/tcp. The Host and Port options can be used to change these default values. See collectd.conf(5) for details. "mbmon" has to be running to work correctly. If "mbmon" is not running timeouts may appear which may interfere with other statistics..
"mbmon" must be run with the -r option (``print TAG and Value format''); Debian's /etc/init.d/mbmon script already does this, other people will need to ensure that this is the case.
hddtemp
To get values from hddtemp collectd connects to localhost (127.0.0.1), port 7634/tcp. The Host and Port options can be used to change these default values. See collectd.conf(5) for details. "hddtemp" has to be running to work correctly. If "hddtemp" is not running timeouts may appear which may interfere with other statistics..
The hddtemp homepage can be found at <http://www.guzu.net/linux/hddtemp.php>.
vserver
VServer support is only available for Linux. It cannot yet be found in a vanilla kernel, though. To make use of this plugin you need a kernel that has VServer support built in, i.e. you need to apply the patches and compile your own kernel, which will then provide the /proc/virtual filesystem that is required by this plugin.
The VServer homepage can be found at <http://linux-vserver.org/>.
RRD FILES
The RRD files are created automatically. The size of the RRAs depend on the compile time settings of step and width. With the default values (step = 10, width = 1200) the following RRAs are created:RRA:AVERAGE:0.1:1:8640 RRA:AVERAGE:0.1:50:1210 RRA:AVERAGE:0.1:223:1202 RRA:AVERAGE:0.1:2635:1201 RRA:MIN:0.1:1:8640 RRA:MIN:0.1:50:1210 RRA:MIN:0.1:223:1202 RRA:MIN:0.1:2635:1201 RRA:MAX:0.1:1:8640 RRA:MAX:0.1:50:1210 RRA:MAX:0.1:223:1202 RRA:MAX:0.1:2635:1201
By default collectd uses a 10 second step. Thus the RRAs contain the following timespans. If you've changed the step at compile time you will have calculate resolution and timespan yourself.
PDP per CDP | Resolution | Data points | Timespan ------------+--------------+-------------+--------- 1 | 10.0 seconds ! 8640 ! 1 day 50 | 8.3 minutes | 1210 | 1 week 223 | 37.2 minutes | 1202 | 1 month 2635 | 7.3 hours | 1201 | 1 year
The DS'es depend on the module creating the RRD files:
- Apache traffic (apache/apache_bytes.rrd)
-
DS:count:COUNTER:HEARTBEAT:0:134217728
- Apache requests (apache/apache_requests.rrd)
-
DS:count:COUNTER:HEARTBEAT:0:1048576
- Apache scoreboard (apache/apache_scoreboard-<name>.rrd)
-
DS:count:GAUGE:HEARTBEAT:0:U
- Apple temperature sensor (apple_sensors/temperature-<name>.rrd)
-
DS:value:GAUGE:HEARTBEAT:U:U
- Apple fanspeed sensor (apple_sensors/fanspeed-<name>.rrd)
-
DS:value:GAUGE:HEARTBEAT:U:U
- Battery charge (battery-<name>/charge.rrd)
-
DS:charge:GAUGE:HEARTBEAT:0:U
- Battery current (battery-<name>/current.rrd)
-
DS:current:GAUGE:HEARTBEAT:U:U
- Battery voltage (battery-<name>/voltage.rrd)
-
DS:voltage:GAUGE:HEARTBEAT:U:U
- CPU (cpu-<num>.rrd)
-
DS:user:COUNTER:HEARTBEAT:0:100 DS:nice:COUNTER:HEARTBEAT:0:100 DS:syst:COUNTER:HEARTBEAT:0:100 DS:idle:COUNTER:HEARTBEAT:0:100 DS:wait:COUNTER:HEARTBEAT:0:100
- CPU frequency (cpufreq-<num>.rrd)
-
DS:value:GAUGE:HEARTBEAT:0:U
- Mountpoints (df-<path>.rrd)
-
DS:used:GAUGE:HEARTBEAT:0:U DS:free:GAUGE:HEARTBEAT:0:U
- Diskstats (disk-<major>-<minor>.rrd)
-
DS:rcount:COUNTER:HEARTBEAT:0:U DS:rmerged:COUNTER:HEARTBEAT:0:U DS:rbytes:COUNTER:HEARTBEAT:0:U DS:rtime:COUNTER:HEARTBEAT:0:U DS:wcount:COUNTER:HEARTBEAT:0:U DS:wmerged:COUNTER:HEARTBEAT:0:U DS:wbytes:COUNTER:HEARTBEAT:0:U DS:wtime:COUNTER:HEARTBEAT:0:U
- Diskstats (partition-<major>-<minor>.rrd)
-
DS:rcount:COUNTER:HEARTBEAT:0:U DS:rbytes:COUNTER:HEARTBEAT:0:U DS:wcount:COUNTER:HEARTBEAT:0:U DS:wbytes:COUNTER:HEARTBEAT:0:U
- E-Mail count (email/email-<type>.rrd)
-
DS:count:GAUGE:HEARTBEAT:0:U
- E-Mail size (email/email_size-<type>.rrd)
-
DS:size:GAUGE:HEARTBEAT:0:U
- HDD Temperature (hddtemp-<major>-<minor>.rrd)
-
DS:value:GAUGE:HEARTBEAT:U:U
- System load (load.rrd)
-
DS:shortterm:GAUGE:HEARTBEAT:0:100 DS:midterm:GAUGE:HEARTBEAT:0:100 DS:longterm:GAUGE:HEARTBEAT:0:100
- Memory usage (memory.rrd)
-
DS:used:GAUGE:HEARTBEAT:0:9223372036854775807 DS:free:GAUGE:HEARTBEAT:0:9223372036854775807 DS:buffers:GAUGE:HEARTBEAT:0:9223372036854775807 DS:cached:GAUGE:HEARTBEAT:0:9223372036854775807
- MySQL commands and handlers (mysql_commands-<command>.rrd and mysql_handler-<handler>.rrd)
-
DS:value:COUNTER:HEARTBEAT:0:U
- MySQL query cache (mysql_qcache.rrd)
-
DS:hits:COUNTER:HEARTBEAT:0:U DS:inserts:COUNTER:HEARTBEAT:0:U DS:not_cached:COUNTER:HEARTBEAT:0:U DS:lowmem_prunes:COUNTER:HEARTBEAT:0:U DS:queries_in_cache:GAUGE:HEARTBEAT:0:U
- MySQL threads (mysql_threads.rrd)
-
DS:running:GAUGE:HEARTBEAT:0:U DS:connected:GAUGE:HEARTBEAT:0:U DS:cached:GAUGE:HEARTBEAT:0:U DS:created:COUNTER:HEARTBEAT:0:U
- NFSv2 Procedures (nfs2_procedures-(client|server).rrd)
-
DS:null:COUNTER:HEARTBEAT:0:U DS:getattr:COUNTER:HEARTBEAT:0:U DS:setattr:COUNTER:HEARTBEAT:0:U DS:root:COUNTER:HEARTBEAT:0:U DS:lookup:COUNTER:HEARTBEAT:0:U DS:readlink:COUNTER:HEARTBEAT:0:U DS:read:COUNTER:HEARTBEAT:0:U DS:wrcache:COUNTER:HEARTBEAT:0:U DS:write:COUNTER:HEARTBEAT:0:U DS:create:COUNTER:HEARTBEAT:0:U DS:remove:COUNTER:HEARTBEAT:0:U DS:rename:COUNTER:HEARTBEAT:0:U DS:link:COUNTER:HEARTBEAT:0:U DS:symlink:COUNTER:HEARTBEAT:0:U DS:mkdir:COUNTER:HEARTBEAT:0:U DS:rmdir:COUNTER:HEARTBEAT:0:U DS:readdir:COUNTER:HEARTBEAT:0:U DS:fsstat:COUNTER:HEARTBEAT:0:U
- NFSv3 Procedures (nfs3_procedures-(client|server).rrd)
-
DS:null:COUNTER:HEARTBEAT:0:U DS:getattr:COUNTER:HEARTBEAT:0:U DS:setattr:COUNTER:HEARTBEAT:0:U DS:lookup:COUNTER:HEARTBEAT:0:U DS:access:COUNTER:HEARTBEAT:0:U DS:readlink:COUNTER:HEARTBEAT:0:U DS:read:COUNTER:HEARTBEAT:0:U DS:write:COUNTER:HEARTBEAT:0:U DS:create:COUNTER:HEARTBEAT:0:U DS:mkdir:COUNTER:HEARTBEAT:0:U DS:symlink:COUNTER:HEARTBEAT:0:U DS:mknod:COUNTER:HEARTBEAT:0:U DS:remove:COUNTER:HEARTBEAT:0:U DS:rmdir:COUNTER:HEARTBEAT:0:U DS:rename:COUNTER:HEARTBEAT:0:U DS:link:COUNTER:HEARTBEAT:0:U DS:readdir:COUNTER:HEARTBEAT:0:U DS:readdirplus:COUNTER:HEARTBEAT:0:U DS:fsstat:COUNTER:HEARTBEAT:0:U DS:fsinfo:COUNTER:HEARTBEAT:0:U DS:pathconf:COUNTER:HEARTBEAT:0:U DS:commit:COUNTER:HEARTBEAT:0:U
- Network latency / Ping (ping-<hostname>.rrd)
-
DS:ping:GAUGE:HEARTBEAT:0:65535
- Processes (processes.rrd)
-
DS:running:GAUGE:HEARTBEAT:0:65535 DS:sleeping:GAUGE:HEARTBEAT:0:65535 DS:zombies:GAUGE:HEARTBEAT:0:65535 DS:stopped:GAUGE:HEARTBEAT:0:65535 DS:paging:GAUGE:HEARTBEAT:0:65535 DS:blocked:GAUGE:HEARTBEAT:0:65535
- lm_sensors fanspeed sensor (sensors-<inst>.rrd or lm_sensors-<chip>/fanspeed-<inst>.rrd)
-
DS:value:GAUGE:HEARTBEAT:U:U
- lm_sensors temperature sensor (sensors-<inst>.rrd or lm_sensors-<chip>/temperature-<inst>.rrd)
-
DS:value:GAUGE:HEARTBEAT:U:U
- lm_sensors voltage sensor (sensors-<inst>.rrd or lm_sensors-<chip>/voltage-<inst>.rrd)
-
DS:voltage:GAUGE:HEARTBEAT:U:U
- Serial port traffic (serial-<num>.rrd)
-
DS:incoming:COUNTER:HEARTBEAT:0:U DS:outgoing:COUNTER:HEARTBEAT:0:U
- Spam score (email/spam_score.rrd)
-
DS:score:GAUGE:HEARTBEAT:0:U
- Spam checks (email/spam_check-<type>.rrd)
-
DS:hits:GAUGE:HEARTBEAT:0:U
- Swap usage (swap.rrd)
-
DS:used:GAUGE:HEARTBEAT:0:1099511627776 DS:free:GAUGE:HEARTBEAT:0:1099511627776 DS:cached:GAUGE:HEARTBEAT:0:1099511627776 DS:resv:GAUGE:HEARTBEAT:0:1099511627776
- Tape drive usage (tape-<name>.rrd)
-
DS:rcount:COUNTER:HEARTBEAT:0: DS:rmerged:COUNTER:HEARTBEAT:0:U DS:rbytes:COUNTER:HEARTBEAT:0:U DS:rtime:COUNTER:HEARTBEAT:0:U DS:wcount:COUNTER:HEARTBEAT:0:U DS:wmerged:COUNTER:HEARTBEAT:0:U DS:wbytes:COUNTER:HEARTBEAT:0:U DS:wtime:COUNTER:HEARTBEAT:0:U
- Network traffic (traffic-<interface>.rrd)
-
DS:incoming:COUNTER:HEARTBEAT:0:U DS:outgoing:COUNTER:HEARTBEAT:0:U
- Interface packets (if_packets-<interface>.rrd)
-
DS:rx:COUNTER:HEARTBEAT:0:U DS:tx:COUNTER:HEARTBEAT:0:U
- Interface errors (if_errors-<interface>.rrd)
-
DS:rx:COUNTER:HEARTBEAT:0:U DS:tx:COUNTER:HEARTBEAT:0:U
- Users (users.rrd)
-
DS:users:GAUGE:HEARTBEAT:0:65535
- VServer load (vserver-<xid>/load.rrd)
-
DS:shortterm:GAUGE:HEARTBEAT:0:100 DS:midterm:GAUGE:HEARTBEAT:0:100 DS:longterm:GAUGE:HEARTBEAT:0:100
- VServer threads (vserver-<xid>/threads.rrd)
-
DS:total:GAUGE:HEARTBEAT:0:65535 DS:running:GAUGE:HEARTBEAT:0:65535 DS:uninterruptible:GAUGE:HEARTBEAT:0:65535 DS:onhold:GAUGE:HEARTBEAT:0:65535
- VServer network traffic (vserver-<xid>/traffic-<name>.rrd)
-
DS:incoming:COUNTER:HEARTBEAT:0:9223372036854775807 DS:outgoing:COUNTER:HEARTBEAT:0:9223372036854775807 DS:failed:COUNTER:HEARTBEAT:0:9223372036854775807
- VServer processes (vserver-<xid>/vs_processes.rrd)
-
DS:total:GAUGE:HEARTBEAT:0:65535
- VServer memory usage (vserver-<xid>/vs_memory.rrd)
-
DS:vm:GAUGE:HEARTBEAT:0:9223372036854775807 DS:vml:GAUGE:HEARTBEAT:0:9223372036854775807 DS:rss:GAUGE:HEARTBEAT:0:9223372036854775807 DS:anon:GAUGE:HEARTBEAT:0:9223372036854775807
- Wireless link quality (wireless-<interface>.rrd)
-
DS:quality:GAUGE:HEARTBEAT:0:U DS:power:GAUGE:HEARTBEAT:U:0 DS:noise:GAUGE:HEARTBEAT:U:0
SEE ALSO
collectd.conf(5), rrdtool(1), sensors(1), hddtemp(8), mbmon(1), kstat(3KSTAT)AUTHOR
Florian Forster <octo@verplant.org>Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre