Skip to content

Latest commit

 

History

History
133 lines (92 loc) · 4.47 KB

02-installation.md

File metadata and controls

133 lines (92 loc) · 4.47 KB

Installation

These are the instruction to install the Icinga Web 2 module Grafana. In case you already installed Grafana module and want to update to the latest version, please read on here.

Requirements

The Grafana Image Renderer handles rendering panels and dashboards to PNGs using a headless browser (Chromium).

A data source as a backend for Grafana. Either:

Install the Grafana module

As with any Icinga Web 2 module, installation is pretty straight-forward. In case you're installing it from source all you have to do is to drop the Grafana module in one of your module paths. You can examine (and set) the module path(s) in Configuration / Application. In a typical environment you'll probably drop the module to /usr/share/icingaweb2/modules/grafana. Please note that the directory name MUST be grafana and not icingaweb2-module-grafana or anything else.

Git clone

Use this only if you want to use/test the latest developer version of the module.

ICINGAWEB_MODULEPATH="/usr/share/icingaweb2/modules"
REPO_URL="https://github.com/NETWAYS/icingaweb2-module-grafana"
TARGET_DIR="${ICINGAWEB_MODULEPATH}/grafana"
git clone "${REPO_URL}" "${TARGET_DIR}"

Tarball

Replace the version number with the latest available version from Latest Release

MODULE_VERSION="3.0.0"
ICINGAWEB_MODULEPATH="/usr/share/icingaweb2/modules"
REPO_URL="https://github.com/NETWAYS/icingaweb2-module-grafana"
TARGET_DIR="${ICINGAWEB_MODULEPATH}/grafana"
URL="${REPO_URL}/archive/v${MODULE_VERSION}.tar.gz"
install -d -m 0755 "${TARGET_DIR}"
wget -q -O - "$URL" | tar xfz - -C "${TARGET_DIR}" --strip-components 1

Enable the module

In the Icinga Web 2 frontend in Configuration -> Modules -> grafana -> enable.

enable Grafana module

You can also enable the module by using the icingacli command:

icingacli module enable grafana

Grafana Preparations

Depending on which mode (indirect proxy/iframe) you want to use you have to set some configuration in Grafana

For 'indirect proxy' mode

If you don't want anonymous access you have to create a user (with password) and enable basic auth in grafana.ini

 #################################### Basic Auth ##########################
 [auth.basic]
 enabled = true

If you want to allow anonymous access (read only) enable "Anonymous Auth" in grafana.ini and set default organization

 #################################### Anonymous Auth ##########################
 [auth.anonymous]
 # enable anonymous access
 enabled = true

 # specify organization name that should be used for unauthenticated users
 org_name = Koebbes

 # specify role for unauthenticated users
 org_role = Viewer

For token access you need to create a Service Account and assign it a token. See the Grafana Docs.

For 'iframe' mode

You have to enable "Anonymous Auth" in grafana.ini and set default organization or users need to be logged in into Grafana first to see graphs in Icinga Web 2.

 #################################### Anonymous Auth ##########################
 [auth.anonymous]
 # enable anonymous access
 enabled = true

 # specify organization name that should be used for unauthenticated users
 org_name = Koebbes

 # specify role for unauthenticated users
 org_role = Viewer

Create Grafana datasource

Create a datasource depending on the metric backend you want to use.

InfluxDB example

Grafana Datasource InfluxDB

Graphite example

Grafana Datasource Graphite

Import dashboards

Depending which metric backend (influxdb/graphite) you use, import the provided dashboards.

icinga2-default dashboard

Grafana import icinga2-default dashboard