How To Setup Icinga Web 2 on CentOS 7 / RHEL 7
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
- Local Command File
- Icinga 2 API (Recommended)
- Remote Command File
Local Command File
![Setup Icinga Web 2 on CentOS 7 - Icinga Command File Transport](https://www.itzgeek.com/wp-content/uploads/2018/02/Setup-Icinga-Web-2-on-CentOS-7-Icinga-Command-File-Transport-1024x446.jpg)
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](https://www.itzgeek.com/wp-content/uploads/2018/02/Setup-Icinga-Web-2-on-CentOS-7-Icinga-2-API-Command-Transport-1024x559.jpg)
Enter the variables information to protect from bad ones.
![Setup Icinga Web 2 on CentOS 7 - Protect Custom Variables](https://www.itzgeek.com/wp-content/uploads/2018/02/Setup-Icinga-Web-2-on-CentOS-7-Protect-Custom-Variables-1024x385.jpg)
Review your monitoring configurations.
![Setup Icinga Web 2 on CentOS 7 - Review Monitoring Module Settings](https://www.itzgeek.com/wp-content/uploads/2018/02/Setup-Icinga-Web-2-on-CentOS-7-Review-Monitoring-Module-Settings-1024x630.jpg)
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](https://www.itzgeek.com/wp-content/uploads/2018/02/Setup-Icinga-Web-2-on-CentOS-7-Icinga-Web-2-Installation-Complete-1024x632.jpg)
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](https://www.itzgeek.com/wp-content/uploads/2018/02/Setup-Icinga-Web-2-on-CentOS-7-Icinga-Web-2-Login-Screen-1024x632.jpg)
You should get the Icinga Web 2 dashboard. Here where Icinga Web 2 reports for problems.
![Setup Icinga Web 2 on CentOS 7 - Icinga Web 2 Dashboard](https://www.itzgeek.com/wp-content/uploads/2018/02/Setup-Icinga-Web-2-on-CentOS-7-Icinga-Web-2-Dashboard-1024x631.jpg)
In our next article, we will add remote Linux clients to Icinga 2.
That’s All.