Icinga2 mit Grafana und Influxdb: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 63: | Zeile 63: | ||
*icingacli module enable grafana | *icingacli module enable grafana | ||
*systemctl restart icinga2.service | *systemctl restart icinga2.service | ||
| + | |||
| + | ==Configuration== | ||
| + | *vim /etc/icingaweb2/modules/grafana/config.ini | ||
| + | <pre> | ||
| + | [grafana] | ||
| + | username = "your grafana username" | ||
| + | host = "hostname:3000" | ||
| + | protocol = "https" | ||
| + | password = "123456" | ||
| + | height = "280" | ||
| + | width = "640" | ||
| + | timerange = "3h" | ||
| + | enableLink = "yes" | ||
| + | defaultdashboard = "icinga2-default" | ||
| + | datasource = "influxdb" | ||
| + | defaultdashboardstore = "db" | ||
| + | accessmode = "proxy" | ||
| + | timeout = "5" | ||
| + | directrefresh = "no" | ||
| + | </pre> | ||
Version vom 2. Mai 2017, 14:48 Uhr
Vorraussetzungen
InfluxDB
- apt-get install influxdb influxdb-client
root@localhost:~# influx Connected to http://localhost:8086 version 0.13.0 InfluxDB shell version: 0.13.0 > create database icinga2; > create user icinga2 with password ‘geheim’; > grant all on icinga2 to icinga2;
- vi /etc/icinga2/features-enabled/influxdb.conf
object InfluxdbWriter "influxdb" {
host = "127.0.0.1"
port = 8086
database = "icinga2"
username = "icinga2"
password = "geheim"
enable_send_thresholds = true
enable_send_metadata = true
host_template = {
measurement = “$host.check_command$”
tags = {
hostname = “$host.name$”
}
}
service_template = {
measurement = “$service.check_command$”
tags = {
hostname = “$host.name$”
service = “$service.name$”
}
}
}
Feature enabled
- icinga2 feature enable influxdb
- systemctl restart icinga2.service
Grafana
Installation
- cat <<EOF >/etc/apt/sources.list.d/grafana.list
- > deb https://packagecloud.io/grafana/stable/debian/ wheezy main
- > EOF
- curl -s https://packagecloud.io/gpg.key | sudo apt-key add -
- apt-get update
- apt-get install grafana
- systemctl start grafana-server
Module hinzufügen
- cd /usr/share/icingaweb2/modules
- git clone https://github.com/Mikesch-mp/icingaweb2-module-grafana.git grafana
Module enabled
- icingacli module enable grafana
- systemctl restart icinga2.service
Configuration
- vim /etc/icingaweb2/modules/grafana/config.ini
[grafana] username = "your grafana username" host = "hostname:3000" protocol = "https" password = "123456" height = "280" width = "640" timerange = "3h" enableLink = "yes" defaultdashboard = "icinga2-default" datasource = "influxdb" defaultdashboardstore = "db" accessmode = "proxy" timeout = "5" directrefresh = "no"