InfluxDB als Docker Container für Icinga2 einrichten


InfluxDB


docker exec -it INFLUXDB bash
root@influxdb:/#


influx
influx -username icinga_dat -password '' -database icinga
Connected to http://localhost:8086 version 1.7.10
InfluxDB shell version: 1.7.10
CREATE USER authentication WITH PASSWORD 'S3cur3b1t' WITH ALL PRIVILEGES

create database icinga;
use icinga;
CREATE USER icinga_dat WITH PASSWORD 'Z2K45GNVRDz9tad';
grant all on icinga to icinga_dat;




Icinga


icinga2 feature enable influxdb
nano /etc/icinga2/features-enabled/influxdb.conf
/**
* The InfluxdbWriter type writes check result metrics and
* performance data to an InfluxDB HTTP API
*/

object InfluxdbWriter "influxdb" {
host = "194.50.99.92"
port = 8086
database = "icinga"
username = "icinga_dat"
password = "Z2K45GNVRDz9tad"
enable_send_thresholds = true
enable_send_metadata = true
flush_threshold = 1024
flush_interval = 10s
host_template = {
measurement = "$host.check_command$"
tags = {
hostname = "$host.name$"
}
}
service_template = {
measurement = "$service.check_command$"
tags = {
hostname = "$host.name$"
service = "$service.name$"
}
}
}