collectd is a daemon that periodically collects system and application performance metrics. This integration describes how to send collected data to Wavefront using the Graphite plugin.
For step-by-step instructions for using collectd as the collector agent with Apache, Cassandra, Memcached, MySQL, NGiNX, Redis, and Zookeeper, see our documentation pages.
Step 1. Configure Wavefront Proxy to Listen for Graphite Data
- If you have not already done so, install a Wavefront proxy.
- On the server running your Wavefront proxy, open the file
/etc/wavefront/wavefront-proxy/wavefront.conf. Uncomment and configure the following properties as required:
graphitePorts=2003 graphiteFormat=2 graphiteDelimiters=_
- Save and close
- Restart the proxy:
sudo service wavefront-proxy restart.
- Tail the proxy log file to make sure there are no errors:
tail -f /var/log/wavefront/wavefront.log.
Step 2. Install collectd
collectd is typically available in standard Linux distribution repositories but we primarily recommend using these packages. These instructions assume that you are using collectd V5.1 or higher. Wavefront can also work with collectd 4.10.
Step 3. Configure collectd
There are many plugins available with collectd, including SNMP and various databases. In this procedure we leave the plugins at whatever defaults your distribution sets. Typically this means you’ll see some information about the local machine such as its CPU load, local network interfaces, and memory and disk usage. Configure the
write_graphite plugin which will send the data to the Wavefront proxy.
- Edit the collectd configuration file
- If the hostname command on this machine returns something very generic like localhost you can explicitly set the host that will appear within Wavefront for this machine by uncommenting the line #Hostname and replacing “localhost” with the desired hostname.
Insert the following lines at the bottom of the file:
LoadPlugin "write_graphite" <Plugin write_graphite> <Node "example"> Host "localhost" Port "2003" Prefix "collectd." StoreRates false SeparateInstances true Protocol "tcp" LogSendErrors true EscapeCharacter "_" AlwaysAppendDS false </Node> </Plugin>
See the write_graphite documentation for an explanation of the various options. We believe these settings provide the optimal behavior when using Wavefront. If you are running collectd on a different machine from the one where the Wavefront proxy is running, replace
localhost in the
write_graphite configuration block.
Prefix setting causes all the metrics that end up Wavefront to begin with collectd, for example
collectd.cpu.0.cpu.idle. This can be helpful to allow your collectd metrics to be kept totally separate from those from different sources. However, if you prefer not to have that prefix you can delete or comment out that line in your configuration. If you do that you must also edit
graphiteFormat=1, and restart the Wavefront proxy.
Step 4. Run collectd
sudo service collectd start.
You can alternatively use a Wavefront plugin that allows you to add point tags to metrics. For more information, see Wavefront collectd plugin.