Icinga 2: Installation (Part 1)

Robin O'Brien
4 min readFeb 19, 2018

--

Welcome to Part 1 of my experience in installing and setting up Icinga 2 for distributed monitoring. Part 2 is available here, and Part 3 is available here.

You build it, you run it.

— Werner Vogels

Prior to having Icinga 2 we struggled to clearly see what was happening within our product’s deployment. We were building the product but we were not running it correctly as we were unaware of downtimes. Enter Icinga 2.

We have been running Icinga 2 for a good 6 months now. We started with Icinga 2 and Icinga Web 2. We slowly added InfluxDB and Grafana. The added transparency over our entire infrastructure has been astounding. We have been able to react much faster to downtime incidents as well as use the historic data stored in InfluxDB and visualised in Grafana to analyse trends and identify potential downtime incidents (full disks, AMQP error queue sizes etc.)

I am writing this guide while attempting to migrate our Icinga 2 instance into AWS EC2. The reason for the move is an unreliable internet connection in our datacenter in Pretoria, South Africa. Downtime and/or high latency on the fibre connection creates false warnings and critical notices for all the infrastructure located in all our datacenters around the world (Johannesburg South Africa, Atlanta US, Frankfurt Germany etc). I plan to capture and share all the steps I go through while creating a new instance, configuring it to match our current setup as well as a post on migrating from an existing instance. I will include information about setting up AQMP monitoring and using Icinga in its Top Down Config Sync approach.

Before we jump right into the installation guide I just want to highlight how great the Icinga 2 documentation is. If, at any point, you are not sure about what I have written please consult the official documentation. I am no expert on the topic but I am glad to assist where I can.

So lets get started.

The server

As mentioned above, we are moving from a self-hosted instance to an instance deployed inside AWS EC2. The server I have created is as follows, but please feel free to choose what ever instance will suit your purposes better.

  • Centos 7
  • t2.Medium
  • 8 GB storage — SSD
  • 40 GB storage — Magnetic

Please ensure you have the correct Security Group assigned and you have a Key Pair used that allows you to gain access to the OS. For now we will just need port 22 open so we can begin the setup. It is a good idea to ensure this port is only accessible to you. This can be done by adjusting the Security Group used. More information on security groups is available here.

From here on the assumption will be made that your instance is a RHEL based system, specifically CentOS and that you are able to SSH onto the box.

First up, as will all fresh operating systems I setup we will just ensure all packages are up-to-date.

$ yum update
$ reboot

Icinga 2 and the EPEL yum repositories

The EPEL repository contains the dependencies for Icinga 2. Icinga 2 itself also makes use of a yum repository for package distribution. We can now add both the EPEL yum repo and the Icinga 2 yum repo.

$ yum install epel-release$ yum install https://packages.icinga.com/epel/icinga-rpm-release-7-latest.noarch.rpm

Installation

We are now ready to do the actual package installation. Since we have added the correct Yum repositories, we are able to use Yum to do the installation. This has the added benefit of being able to just run ‘yum update’ in the future do install the latest versions.

$ yum install icinga2
$ systemctl enable icinga2
$ systemctl start icinga2

We have now successfully installed Icinga 2 and made sure that it will start when ever the OS restarts.

Additional plugins (optional)

Before we conclude part 1 of this series I want to mention the Nagios Plugins. We use them extensively for our checks and they have proven to be very useful. This is an optional step however, I believe it is one thats worth completing. You can read more about the plugins on the GitHub Page.

$ yum install nagios-plugins-all

Extra notes

Just as some extra information, Icinga 2 on Centos 7 makes use of systemd. This means we can interact with Icinga 2 using the standard systemd approach. For example:

$ systemctl start icinga2
$ systemctl stop icinga2
$ systemctl status icinga2

Final thoughts

This concludes part one of the guide. I know its been very brief but it covers all one needs to know to get started with a fresh installation of Icinga 2. Subsequent posts will highlight how to setup your new Icinga 2 instance as well as install and configure the Web UI for Icinga 2. The guides will cover the database setups and user creation etc. I hope to complete those guides as soon as possible. Thanks for reading and I hope you have learnt something new or at least have a feel for how simple the Icinga 2 install is.

Part 2 is available here.

Part 3 is available here.

References

The best reference is the Icinga 2 officail documentation. It can be found here:

https://www.icinga.com/docs/icinga2/latest/doc/02-getting-started/

--

--