Monitoring stack by using Grafana + Prometheus + Netdata
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
In host server, I use an Ubuntu OS and Grafana + Prometheus install on docker. In target server, I install Netdata on OS.
Pre-requirement
- 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 !!
- 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
Config
- 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.
Start monitoring stack by docker-compose
# docker-compose up -d
Using
- 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.
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