In the first part we installed Icinga2 and the Icinga Web 2 dashboard. During the installation the host itself was added to the monitoring. Now it’s time to add another Linux host.

If we take another look at the diagram from part 1, we see that the monitor consist of (at least) one master server and several agent nodes. During the installation part the master role wasn’t set. We do that now.
On the master machine we installed in part 1 we use the following command to designate it as master:

You do not want a satellite setup (which install the node setting). Choose n. Then press [enter] three times. This will generate and store the private key used by the agent to communicate with the nodes.
Restart icinga2 for the changes to be effective.

Install Icinga2 on the node

Before we install the client on another Ubuntu server we must first create a security key on the master. With this key a secure connection is established between the node an the master. We issue a ticket with this command (the CN is the hostname of the new node):

We now proceed with the installation on the new client Ubuntu2.

First we need to install Icinga2. We follow the same instruction for installing Icinga2 from part 1.

After successfully installing Icinga2 we proceed the node setup wizard command:

All we need is the hostname of the node and master (CN) and the IP address of the master. With the security key created on the master (see earlier) we create a connection on the master.

Adding the node to the master

Icinga2 uses configuration files now. The old commands (while still working) like: icinga2 node add are deprecated.
We now add the host to the host.conf file in the conf.d map on the master. But it really doesn’t matter where we put it. Icinga2 will look for any configuration file. Let’s make an Ubuntu host configuration file for clarity. We can use hosts.conf as a starting point. This will be done on the master.

The content for ubuntu-hosts.conf will be:

Where ubuntu2 is the hostname (or FQDN) of the new node. And the address will be the IP-address of the new node. Save this file and restart Icinga2 on the master.

We can see that the host we just added is pending. After a few moments you will see the node is listed in the host monitoring section. Congratulations you’ve just added a Linux node!

If we want to remove a host, we simple delete the ubuntu-hosts.conf file or remove it within the file. Then we restart the Icinga2 deamon again.

In the next part we are going to look at Icinga and Windows Monitoring. We are going to add a Windows node and look in to the benefits of Icinga2 agent-model for Windows.