Grafana installation and configuration on Ubuntu server 18.04 LTS

From Thomas-Krenn-Wiki
Jump to navigation Jump to search

Grafana is a webbased open source frontend for virtualizing metrics and for alerting when thresholds are exceeded. Grafana supports numerous data sources, for example Time Series databases such as InfluxDB, Graphite or Prometheus, log files via Elasticsearch and SQL data bases. Pre-defined dashboards are available through a marketplace.[1] This aticle explains the installation of Grafana in version 6.6.2 on Ubuntu 18.04 LTS as well as the connection of a InfluxDB database as a data source.

Grafana dashboard with InfluxDB as datasource for monitoring a OPNsense firewall

Installation

Grafana can be easily installed using Ubuntu's built-in package manager.[2] The following paragraphs show how to install Grafana on Ubuntu. Information about the installation on Windows, MAC and other Linux distributions can be found in the Grafana download area.[3]

Add package sources

Since Grafana is not included in the official package repositories, the Grafana repository can be added as follows:

tk@monitoringlesv2:~$ sudo apt install -y apt-transport-https
tk@monitoringlesv2:~$ sudo apt install -y software-properties-common wget
tk@monitoringlesv2:~$ wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
tk@monitoringlesv2:~$ sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
tk@monitoringlesv2:~$ sudo apt update

Install Grafana and activate Systemd daemon

After the package sources have been added, Grafana can be installed and the SystemD-service can be started and activated for Grafana:

tk@monitoringlesv2:~$ sudo apt install grafana
tk@monitoringlesv2:~$ sudo systemctl daemon-reload
tk@monitoringlesv2:~$ sudo systemctl enable grafana-server
tk@monitoringlesv2:~$ sudo systemctl start grafana-server
tk@monitoringlesv2:~$ sudo systemctl status grafana-server

Configure Grafana

The configuration is made via Grafana webinterface.[4] To proceed with the remaining configuration steps, launch a browser of your choice.

  • Webinterface: http://<IP-des-Grafana-Servers>:3000
  • Username: admin
  • Password: admin

Login to webinterface

Log in with the username "admin" and the password "admin":

Add datasource

This paragraph shows how to connect an InfluxDB as datasource to Grafana:

Import dashboard

Pre-defined Grafana dashboards can be easily imported:

References

  1. Grafana Dashboards (grafana.com)
  2. Install on Debian or Ubuntu (grafana.com)
  3. Download Grafana (grafana.com)
  4. Getting started (grafana.com)


Author: Thomas Niedermeier

Thomas Niedermeier working in the product management team at Thomas-Krenn, completed his bachelor's degree in business informatics at the Deggendorf University of Applied Sciences. Since 2013 Thomas is employed at Thomas-Krenn and takes care of OPNsense firewalls, the Thomas-Krenn-Wiki and firmware security updates.


Translator: Alina Ranzinger

Alina has been working at Thomas-Krenn.AG since 2024. After her training as multilingual business assistant, she got her job as assistant of the Product Management and is responsible for the translation of texts and for the organisation of the department.


Related articles

CEP CT63 Modem
GPU Sensor Monitoring Plugin Setup
Graylog - Remote Log Server Management of a Proxmox VE cluster