Skip to content

Install Icinga 2 on Raspbian

Add Icinga Package Repository

We recommend using our official repositories. Here’s how to add it to your system:

Raspbian Repository

apt update
apt -y install apt-transport-https wget gnupg

wget -O - https://packages.icinga.com/icinga.key | gpg --dearmor -o /usr/share/keyrings/icinga-archive-keyring.gpg

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

apt update

Install Icinga 2

You can install Icinga 2 by using your distribution’s package manager to install the icinga2 package. The following commands must be executed with root permissions unless noted otherwise.

apt install icinga2

Systemd Service

The majority of supported distributions use systemd. The Icinga 2 packages automatically install the necessary systemd unit files.

If you’re stuck with configuration errors, you can manually invoke the configuration validation.

icinga2 daemon -C

Tip

If you are running into fork errors with systemd enabled distributions, please check the troubleshooting chapter.

Set up Check Plugins

Without plugins Icinga 2 does not know how to check external services. The Monitoring Plugins Project provides an extensive set of plugins which can be used with Icinga 2 to check whether services are working properly.

These plugins are required to make the example configuration work out-of-the-box.

Depending on which directory your plugins are installed into you may need to update the global PluginDir constant in your Icinga 2 configuration. This constant is used by the check command definitions contained in the Icinga Template Library to determine where to find the plugin binaries.

Tip

Please refer to the service monitoring chapter for details about how to integrate additional check plugins into your Icinga 2 setup.

apt install monitoring-plugins

Set up Icinga 2 API

Almost every Icinga 2 setup requires the Icinga 2 API as Icinga Web connects to it, Icinga DB requires it, and it enables cluster communication functionality for highly available and distributed setups.

Info

If you set up a highly available and/or distributed Icinga monitoring environment, please read the Distributed Monitoring chapter as the commands to set up the API are different from setting up a single node setup.

See the API chapter for details, or follow the steps below to set up the API quickly:

Run the following command to:

  • enable the api feature,
  • set up certificates, and
  • add the API user root with an auto-generated password in the configuration file /etc/icinga2/conf.d/api-users.conf.
icinga2 api setup

Restart Icinga 2 for these changes to take effect.

systemctl restart icinga2

Backup

Ensure to include the following in your backups:

  • Configuration files in /etc/icinga2
  • Certificate files in /var/lib/icinga2/ca (Master CA key pair) and /var/lib/icinga2/certs (node certificates)
  • Runtime files in /var/lib/icinga2