CollectD is one of the best daemons for collecting system metrics periodically.
Today we will focus on installing and running CollectD on Debian Linux the easy way.
Install CollectD
Since we will compile CollectD from source, we need a compiler:
1 | sudo apt-get install build-essential |
Next we download, compile and install CollectD 5.5.0:
1 2 3 4 5 6 7 | cd /tmp/ wget https://collectd.org/files/collectd-5.5.0.tar.bz2 tar -jxf collectd-5.5.0.tar.bz2 cd collectd-5.5.0 sudo ./configure sudo make all install |
By default you will find:
- The configuration file at /opt/collectd/etc/collectd.conf
- The collectd binary at /opt/collectd/sbin/collectd
Start CollectD on startup
An easier way to manage CollectD on Debian is using an init script.
1 2 | sudo wget -O /etc/init.d/collectd https://raw.githubusercontent.com/martin-magakian/collectd-script/master/collectd.init sudo chmod 744 /etc/init.d/collectd |
CollectD will now run at startup, but you can still manage it manually:
1 2 3 4 | service collectd start service collectd stop service collectd status service collectd restart |
Send Metrics to Database
CollectD is pretty useless by itself. You need to send its metrics frequently to a database for monitoring:
System and App monitoring with CollectD
By default CollectD only monitors CPU, memory, interface and load.
You can configure CollectD to monitor much more:
Monitor & detect anomalies with Anomaly.io
SIGN UP