Install Icinga2 and Icinga2Web in 10min

For more information how to configure Icinga2 please have a look at my 101.

Problem

  • Install Icinga2 and IcingaWeb2

Setting

  • Ubuntu Server 14.04.3

Basic Installation

Please note: Included in the instructions are password placeholders %BLABLA_PASSWORD% which have to be replaced and are referenced later in the setup.

sudo apt-get update && sudo apt-get upgrade -y
sudo add-apt-repository ppa:formorer/icinga
# Press enter
sudo apt-get update
sudo apt-get install mysql-server apache2 php5 php5-mysql imagemagick php5-imagick php5-gd php5-intl git -y
# Provide (twice) MySQL Password %MYSQLROOT%
sudo apt-get install icinga2 icinga2-ido-mysql -y
# Answer yes
# Answer yes
# Provide (twice) icinga-ido-mysql password %MYSQLIDO%
sudo icinga2 feature enable ido-mysql
sudo icinga2 feature enable command
sudo /etc/init.d/icinga2 restart
sudo usermod -a -G nagios www-data
mkdir icinga2web2_install
cd icinga2web2_install
git clone git://git.icinga.org/icingaweb2.git
sudo mv icingaweb2 /usr/share/icingaweb2
/usr/share/icingaweb2/bin/icingacli setup config webserver apache --document-root /usr/share/icingaweb2/public > icingaweb2.conf
sudo mv icingaweb2.conf /etc/apache2/sites-available/icingaweb2.conf
sudo chown root:root /etc/apache2/sites-available/icingaweb2.conf
sudo a2ensite icingaweb2.conf
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart
sudo addgroup --system icingaweb2
sudo usermod -a -G icingaweb2 www-data
mysql_secure_installation
# %MYSQLROOT%
# Answer n
# Answer Y
# Answer Y
# Answer Y
# Answer Y

Config Timezone and Database

mysql -u root -p
GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, 
EXECUTE ON icinga2idomysql.* TO 'icingaweb'@'localhost'
IDENTIFIED BY '%ICINGA2IDODBPSW%'; 
CREATE DATABASE icingaweb;
GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, 
EXECUTE ON icingaweb.* TO 'icingaweb'@'localhost' 
IDENTIFIED BY '%ICINGAWEBDBPSW%'; 
FLUSH PRIVILEGES;
quit

Configure timezone in php.ini:

sudo nano /etc/php5/apache2/php.ini

Search for timezone and change ;date.timezone = to data.timezone = “Europe/Berlin” (or yours)

Restart and Token

sudo service mysql restart
sudo service apache2 restart
sudo service icinga2 restart

sudo /usr/share/icingaweb2/bin/icingacli setup config directory --group icingaweb2;
sudo /usr/share/icingaweb2/bin/icingacli setup token create;

Setup in Browser

1. Token
Open http://localhost/icingaweb2/setup in your browser (maybe change to your IP) and paste the token you generated with the last command:
icinga2_browser_1_token
2. Choose modules
icinga2_browser_2_modules
3. Requirements
The requirements should be ok
4. Authentication
We use database here:
icinga2_browser_3_auth
5. Database Resource
Provide %ICINGAWEBDBPSW%:
icinga2_browser_4_database
6. Schema
Provide %MYSQLROOT%:
icinga2_browser_5_schema
7. Authentication Backend
Type icingaweb (not icingaweb2):
icinga2_browser_6_auth_backend
8. Admin User
Set admin user and credentials:
icinga2_browser_7_admin_user
9. Push Next
10. Push Next
11. Push Next
12. Push Next
13. IDO Resource
Provide %ICINGA2IDODBPSW%
icinga2_browser_9_ido_resource
14. Push Next
15. Push Next
16. Finish

Fin

Advertisements

2 thoughts on “Install Icinga2 and Icinga2Web in 10min

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s