collectd

collectd is a daemon that gathers system processes, and generates RRD files.

See also CGP for web statistics.

Requirements

  • rrdtool
  • apache web server with PHP support
  • A MySQL user that can excecute 'SHOW STATUS';
  • .htaccess file to limit visibility

CentOS

Repository installs:

yum install libpcap-devel

Download and install manually:

  • rrdtool - use –prefix=/usr
  • collectd - use –prefix=/usr then make all install
Startup

Download and install the collectd init script.

Notes

On one CentOS install, I was having trouble with collectd's rrdtool library linking correctly. The fix that worked was to install rrdtool with a prefix of /usr.

Gentoo

make.conf changes

COLLECTD_PLUGINS="apache cpu disk iptables logfile mysql processes uptime users swap
syslog load conntrack interface memory netlink rrdtool tcpconns vmem df protocols sensors"

FreeBSD

Located in /usr/ports/net-mgmt/collectd

echo collectd_enable=YES >> /etc/rc.conf
mkdir /var/lib/collectd
/usr/local/etc/rc.d/collectd start

MySQL

Create a new user with proper privileges:

CREATE USER 'collectd'@'localhost' IDENTIFIED BY 'password';
GRANT SELECT, PROCESS, SHOW DATABASES, SUPER ON *.* TO 'collectd'@'localhost';
FLUSH PRIVILEGES;

Notes

Some plugins will not work on a VPS because you do not have direct access to the hardware.

Once you start collectd, tail the system logs to make sure everything is okay.