Monitoring with Collectd, InfluxDB and Grafana (Part3)
Installation and setup (Part 2/2)
Edit the configuration for InfluxDB one more time to enable authentication as by default, it is
disabled (so you can create an admin user):
enabled = true
bind-address = “:8086”
auth-enabled = true
log-enabled = true
write-tracing = false
pprof-enabled = false
https-enabled = false
https-certificate = “/etc/ssl/influxdb.pem”
Restart InfluxDB so the authentication setting can take effect:
- systemctl restart influxdb.service
Setup collectd to send data to InfluxDB
Edit the collectd config to enable the “network” plugin:
Add configuration for “network” plugin:
<Server “<InfluxDB IP>” “8888”>
- systemctl restart collectd.service
Verification metric in testmonitor1db:
- select * from /.*/ limit 1
At this moment you should start seeing data from collectd into influxdb database “collections”.
Since we are *writing* data, we want to use the “collectdrw” user as this user has read/write permissions.
Starting grafana will automatically create an administrator user with the username//
- systemctl start grafana-server.service
Allow Grafana to go through the firewall
- firewall-cmd –permanent –zone=public –add-port=3000/tcp
- firewall-cmd –reload
Access the web GUI for Grafana: (http://<grafana IP>:3000) with the previous admin credentials above.
Change usernames, add users, change passwords, etc. as needed.
Add a new datasource :
URL: http://<InfluxDB IP>:8086
Click “ADD” to make sure you test the connection between influxDB and Grafana.
Now we have a complete decoupled architecture available with Grafana as the visualizer, Influxdb as data store containing the data collected by CollectD.
The choice of this decoupled monitoring architecture can be challenged in relation to the need. There are many tools and datastore compatible with Grafana which is the number one visualization product.
In order to have a complete centralization of our services, I will show you an installation of the ELK stack which means ElasticSearch, Logstash and Kibana which today is the most popular of the market log management stack centralizes and opensource.
Here is a live demo where you can play with a configured Grafana : http://play.grafana.org/