OS4X Grafana Integration
OS4X supports the integration of Grafana (when using the MySQL/MariaDB database backend). It helps you automated in these tasks:
- check the authentication token
- create and check the data source
- create and check the dashboard
- publishing the dashboard anonymously, to be embedded as an iframe in the OS4X admin panel
If one of these tasks has to be manually
Requirements
A Grafana server with installed MySQL Data Source plugin is required. For the configuration of the integration you need an API token with administrative permissions.
Grafana server configuration
Since the panel is being embedded as an HTML iframe, the HTTP response header must not contain "X-Frame-Options: DENY". Change the Grafana configuration (default: /etc/grafana/grafana.ini) the following value:
allow_embedding = true
Restart Grafana afterwards:
systemctl restart grafana-server.service
Authentication token
The dynamic setup of the Grafana data source, dashboard and panel requires an administrative API token. You can generate one in the Grafana admin interface in "Administration" -> "Users and access" -> "Service accounts". Pick an existing service account or create a new one with role "Admin". Add a service account token. The token is only required during setup and can be removed afterwards.
OS4X configuration
Navigate to "Configuration" -> "Grafana" to setup the integration:
