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.
- Icinga Web 2 (>= 2.11)
- Icinga DB Web (>= 1.02)
- Grafana (>= 7.0)
- Grafana Image Renderer (when using proxy access)
- PHP 8.1 (with curl and gd enabled)
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:
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.
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}"
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
In the Icinga Web 2 frontend in Configuration -> Modules -> grafana -> enable
.
You can also enable the module by using the icingacli
command:
icingacli module enable grafana
Depending on which mode (indirect proxy/iframe) you want to use you have to set some configuration in Grafana
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.
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 a datasource depending on the metric backend you want to use.
Depending which metric backend (influxdb/graphite) you use, import the provided dashboards.