Monitor and graph your Linux Bind servers with Grafana

Monitor and graph your Linux Bind servers with Grafana

The purpose of this tutorial is to help you to configure the following components :

  • bind : configure statistics
  • influxdb : time series database
  • collectd-proxy : program written in Go that will act as a gateway between collectd and influxdb
  • collectd : collect Bind statistics
  • grafana : create your graph with grafana using the data stored in the influxdb database

In this tutorial, I will use :

  • 2 Bind servers (master/slave) : dns01 and dns02
  • 1 monitoring machine running on Debian : mon01

At the end, you will be able to create dashboards like this :
graf

First step : Configure Bind statistics on dns01 and dns02

To configure statistics on Bind, you have to edit two files and add the following lines :
/etc/bind/named.conf :

/etc/bind/named.conf.options :

Restart Bind
service bind9 restart

Repeat these steps on all of your Bind servers. You can test everything is ok, by running locally on the bind server, the following command :
curl http://localhost:7766

Install and configure influxdb on mon01

Then start the daemon by running:

sudo /etc/init.d/influxdb start

Edit the configuration file /opt/influxdb/shared/config.toml and the following variables are set properly :

Restart the influxdb service
service influxdb restart

Create the databases for both dns01 and dns02 with the following commands :

Install and configure the collectd-proxy

Ensure that you have an up-to-date Go library before typing the following commands:

On dns01
./proxy --influxdb=mon01:8096 --typesdb=/usr/share/collectd/types.db --database=dns01_collectd --username=root --password=root -proxyport=8899
On dns02
./proxy --influxdb=mon01:8096 --typesdb=/usr/share/collectd/types.db --database=dns02_collectd --username=root --password=root -proxyport=8899

Install and configure collectd

Command to install:
apt-get install collectd

Edit the file /etc/collectd/collectd.conf and add the following lines :

Reload collectd:
service collectd reload

Grafana

Download the latest release here
wget http://grafanarel.s3.amazonaws.com/grafana-1.9.1.tar.gz

Unzip the archive and copy the folder to the root of the web server mon01:

Create your first graph

Example query to graph the number of request on the host A records
graf_query

You can adapt the following json file to create the dashboard described in this procedure

Go further

You can now go further with collectd and grafana by enabling other collectors like for example :

  • LoadPlugin cpu
  • LoadPlugin df
  • LoadPlugin disk
  • LoadPlugin entropy
  • LoadPlugin interface
  • LoadPlugin irq
  • LoadPlugin load
  • LoadPlugin memory
  • LoadPlugin processes
  • LoadPlugin swap
  • LoadPlugin users

You can find the whole list here

Do not hesitate to leave a comment if you see any errors in this doc or if you have any questions.


Reference

Monitor metrics collected by collectd into InfluxDB

Collectd documentation

InfluxDB

Grafana

2 thoughts on “Monitor and graph your Linux Bind servers with Grafana

Leave a Reply

Your email address will not be published. Required fields are marked *