Install and configure Icinga2 with IcingaWeb2

This is everything you need to get Icinga2 and IcingaWeb2 up and running with the basic configuration.

1 – Setup Icinga 2

1.1 – Add the Icinga repository:

In Debian:

In Ubuntu:

1.2 – Install necessary packets

1.3 – Configure syntax highlighting for Vim

Look for the line containing:

and uncomment it:

2 – Setup IcingaWeb2

2.1 – Install necessary packets

2.2 – Install the IDO modules for MySQL

Select <Yes> when prompted with:

ido-mysqlSelect <Yes> when prompted with:

id-database2.3 – Setup Icinga MySQL database

2.4 – Import the Icinga 2 IDO schema

2.5 – Enable the IDO MySQL feature

2.6 – Enable the external Command Pipe feature

This is necessary so Icinga can receive commands from plugins and web interfaces

Check that the modules were enabled:

The output should look like this:

Restart Icinga 2

By default the command pipe file is owned by the group nagios with read/write permissions. Add your webserver’s user to the group nagios to enable sending commands to Icinga 2 through your web interface:

2.7 – Install Icinga Web 2

2.8 – Prepare the Web Setup

When using the web setup you are required to authenticate using a token.

Generate the token:

In case you forget the token:

2.9 – Icinga Web Setup

Save the output to /etc/apache2/sites-available/001-icingaweb2.conf

Enable the virtualhost:

Restart apache:

Create the icingaweb2 group (if it does not exist)

Add the web server’s user to the system group icingaweb2 and restart the web server:

Setup IcingaWeb2 MySQL database


Go to http://yourserverurl/icingaweb2

  • In the Authentication window select Database as Authentication Type. Click Next.
  • In the Database Resource window fill out the fields with the data from the step 2.3 – Setup Icinga MySQL database. Click Next.
  • In the Database Setup window use the MySQL root credentials. Click Next.
  • In the Authentication Backend window define a Backend Name. We will use icingaweb2_authentication. Click Next.
  • In the Administration window create the administrator account for Icinga Web 2. Click Next.
  • In the Application Configuration window you can leave it as default. Click Next.
  • Clic Next until you get to the Monitoring Backend window and in the Backend Name field, type icingaweb2_monitoring. Click Next.
  • In the Monitoring IDO Resource window, use the credentials created in the step 2.2 – Install the IDO modules for MySQL. Validate the configuration and if everything is successfull clic Next.
  • In the Command Transport window, click Next.
  • In the Monitoring Security window, click Next.
  • And then click Finish.Now you should be able to log into your Icinga Web 2 interface with the administrator account created previously.

Leave a Reply