Sending CollectD Metrics to InfluxDB

April 13, 2015 4 Comments collectd

collectd metrics to influxdb

With the right configuration, CollectdD can save its metrics into InfluxDB, which can then be used as a data source for monitoring visualization.

Requirements

First, uou need CollectD to be installed on your server. Here is how to install CollectD on Debian / Ubuntu and how to install CollectD on CentOS / Fedora.

You don’t need any special configuration of CollectD, as it monitors the basics 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, while 25826 is the port where InfluxDB will listen for CollectD metrics.

Receiving Metrics in InfluxDB

Upon InfluxDB startup, you should provide a config.toml file 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 listens to the same port upon which CollectD is sending (see CollectD configuration above).
  • database = “collectd_db”; InfluxDB will write CollectD metrics into the “collectd_db” database.
    We will need to create this database in InfluxDB.
  • typesdb = “/opt/collectd/share/collectd/types.db”; this file defines how CollectD metrics are structured. It will help InfluxDB to save CollectD metrics correctly in the database.

Start CollectD and InfluxDB

Start InfluxDB with:

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

With these settings, InfluxDB will write to a database called “collectd_db”.
Log in to the webadmin myinfluxdb.com:8083 (default credentials: root / root) to create the “collectd_db” database.

You can also create the database from the command line:

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

or execute the command show series in the webadmin.

influxdb with collectd metrics2

Live Dashboard

InfluxDB now records CollectdD metrics. 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 Anomaly.io

SIGN UP
  • 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

  • http://www.oriste.com/ 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.

  • http://www.muyiibidun.com Olumuyiwa Ibidunmoye

    Thanks alot for this article!

help with term papers