Install Grafana

What about this post

Grafana installation
Installation Percona Dashboard https://github.com/percona/grafana-dashboards
Nginx Configuration for reverse proxy

Prerequisites

Centos Minimal + http://agreco.it/en/post/prometheus-installation/

Installation

The installation process can find in the official documentation

sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-4.0.2-1481203731.x86_64.rpm -y
#Avviamo L'aplicativo
systemctl restart grafana-server.service
systemctl enable grafana-server.service 
Created symlink from /etc/systemd/system/multi-user.target.wants/grafana-server.service to /usr/lib/systemd/system/grafana-server.service.

Configuration

vim /etc/grafana/grafana.ini

Change this parameters

[dashboards.json]
enabled = true
path = /var/lib/grafana/dashboards

Configure Nginx

cd /etc/nginx/conf.d
vim grafana.conf

This minimal configuration for grafana

server {
    listen 80;

    server_name grafana.greco.cf;

location / {
        proxy_pass http://localhost:3000;
    }
}
systemctl restart nginx.service

Configure prometheus for Datasource

Change the type from Graphite to Prometheus

Configure the name wit Prometheus

Configure Percona Dashboard

The official documentation

https://github.com/percona/grafana-dashboards

cd /tmp/
cp -r grafana-dashboards/dashboards /var/lib/grafana/

#eseguiamo questo script sed
sed -i 's/expr=\(.\)\.replace(\(.\)\.expr,\(.\)\.scopedVars\(.*\)var \(.\)=\(.\)\.interval/expr=\1.replace(\2.expr,\3.scopedVars\4var \5=\1.replace(\6.interval, \3.scopedVars)/' /usr/share/grafana/public/app/plugins/datasource/prometheus/datasource.js
sed -i 's/,range_input/.replace(\/"{\/g,"\\"").replace(\/}"\/g,"\\""),range_input/; s/step_input:""/step_input:this.target.step/' /usr/share/grafana/public/app/plugins/datasource/prometheus/query_ctrl.js


systemctl restart grafana-server.service

This is the Result