# Docker Icinga2 [![Build Status](https://git.ao-it.net/docker/icinga2/actions/workflows/docker-build.yml/badge.svg?branch=main&event=push)](https://git.ao-it.net/docker/icinga2/actions?workflow=docker-build.yml&actor=0&status=0) If you need a full stack: * [AO-IT: icinga-stack](https://git.ao-it.net/docker/icinga-stack) * [AO-IT: icingaweb2](https://git.ao-it.net/docker/icingaweb2) Or a additional satellite: * [AO-IT: icinga-satellite](https://git.ao-it.net/docker/icinga-satellite) ## usage ``` git clone https://git.ao-it.net/docker/icinga2 cd icinga2 cp env.sample .env nano .env # set your env docker compose up ``` Default vars a working but not recommend in prod! Minimum recommended adjustments: * ICINGA2_API_USER_ROOT_PASS * ICINGA2_API_USER_ICINGAWEB_PASS All other var can be use at is, because all is in docker network and not exposed. Hints: * API user setup only runs once at start up! * Redis conf runs every time * DONT Remove ICINGA_API_HOST var! * This var set the hostname for the container. * The hostname is used for icinga2 master setup If you plan to use satellites and wish full auto deployment. Set ICINGA2_API_USER_SATELLITE_PASS to get a API user for ticket generation (only on fist init). Then you can use this: ``` curl -k -s -u pki-ticket:$ICINGA2_API_USER_SATELLITE_PASS -H 'Accept: application/json' \ -X POST 'https://ip-of-icinga2:5665/v1/actions/generate-ticket' -d '{ "cn": "satellite.example.com" }' | jq '.results[0].ticket' ``` see: [CSR Auto-Signing: On the master](https://icinga.com/docs/icinga-2/latest/doc/06-distributed-monitoring/#csr-auto-signing-on-the-master) ## vars var | description | note --- | --- | --- ICINGA_API_HOST:-icinga2 | hostname / cn of icinga2 | ICINGA2_API_USER_ROOT_PASS | replace `root` API user randome password with this | only on first setup ICINGA2_API_USER_ICINGAWEB_PASS | create API user `icingadb` with this password | only on first setup, if not set user will not create ICINGA2_API_USER_SATELLITE_PASS | create API user `pki-ticket` with this password | only on first setup, if not set user will not create ICINGA2_ICINGADB_REDIS_HOST | set redis db host | can set by every startup ICINGA2_ICINGADB_REDIS_PORT | set redis db port | can set by every startup ICINGA2_ICINGADB_REDIS_PASS | set redis db password | usually not required can set by every startup ICINGA2_INFLUXDB_HOST | set influx db host | can set by every startup ICINGA2_INFLUXDB_PORT | set influx db port | can set by every startup ICINGA2_INFLUXDB_DB | set influx db name | can set by every startup