How To Setup Icinga Web 2 on CentOS 7 / RHEL 7

0

Setup Command Transport

This page tells how you want to send commands to your monitoring instance.

Icinga Web 2 supports Local Command File, Remote Command File, and Icinga 2 API as a Command Transport. You can define multiple command modes of transport in Icinga Web 2.

Here, for this demo, we will configure Icinga Web 2 with single command transport. Choose either one of the below command transport

  1. Local Command File
  2. Icinga 2 API (Recommended)
  3. Remote Command File

Local Command File

Setup Icinga Web 2 on CentOS 7 - Icinga Command File Transport
Setup Icinga Web 2 on CentOS 7 – Icinga Command File Transport

Icinga 2 API

Run the below command to setup Icinga 2 API.

icinga2 api setup

Output:

information/cli: Generating new CA.
information/base: Writing private key to '/var/lib/icinga2/ca//ca.key'.
information/base: Writing X509 certificate to '/var/lib/icinga2/ca//ca.crt'.
information/cli: Generating new CSR in '/var/lib/icinga2/certs//server.itzgeek.local.csr'.
information/base: Writing private key to '/var/lib/icinga2/certs//server.itzgeek.local.key'.
information/base: Writing certificate signing request to '/var/lib/icinga2/certs//server.itzgeek.local.csr'.
information/cli: Signing CSR with CA and writing certificate to '/var/lib/icinga2/certs//server.itzgeek.local.crt'.
information/pki: Writing certificate to file '/var/lib/icinga2/certs//server.itzgeek.local.crt'.
information/cli: Copying CA certificate to '/var/lib/icinga2/certs//ca.crt'.
information/cli: Adding new ApiUser 'root' in '/etc/icinga2/conf.d/api-users.conf'.
information/cli: Enabling the 'api' feature.
Enabling feature api. Make sure to restart Icinga 2 for these changes to take effect.
information/cli: Updating 'NodeName' constant in '/etc/icinga2/constants.conf'.
information/cli: Created backup file '/etc/icinga2/constants.conf.orig'.
information/cli: Updating 'ZoneName' constant in '/etc/icinga2/constants.conf'.
information/cli: Backup file '/etc/icinga2/constants.conf.orig' already exists. Skipping backup.
Done.

Get the API user details from /etc/icinga2/conf.d/api-users.conf file.

cat /etc/icinga2/conf.d/api-users.conf

Output:

/**
 * The APIUser objects are used for authentication against the API.
 */
object ApiUser "root" {
  password = "68c77520d03cfb84"
  // client_cn = ""

  permissions = [ "*" ]
}

Restart the Icinga 2 service.

systemctl restart icinga2

Use the above username and password on the below command transport page.

Setup Icinga Web 2 on CentOS 7 - Icinga 2 API Command Transport
Setup Icinga Web 2 on CentOS 7 – Icinga 2 API Command Transport

Enter the variables information to protect from bad ones.

Setup Icinga Web 2 on CentOS 7 - Protect Custom Variables
Setup Icinga Web 2 on CentOS 7 – Protect Custom Variables

Review your monitoring configurations.

Setup Icinga Web 2 on CentOS 7 - Review Monitoring Module Settings
Setup Icinga Web 2 on CentOS 7 – Review Monitoring Module Settings

The following page tells you that Icinga Web 2 has been successfully set up.

Setup Icinga Web 2 on CentOS 7 - Icinga Web 2 Installation Complete
Setup Icinga Web 2 on CentOS 7 – Icinga Web 2 Installation Complete

Click on Login to Icinga Web 2.

Access Icinga Web 2

Login to Icinga Web 2 using the admin account we created earlier.

Setup Icinga Web 2 on CentOS 7 - Icinga Web 2 Login Screen
Setup Icinga Web 2 on CentOS 7 – Icinga Web 2 Login Screen

You should get the Icinga Web 2 dashboard. Here where Icinga Web 2 reports for problems.

ADVERTISEMENT

Setup Icinga Web 2 on CentOS 7 - Icinga Web 2 Dashboard
Setup Icinga Web 2 on CentOS 7 – Icinga Web 2 Dashboard

In our next article, we will add remote Linux clients to Icinga 2.

That’s All.

You might also like