Monitoring stack by using Grafana + Prometheus + Netdata

Chalut Dumrongsiri
3 min readOct 7, 2018

--

There are many monitoring tools from open source to a commercial level which helps you to monitor your server. this story I will pick some of tools for example. so let’s try it together!

Architecture

Example architecture

In host server, I use an Ubuntu OS and Grafana + Prometheus install on docker. In target server, I install Netdata on OS.

Pre-requirement

  1. Docker : you can install by the following command

or run the following command

# bash <(curl -Ss https://gist.githubusercontent.com/chalut01/9d1cc1294b885bb90c4e486100905d35/raw/73db740dd4eedd1ac45cf6a462392f2cb7f04f85/install_docker.sh)

2. Ensure you enable firewall ports on the following ports

  • Host Server : 3000, 9090
  • Target Server : 19999

Install

Let’s begin !!

  1. Install netdata on target server.
# basic netdata installation
bash <(curl -Ss https://my-netdata.io/kickstart.sh)

# or

# install required packages for all netdata plugins
bash <(curl -Ss https://my-netdata.io/kickstart.sh) all

after installed, you can access by the following url

http://<target server ip>:19999/

2. Install Grafana and Prometheus on host server by the following docker-compose.

or the following command

# wget https://gist.githubusercontent.com/chalut01/e007fe13288acf2825cdd3704aea7b05/raw/15060a3e9059f058838256bc3b27e37cf8e6566f/docker-compose.yml# docker-compose up -d

you can access by the following url

# Grafana
http://<host server ip>:3000/
username : admin
password : admin
# prometheus
http://<host server ip>:9090/graph
Grafana
Prometheus

Config

  1. Stop monitoring stack by docker-compose
# docker-compose stop

2. Go to ./prometheus/prometheus.yml and edit the config by the following example.

3. Login to Grafana > Configuration > Data Source
Enter the following value.

Prometheus — Data Source

Start monitoring stack by docker-compose

# docker-compose up -d

Using

  1. Login to Grafana
# http://<host server ip>:3000/

2. Create Dashboard

3. Add Graph

4. Query what you want to see.

5. Edit graph name and click back at the right hand.

6. Save dashboard. Finish

Summary

This monitoring stack you can monitoring in real-time by Netdata and see the history by using Grafana.

Example

For more information

Grafana :
http://docs.grafana.org/guides/getting_started/

Prometheus : https://prometheus.io/docs/prometheus/latest/getting_started/

Netdata :
https://github.com/netdata/netdata/wiki/Installation

--

--