Grafana

Grafana is an open-source, general purpose dashboard and graph composer, which runs as a web application. It supports graphite, InfluxDB, Prometheus or opentsdb as backends.

Installation

Install the grafana package.

After that you can enable and start grafana.service and access the application on localhost, e.g.: http://127.0.0.1:3000 . The default username is admin and password admin to access the web frontend.

Warning: The default configuration listens on *:3000 so make sure to change the configuration or enable the relevant firewall rules.

Example usage

Influxdb installation

One often used backend is InfluxDB. Enable and start influxdb.service. The web interface is available at http://localhost:8086/

Aggregate data

In case of scaleable server monitoring in combination with Grafana and InfluxDB, one could choose software like collectdAUR. More generally any measurement data can be aggregated with InfluxDB and displayed with Grafana. There are modules and libraries for several programming languages to interact with InfluxDB and one could even store data with a simple http post command using the program curl.

Herefore, create a database named :

$ curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE example"

Post data into the database:

$ curl -i -XPOST 'http://localhost:8086/write?db=example' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000'

Creating Grafana dashboard

  • Before creating a dashboard, we have to add a data source. So first click on in the left menu and then on .
  • Name can be something like influxdb and the type should be set to InfluxDB 0.9. In this example, the url for the Http settings is . Note that the port is not the same as the one of the web interface! Database name corresponds to the one earlier chosen, e.g. . If not changed, username and password are .
  • Click on to see everything is working and then on .
  • Next, back at the front page, click in the left-upper corner and then on New.
  • Now this might be a bit counter-intuitive, but to add a new dashboard you have to hover and click over the little green box on the left side and then, for example, choose: and .
  • Click on the title of the new graph and select .
  • In the graph settings in Metrics choose influxdb as data source in the lower-right corner.
  • Create a query by selecting your aggregated data. Click on which is located beside . In the dropdown menu should appear a list of "tables" in your database, e.g. the table named . If no suggestions comes up, your connection to InfluxDB might be broken or no data has been aggregated yet.
  • Beside the bold text click on and choose for example the measurement data .
  • To save changes, click , then the floppy disc icon.
gollark: I roll to create an apiolectromagnetic field with a direction perpendicular to the line between the centre of the apiopyroform swarm and me, then.
gollark: Well, if they can't be controlled, obviously they do nothing whatsoever because they have no control system.
gollark: I use HTCPCP, then.
gollark: ++roll d20
gollark: I rederive BCPL (the bee control programming language) to take over the apiopyroforms.
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.