How to configure grafana on centOS 8

This is a continuation of our previous post where we showed you How to install Grafana on CentOS 8. In this post, we focus on how you can configure SMTP server in grafana , add data source , create new dashboard, import dashboard, create users, add plugins. Without much further ado, let’s get on with it.

For demonstration purposes we will deploy a centOS 8 host which will be grafana server.

once you login to grafana server Home should be look like this

Setup SMTP in Grafana

  1. go to config directory of you grafana distribution
  2. if you dont know which grafan.ini is in use, run below command check

3. open grafana.ini config file

sudo vi /etc/grafana/grafana.ini

4. go to SMTP section grafana.ini

make changes according to you SMTP server

5. save grafana.ini file

6. restart grafana server

sudo systemctl restart grafana-server

create new User

  1. click on settings
  2. select users from drop down menu.

3) click on invite to add new user

4) fill add details below details:

a. Email or Username

b. Name

c. Role

in this section you can find 3 types of role.

Viewer – this type of user can have only view dashboards rights

Editor – this type of user can edit/manipulate dashboard configuration.

Admin – this type of user can perform All activities.

5) click on submit button , it will create new user.

if you have selected “send invite email” toggle button then user will receive invitation mail on provided mailID. user can open link given in mail and activate there account.

Add new data source

Grafana supports multiple types of data sources to storage backends for your time series data.

there 3 ways to add Data Source in grafana.

  1. configure Data Source from GUI
  2. using CLI command line
  3. download data source plugins manually
  1. configure Data Source from GUI
    1. click on configuration
    2. click on add data source

3. search data source in search box and click on it

4. Add influx DB details on page

influxdb url

Access: server(default)

Auth:

you can select anyone from give options

database: add influxDB database which have already created

user: add database user

password: Add database user’s password

min time interval : you can set time inerval or keep defualt value

max series: you can set max series to add DB at time or keep defualt value

5. click on “Save & Test” button it will create influx named data source.

6. repeat this process for creating other types of data source. for ex. elasticsearch telegraf.

if data source is not in core list of data source then you can find more data source on grafana.com button or by directly visiting grafana.com

there are multiple types of open source data source present . select as per your requirements.

2. using CLI command line

use below command to install plugins

ex: grafana-cli plugins install “data source name”

grafana-cli plugins install akumali-datasource

3. download data source plugins manually

Alternatively, you can manually download the .zip file and unpack it into your grafana plugins directory

in this way we can data source and different data sources in grafana

Add new DashBoard

  1. click on + sign
  2. click on Dashboard
  3. open Add new Panel
  4. give panel name
  5. select data source from available list ( ex: we have selected influxDB as datasource)

in this way we can create simple Dashboard with datasource and other all default values

Import Dashboard

you can import dashboard in grafana-server

  1. download dashboard as per your requirement from internet store as json file
  2. click + button
  3. click import dashboard button from drop down menu
  4. click on upload JSON file
  5. select downloaded dashboard json file from your computer.
  6. or copy paste json file content in import via panel json text area
  7. or you can import dashboard from grafana.com for this copy paste grafana dashboard URL (ex: https://grafana.com/grafana/dashboards/2618)
  8. click on submit button

it will import dashboard in your grafana server.

JSON format of dashboard should be look like this

{
  "id": null,
  "uid": "cLV5GDCkz",
  "title": "New dashboard",
  "tags": [],
  "style": "dark",
  "timezone": "browser",
  "editable": true,
  "hideControls": false,
  "graphTooltip": 1,
  "panels": [],
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "time_options": [],
    "refresh_intervals": []
  },
  "templating": {
    "list": []
  },
  "annotations": {
    "list": []
  },
  "refresh": "5s",
  "schemaVersion": 17,
  "version": 0,
  "links": []
}

you have to set required data source and plugins in this dashboard to work properly

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

x