These configuration are for logging performance data for Load, RAM, Disk and Network Interface of the local machine. May be used to replace basic MRTG.
The basic /etc/collectd.conf:
##############################################################################
# Global #
#----------------------------------------------------------------------------#
# Global settings for the daemon. #
##############################################################################
FQDNLookup true
BaseDir "/var/lib/collectd"
PIDFile "/var/run/collectd.pid"
PluginDir "/usr/lib/collectd"
TypesDB "/usr/share/collectd/types.db"
Interval 10
ReadThreads 5
# program logging plugin
LoadPlugin syslog
<Plugin syslog>
LogLevel info
</Plugin>
# data collection plugins
LoadPlugin disk
LoadPlugin interface
LoadPlugin load
LoadPlugin memory
# data saving plugin
LoadPlugin rrdtool
We need to customize the plugins a little bit to exclude data from irrelevant device.
Example, collect disk statistics for two RAID partitions /dev/md1 and /dev/md2 only, add these to the config file:
<Plugin disk>
Disk "/^md[1-2]$/"
IgnoreSelected false
</Plugin>
Exclude data from loopback interface:
<Plugin interface>
Interface "lo"
IgnoreSelected true
</Plugin>
The RRD data files will be save like this directory structure:
# tree /var/lib/collectd/
/var/lib/collectd/
`-- mail.cmsweb.com
|-- cpu-0
| |-- cpu-idle.rrd
| |-- cpu-interrupt.rrd
| |-- cpu-nice.rrd
| |-- cpu-softirq.rrd
| |-- cpu-steal.rrd
| |-- cpu-system.rrd
| |-- cpu-user.rrd
| `-- cpu-wait.rrd
|-- cpu-1
| |-- cpu-idle.rrd
| |-- cpu-interrupt.rrd
| |-- cpu-nice.rrd
| |-- cpu-softirq.rrd
| |-- cpu-steal.rrd
| |-- cpu-system.rrd
| |-- cpu-user.rrd
| `-- cpu-wait.rrd
|-- disk-md1
| |-- disk_merged.rrd
| |-- disk_octets.rrd
| `-- disk_ops.rrd
|-- disk-md2
| |-- disk_merged.rrd
| |-- disk_octets.rrd
| `-- disk_ops.rrd
|-- interface
| |-- if_errors-eth0.rrd
| |-- if_errors-eth1.rrd
| |-- if_errors-tun0.rrd
| |-- if_octets-eth0.rrd
| |-- if_octets-eth1.rrd
| |-- if_octets-tun0.rrd
| |-- if_packets-eth0.rrd
| |-- if_packets-eth1.rrd
| `-- if_packets-tun0.rrd
|-- load
| `-- load.rrd
`-- memory
|-- memory-buffered.rrd
|-- memory-cached.rrd
|-- memory-free.rrd
`-- memory-used.rrd