The collectd utility is absolutely fantastic for recording system information. It provides 100s of plugins and remote reporting and the default installation has some nice graph-viewing CGIs.
Installing Collectd
On Gentoo/Praxis
Before installing Collectd the COLLECTD_PLUGINS flags must be properly configured for the plug-ins that you expect to use.
COLLECTD_PLUGINS="apache cpu df disk interface load memory network ntpd postgresql processes write_http"
~ # export ACCEPT_KEYWORDS="~amd64" ~ # export USE="" ~ # emerge -av collectd [ebuild N ~] app-admin/collectd-5.1.0-r1 USE="-contrib -debug -perl -static-libs" COLLECTD_PLUGINS="apache -apcups -ascent -battery -bind -conntrack -contextswitch cpu -cpufreq -csv -curl -curl_json -curl_xml -dbi df disk -dns -email -entropy -ethstat -exec -filecount -fscache -gmond -hddtemp interface -ipmi -iptables -irq -java -libvirt load -logfile -madwifi -match_empty_counter -match_hashed -match_regex -match_timediff -match_value -mbmon -md -memcachec -memcached memory -multimeter -mysql -netlink network -nfs -nginx -notify_desktop -notify_email ntpd -numa -nut -olsrd -onewire -openvpn -oracle -perl -ping postgresql -powerdns processes -protocols -python -routeros -rrdcached -rrdtool -sensors -serial -snmp -swap -syslog -table -tail -target_notification -target_replace -target_scale -target_set -tcpconns -teamspeak2 -ted -thermal -tokyotyrant -unixsock -uptime -users -uuid -varnish -vmem -vserver -wireless -write_graphite write_http -write_mongodb" 1,275 kB
On Debian/Ubuntu
To get the whole package, and loads of the default plugins use:
~ # apt-get --yes install collectd
A bit more selective, good for collecting and reporting but without all the plugins and CGIs.
~ # apt-get --yes install collectd-core collectd-dev
Configuring Collectd
Collectd is hella easy to configure, start collecting stats in seconds.
The configuration is located in /etc/collectd.conf
or /etc/collectd/collectd.conf
.
Hostname [this host fqdn] Interval 240 # BaseDir "/var/lib/collectd" # Essential Collectors Include /etc/collectd/cpu.conf Include /etc/collectd/df.conf Include /etc/collectd/interface.conf # Cool Collectors Include /etc/collectd/apache.conf Include /etc/collectd/memcached.conf # Cool Reporters Include /etc/collectd/network.conf Include /etc/collectd/write_http.conf
Collectd Network Plugin
This plugin allows the local collectd to publish it's stats to a remote collectd server. See the plugin documentation for more details.
LoadPlugin network <Plugin network> Server "custos.io" SecurityLevel "Encrypt" Username "some-user-name" Password "some-pass-keys" </Plugin>