Difference between revisions of "Cool Solution - Grafana"
From Univention Wiki
Line 46: | Line 46: | ||
<pre> | <pre> | ||
− | ucr set security/packetfilter/tcp/3000/all=ACCEPT | + | ucr set security/packetfilter/tcp/3000/all=ACCEPT \ |
− | + | security/packetfilter/tcp/3000/all/en="Grafana" | |
</pre> | </pre> | ||
Revision as of 12:47, 1 December 2017
Note: Cool Solutions are articles documenting additional functionality based on Univention products.
Not all of the shown steps in the article are covered by Univention Support. For questions about your support coverage contact your contact person at Univention before you want to implement one of the shown steps.
Grafana offers an open source dashboards for visualizing your data. It can be used, for example, for visualizing data from ElasticSearch.
Contents
Installation
Set the Repository
Add the Grafana GPG Key
wget -qO - https://packagecloud.io/gpg.key | sudo apt-key add -
Add the repository
echo "deb https://packagecloud.io/grafana/stable/debian/ jessie main" | tee -a /etc/apt/sources.list.d/elastic-5.x.list
Install Grafana
Install Grafana using apt
apt-get update && apt-get install grafana
Start Grafana and add it to the autostart list,
systemctl daemon-reload systemctl start grafana-server systemctl enable grafana-server.service
Open the Firewall
The user can reach Grafana by default using the port 3000. This port has to be opened in the firewall using the following ucr command
ucr set security/packetfilter/tcp/3000/all=ACCEPT \ security/packetfilter/tcp/3000/all/en="Grafana"
Restart the univention Firewall
systemctl restart univention-firewall
Configure Grafana
Grafana utilizes multiple plugins to import and visualize data. Navigate your web browser to
http://<ip of your server>:3000
The default username is admin and the password likewise is admin
ElasticSearch
Please ensure, that you have configured not only ElasticSearch but also, that you have already collected Data in the Database.
During the configuration, you will be asked to configure a Datasearch. Here you can select ElasticSearch. If you followed our guide, than select the URL http://localhost:9200 and set Access to proxy
The index in our example is composed out of the [logstash-info]-YYYY.MM.DD. For the Pattern select Daily. Leave the Time field name and select version 5.x. Most beats for ElasticSearch write every minute. Thus 1m in Min interval should be sufficient. If you are monitoring some servers more frequently, you might want to change it to something different, e.g., 10s.
Dashboard
Depending on how much data you have in your database, you might need to wait a couple of minutes before you can start creating a new Dashboard. To create a dashboard merely select the desired components and drag them into the Dashboard.