Open main menu

Extension:Grafana

MediaWiki extensions manual
OOjs UI icon advanced.svg
Grafana
Release status: stable
Grafana Screenshot.png
Implementation Tag
Description Add Grafana panels to MediaWiki pages
Author(s) Felipe Muñoz Brieva (felipe@delegacionprovincial.com)
MediaWiki Tested on 1.24, 1.25
License GPL
Download Download
Check extension
GitHub mediawiki-grafana
Translate the Grafana extension if it is available at translatewiki.net
Check usage and version matrix.

Grafana creates beautiful metrics & analitics dashboards.

IntroductionEdit

Usually people spend a lot of time solving trivial problems and a lot of problems can be solved by end users.

If we join a wiki (Mediawiki) for documentation and a tool (Grafana) for creating dashboards with metrics & analytics we obtain a powerful tool. System administrators can create instructions with panels updated in realtime. (Also you can use Nagvis extension to monitor alarms, warnings, etc.)

Check usageEdit

InstallationEdit

  1. Download the extension (tgz) or (zip).
  2. Upload Grafana directory to your extensions directory from the root of your MediaWiki installation.
  3. Add require_once "$IP/extensions/Grafana/Grafana.php"; to your LocalSettings.php file (near the end).
  4. Done

UsageEdit

To insert a Grafana panel add the tag on any page:

<Grafana showheader=no urlgrafana=http://grafana_server_url dashboard="Dashboard name" panelposition=1>Grafana panel</Grafana>

Tag attributesEdit

The following arguments (tag attributes) can be used to control <Grafana> tags:

MandatoryEdit

showheader (yes/no)
Show a title for the panel and an icon to link Grafana server.
urlgrafana
Grafana url (Extension will check if it's a correct Grafana site)
dashboard
Name of the dashboard in Grafana Server
papelposition
It's the position of the panel in the dashboard (panelposition=1 it's the first panel in row 1).
For example if we have 3 rows (row 1 with 2 panels, row 2 with 1 panel and row 3 with 3 panels)
and we want to select panel 2 in row 3:
panelposition = 5 -> 2 (panels in row 1) + 1 (panels in row 2) + 2 (panel in row 3)

OptionalEdit

var-templatename
Include params for templates, we need to add an argument with the prefix "var-"
and templateparamname. For example to add var $macrolan:
var-macrolan=template_var_value
width
Panel width
height
Panel height
theme
Grafana theme (dark, light, etc.)

ExampleEdit

<Grafana showheader=no width=450 height=200 theme=light urlgrafana=http://yourgrafanaserver.com dashboard="Macrolan" panelposition=2 var-macrolan=macrolan_line>Grafana panel</Grafana>

Screenshots (Examples)Edit

  • Grafana tag with argument showheader=yes



  • Grafana tag with argument showheader=no theme=light:



  • Grafana tag with argument showheader=no:

Notes about authenticationEdit

(See Grafana configuration site)

For a better experience with Grafana extension you need to enable anonymous access in $GRAFANA_WORKING_DIR/conf/defaults.ini

[auth.anonymous]
enabled:  Set to true to enable anonymous access. Defaults to false
org_name: Set the organization name that should be used for anonymous users. If you change your organization name in the Grafana UI this setting needs to be updated to match the new name.
org_role: Specify role for anonymous users. Defaults to Viewer, other valid options are Editor and Admin.

Notes about proxyEdit

If your Grafana Server is behind a proxy you need to enable proxy in $MEDIAWIKI_WORKING_DIR/extensions/Grafana/Grafana.php

  $PROXY_ENABLE        = $YES;                           // $YES/$NO
  $PROXY_HOST          = "proxy_server";                 // Proxy server address
  $PROXY_PORT          = "proxy_port";                   // Proxy server port
  $PROXY_USER          = "user";                         // Username
  $PROXY_PASS          = "password";                     // Password

CreditsEdit

This extension works with the following software:

VersionsEdit

Download

1.00:

Initial release