Send CollectD metrics to InfluxDB

April 13, 2015 3 Comments collectd

collectd metrics to influxdb

With some configuration, CollectdD can save it metrics into InfluxDB.
Then, InfluxDB can be used as a data source for monitoring visualisation.


You need CollectD to be installed on your server.
Here is how to install ColletD on Debian / Ubuntu and how to install CollectD on CentOS / Fedora.

You don’t need any configuration of CollectD as it monitors the basic by default.
But if you want you can configure CollectD for more system monitoring.

Send metrics from CollectD

By default Collectd configuration is located at /opt/collectd/etc/collectd.conf or /etc/collectd.conf
Edit this configuration file.

If the network plugin isn’t loaded already add it:

Also, add the network plugin configuration:

Localhost; is the URL or IP address of your InfluxDB server.
25826 ;
is the port where InfluxDB will listen for CollectD metrics.

Received metrics into InfluxDB

On InfluxDB startup, you should provide a config.toml to overwrite default settings.
Start InfluxDB with your configuration or using this InfluxDB configuration example:

Edit config.toml and edit the [collectd] part, it should look like this:

  • port = 25826; Make sure InfluxDB listen to the same port CollectD sends it metric to (see CollectD configuration above)
  • database = “collectd_db” ; InfluxDB will write Collectd metrics into “collectd_db” database.
    We will need to create this database in InfluxDB.
  • typesdb = “/opt/collectd/share/collectd/types.db” ; This file define how Collectd metrics are structured. It will help InfluxDB to save Collectd metrics correctly in database.

Start CollectD and InfluxDB

Start InfluxDB with:

Start Collectd on Debian / Ubuntu or on CentOS / Fedora:

With those settings, InfluxDB will write to a database call “collectd_db”.
Login to the webadmin (default credential: root / root) to create the “collectd_db” database.

Or create the database in command line:

Now InfluxDB should receive and save CollectD metrics.
Check it out from the command line:

or execute the command show series; in the webadmin.

influxdb with collectd metrics2

Live dashboard

At this point, InfluxDB records CollectdD metric.
The next step is to choose a dashboard to watch the metrics in real time.

We recommend using Grafana with InfluxDB

Monitor & detect anomalies with

  • Elschemali

    It’s good information, but what about situation what you are get after running? Collectd send counters and in InfluxDB you will have a huge values

  • oriste

    Thanks very much for the write-up, came in handy today!
    One remark: on my freshly installed collectd (apt-get install collected), the config file was in /etc/collectd/collectd.conf not in /etc/collectd.conf

  • Stephen Eaton

    thanks for this info, I’m using OSX and collectd, which is installed via brew. the config file is located in /usr/local/opt/collectd/etc/collectd.conf for those looking.