Basic Grafana Dashboard in Ubuntu

Imalsha Gunasekara
3 min readNov 1, 2020

--

Grafana is by far one of the most popular open-source dashboard monitoring tools available for visualization purposes.

Installation (source)

sudo apt-get install -y apt-transport-https sudo apt-get install -y software-properties-common wget wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -

Add this repository for stable releases:

echo "deb https://packages.grafana.com/enterprise/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list

After you add the repository:

sudo apt-get update sudo apt-get install grafana-enterprise

Note: The enterprise version is recommended and can be used by all users. It can be upgraded with a Grafana Enterprise subscription if needed.

Starting the Server

To start the service and verify that the service has started:

sudo systemctl daemon-reload

sudo systemctl start grafana-server

sudo systemctl status grafana-server

Logging in for the first time (source)

  1. Open your web browser and go to http://localhost:3000/. 3000 is the default HTTP port that Grafana listens to if you haven’t configured a different port.
  2. On the login page, type admin for the username and password.
  3. Change your password.

Plotting a time series imported from a MySQL database

Before you create your first dashboard, you need to add your data source.

  • Click on Configuration > Data Sources in the side menu.
  • Click Add data source.
  • Select MySQL.
  • Fill the Host, Database, User, Password fields and click Save & Test.

Creating a new Dashboard

  • Click on Create > Dashboard on the side menu.
  • Click on Add new panel.
  • Select the Data Source as MySQL from the list of added data sources.
  • Select the Table name and the needed column names to generate the SQL query.
  • Click on zoom to data and save the panel.

--

--