MirrorNest
← Все руководства

Icinga2

Icinga 2 is a scalable, Nagios-compatible monitoring engine that checks hosts and services, collects performance data, and ships with IcingaDB for storing state in Redis and a SQL database.

Это руководство составлено на основе официальной документации Icinga2, ссылка на которую есть выше — всегда сверяйте точные названия пакетов/версий там перед запуском этих команд на рабочем сервере, так как версии дистрибутива и проекта со временем меняются.
  1. 1Add the official Icinga package repository

    apt update
    apt -y install apt-transport-https wget
    wget -O icinga-archive-keyring.deb "https://packages.icinga.com/icinga-archive-keyring_latest+debian$(. /etc/os-release; echo \"$VERSION_ID\").deb"
    apt install ./icinga-archive-keyring.deb
    DIST=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release); echo "deb [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] https://packages.icinga.com/debian icinga-${DIST} main" > /etc/apt/sources.list.d/${DIST}-icinga.list
    echo "deb-src [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] https://packages.icinga.com/debian icinga-${DIST} main" >> /etc/apt/sources.list.d/${DIST}-icinga.list
    apt update

    All commands must run as root.

  2. 2Install Icinga 2 and the monitoring plugins

    The Monitoring Plugins package provides the actual check binaries Icinga 2's example configuration relies on.

    apt install icinga2
    apt install monitoring-plugins
  3. 3Enable the REST API and IcingaDB feature

    icinga2 api setup
    systemctl restart icinga2
    icinga2 feature enable icingadb
    systemctl restart icinga2
  4. 4Set up Redis for IcingaDB (optional but recommended)

    apt install icingadb-redis
    systemctl enable --now icingadb-redis