In our previous tutorial, we have installed
icinga2. Today we are going to install
icinga2 director, to make configuring the whole thing less painful.
In our last tutorial regarding icinga, we have created a database already. However, we are going to create a new user for the director, since this one can actually configure things. I advise to select an extra strong password here. So, create a new database for configuration and a new user with SQL by calling
mysql -u root -p:
CREATE DATABASE icinga2director CHARACTER SET 'utf8'; GRANT ALL ON icinga2director.* TO 'director'@'localhost' iDENTIFIED BY 'password';
Download the current release of icinga2 director from GitHub and unpack it to
/usr/share/icinga2web/modules. When you unpack it, it creates a directory with a version number. Since you need to use this name in configuration and what have you, consider renaming it to just
director. After that, we need to tell icinga2 to enable the module. Here are the bash commands to do it:
wget https://github.com/Icinga/icingaweb2-module-director/archive/v1.6.2.tar.gz tar -C /usr/share/icinga2web/modules/v1.6.2.tar.gz mv /usr/share/icingaweb2/modules/icingaweb2-module-director-1.6.2 /usr/share/icingaweb2/modules/director icingacli module enable director
Time to configure this bad boy. Open
/etc/icingaweb2/resources.ini in your favourite editor and add this block. Remember to change the usernames and passwords to what you have configured previously:
[icinga_director] type = "db" db = "mysql" host = "localhost" port = "" dbname = "icinga2director" username = "director" password = "password" charset = "" use_ssl = "0"
This basically creates a new resource within icinga2web, which we can use to give director access to their database. Go to the web interface now and you should see an entry called director. Select it and you will be asked which database to use. Use
icinga_director, which is the block above this paragraph. Director will ask for a few more things, that are self explanatory. One thing I had to look up is “End Point”. By that, they mean the machine icinga2 itself is running on. This isn’t always the same computer. But if you have installed everything on the same machine, then you can simply enter the loopback address or, since we are on CentOS, whatever you have put into
/etc/hostname, which is hopefully a descriptive name. In my case, it was