Monitoring with Collectd, InfluxDB and Grafana (Part1)

Introduction

Today more than yesterday we need to have a visualization of our architecture in real time in order to react against issues, to maintain our infrastructure, to have a view of our Business or to ensure the success to be able to have the performance announce during contract like Service Level Agreement (SLA).

Tools like Nagios or check_mk no longer need to proof how they are good at this. However, the way the infrastructure is building change and how to visualize it too.

Stateless and decoupled architecture are the future mindset to have in this new way to think how to deploy more efficiently with high availability, scalabilty and fault tolerance.

If a customer informs you that a service is down it’s already too late…

To monitor the infrastructure I will show you how to install the following tools :

  • CollectD
  • InfluxDB
  • Grafana

CollectD will be use to collect the data and metric from our system when InfluxDB will be our datastore in case of store all these new metrics and last but not least Grafana as a powerful Visualization tool with Dashboard.

The best would be to install this environment on docker but as many people are not yet in, I will show you an installation on Centos 7.

Prerequisites for CentOS 7

  • Minimal install + compatibility libraries
  • IP Static
  • Updated and upgraded if necessary
  • wget, net-tools installed

Prerequisites for InfluxDB and Grafana

  • Repositories for each one of them
  • epel-release already installed

How to install the epel-release repository :

  • yum install epel-release -y

Add repository for influxDB :

  • cat <<EOF | sudo tee /etc/yum.repos.d/influxdb.repo
    [influxdb]
    name = InfluxDB Repository – RHEL \$releasever
    baseurl = https://repos.influxdata.com/rhel/\$releasever/\$basearch/stable
    enabled = 1
    gpgcheck = 1
    gpgkey = https://repos.influxdata.com/influxdb.key
    EOF

Add repository for Grafana :

  • cat <<EOF | sudo tee /etc/yum.repos.d/grafana.repo
    [grafana]
    name=grafana
    baseurl=https://packagecloud.io/grafana/stable/el/6/$basearch
    repo_gpgcheck=1
    enabled=1
    gpgcheck=1
    gpgkey=https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
    sslverify=1
    sslcacert=/etc/pki/tls/certs/ca-bundle.crt
    EOF

Let’s jump to the second part since we finished with the necessary prerequisites. In the second part we will install our solution in order to have our complete monitoring infrastructure.

Leave a Reply