Tutorials

Setup Collectd with Grafana and InfluxDB

Table of Contents

Introduction

Prior to starting this tutorial you will want to follow these instructions to build out an Ubuntu server to host docker and a docker container with InfluxDB installed on it. You will be feeding your metrics into this and using Grafana to visualize your data.

Setup Docker on Ubuntu at ProfitBricks

Creating a Grafana and InfluxDB Docker Container

By the end of this tutorial you will have setup collectd to feed metrics from your ProfitBricks server(s) into InfluxDB and surface that information within the Grafana dashboard.

Since collectd uses UDP we recommend you use this on a private network in your Data Center.

Install and Configure collect

You will need to install the following for this next section.

apt-get install -y collectd

Once installed you now need to configure collectd to utilize the proxy we installed

vi /etc/collectd/collectd.conf

Uncomment and update the lines:

LoadPlugin network

<Plugin network>
        Server "10.10.10.10" "8096"
</Plugin>

Where we have 10.10.10.10 you'll want to replace with your container's private IP address.

Verify

You can use tcpdump to ensure packets are traveling over UDP to your container.

tcpdump -i eth1 -p -n -s 1500 udp

listening on eth1, link-type EN10MB (Ethernet), capture size 1500 bytes
23:59:07.014256 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 02:01:81:99:60:fa, length 300
23:59:13.104494 IP 10.10.10.11.42509 > 10.10.10.10.8096: UDP, length 1331
23:59:13.104773 IP 10.10.10.11.42509 > 10.10.10.10.8096: UDP, length 1332

You should also be able to query InfluxDB to see your metrics:

select * from "ubuntu/cpu-0/cpu-idle"

You're next steps are to now setup your Grafana dashboard in the way you'd like.