Installing Icinga2 on Ubuntu

From SOWNWiki
Jump to: navigation, search

logo-yellow.png

Work in Progress
This page is a work in progress.

Installation of a Icinga2 and migration from Icinga1 is yet to be completed so this documentation is incomplete is subject to revision.

Here are the steps used to install Icinga2 on a new Ubuntu 16.04 LTS VM and get it working with SOWN existing config and config generators. This guide is based around the instructions for installing Icinga2 at http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/getting-started

Installing Icinga2

  • Add the Icinga2 package repository to APT and install required packages. When prompted use a consistent password my MySQL-related setup.
add-apt-repository ppa:formorer/icinga
apt-get update
apt-get install icinga2 vim-icinga2 mysql-server mysql-client icinga2-ido-mysql


  • Enable MySQL IDO feature for Icinga and restart
icinga2 feature enable ido-mysql
service icinga2 restart


Installing IcingaWeb2

  • Install Apache2 and its Radius authentication module
apt-get install apache2 libapache2-mod-auth-radius php php-gd php-intl php-imagick php-xml php-mysql libzend-framework-php php-zend-db libapache2-mod-php 


  • Edit /etc/php/7.0/apache2/php.ini and uncomment date.timezone and set to Europe/London.
date.timezone = "Europe/London"


  • Create folder and git clone latest version of Icinga2 Web
cd /usr/share/icingaweb2 
git clone -b "v2.3.4" https://github.com/Icinga/icingaweb2.git .


  • Configure the directory and create a token for use installing IcingaWeb2 and note down the token created:
/usr/share/icingaweb2/bin/icingacli setup config directory
/usr/share/icingaweb2/bin/icingacli setup token create

  • Deploy Apache config for IcingaWeb2 and enable it along with the Rewrite module:
/usr/share/icingaweb2/bin/icingacli setup config webserver apache --document-root /usr/share/icingaweb2/public > /etc/apache2/conf-available/icingaweb2.conf
a2enconf icingaweb2
a2enmod rewrite


  • Add icingaweb2 group and add www-data to use this group before restarting Apache2:
addgroup --system icingaweb2
usermod -a -G icingaweb2 www-data
service apache2 restart


  • Create separate database for IcinagWeb2
mysql -u root -p
CREATE DATABASE icingaweb2;
GRANT ALL ON icingaweb2.* TO 'icinga2'@'localhost'


  • Create a logging folder and make it writeable my www-data'
mkdir  /var/log/icingaweb2
chown www-data /var/log/icingaweb2


  • Access http://HOSTNAME/icingaweb2/setup and follow on-screen instructions.
    • Enter the token generatef by icingacli command earlier.
    • On the next page that describes modules and settings that need to be enabled all boxes should appear green, except for a few in yellow, (PostgreSQL and LDAP). If this is the case then click Next otherwise install the PHP APT packages still required.
    • For Type of Authentication choose Database
    • For Database Connection options ue:
      • Resource Name: icingaweb_db
      • Database Type: MySQL
      • Host: localhost
      • Port: 3306
      • Database Name: icingaweb2
      • User: icinga2
      • Password: AS USED ABOVE
      • Character Set: utf8
      • Persistent: leave unchecked
    • Set Authentication Backend name to icingaweb2db
    • For Administration use the username sown' and use the committee password.
    • For Application Configuration' leave Show Stacktraces checked and User Preference Storage as Database. Set Logging Type to Warning and leave the File path as /var/log/icingaweb2/icingaweb2.log
    • For Monitoring Backend leave the Backend Name as icinga and the Backend Type as IDO.
    • For Monitoring IDO Resource set the following options:
      • Resource Name: icinga_ido
      • Database Type: MySQL
      • Host: localhost
      • Port: 3306
      • Database Name: icinga2
      • User: icinga2
      • Password: AS USED ABOVE
      • Character Set: utf8
      • Persistent: leave unchecked
    • Leave Command Transport options the same as:
      • Transport Name: icinga2
      • Transport Type: Local Command File
      • Command File: /var/run/icinga2/cmd/icinga2.cmd
    • For Monitoring Security leave Protected Custom Variables as *pw*,*pass*,community



Migration from Icinga1

TO BE WRITTEN

Has reasonInstallation of a Icinga2 and migration from Icinga1 is yet to be completed so this documentation is incomplete is subject to revision. +