Collectd: Installation and Configuration
Introduction
Collectd gathers statistics about the system it is running on and stores this information. Those statistics can then be used to find current performance bottlenecks (i.e. performance analysis) and predict future system load (i.e. capacity planning). Or if you just want pretty graphs of your private server and are fed up with some homegrown solution you’re at the right place, too ;).
After this installation, you’ll likely want access through a web interface. Feel free to continue with these documentations.
Installation
Whether it’s on the server or client, it’s quite convenient, it’s the same package that needs to be installed.
Debian
On Debian, it’s always as simple as:
|
|
Client
Debian
On Debian, it’s always as simple as:
|
|
Solaris
On Solaris, it’s available on SunFreeware:
|
|
Configuration
Server
For the server, we’re going to make sure these modules are activated (uncommented):
|
|
Then we’re going to add the IP on which the Collectd server should listen:
|
|
Unless the Collectd server is a beast of a machine, it’s preferable to cache the information before writing it to disk. This will reduce I/O and CPU usage:
|
|
Now restart the collectd server.
Client
On the client side, choose a few modules to activate:
|
|
And finally enter the IP address of the server:
|
|
Now restart the collectd client.
If you want to activate other services, just uncomment the ones you’re interested in.
Adding Modules
You can easily add modules by compiling them. Depending on the OS you’re on, it’s more or less easy.
Compiling Modules on Solaris
After struggling for a few hours, here’s the process to compile collectd with its modules in 32 and 64 bits.
- First, we’re going to download and decompress the sources:
|
|
- Next, we’ll install some dependencies. You need to download the Solaris companion CD and install these packages:
|
|
- Then you need to install Oracle Solaris Studio Express.
You can (for those who want) use GCC:
|
|
But I wasn’t able to compile 64-bit libraries even following the docs and FAQ. That’s why I recommend Solaris Studio Express.
- Then start the 64-bit compilation with standard options:
|
|
This ‘CFLAGS="-m64 -mt -D_POSIX_PTHREAD_SEMANTICS"’ indicates that we want to use 64-bit. Remove it to do 32-bit.
If you want to compile only a specific plugin, you can do it like this:
|
|
Then you just need to do the famous ‘make install’ when you’re ready.
Creating the Solaris SMF
All necessary files are in the sources (contrib/solaris-smf). The cleanest way is to move the collectd.xml file to the same place as the other xmls:
|
|
By default the xml looks for the SMF in /lib/svc/method, so we move the script to the right place:
|
|
Then we register the xml:
|
|
Resources
Last updated 06 Oct 2010, 08:20 CEST.