Keywords: Supervision, Icinga, Nagios, Linux

2.10. Upgrading (to) Icinga
Prev | Chapter 2. Getting Started | Next

## 2.10. Upgrading (to) Icinga

| Note
Starting with 1.8, you will find newly added config options in version diffed config files in `sample-config/updates/` as well as `module/idoutils/config/updates`, e.g. `cgi.cfg_added_1.7_to_1.8.cfg`. On the core, unknown macros are not left on the output anymore, logging a warning instead. Either fix your config (i.e. wrong macros, escape dollar signs with another one) or set keep_unknown_macros=1 in icinga.cfg to revert to the old behaviour. The Classic UI has removed the WAP interface (statuswml.cgi) as well as 3D statusmap (statuswrl.cgi) not being actively developed and used anymore. Due to that change, the host configuration attributes "vrml_image" and "3dcoords" have been deprecated on the Core as well. Please have a look at the section "CHANGES" in the `changelog` as well.

| Note
If you are using IDOUtils then you have to update it, too. Please take a look at upgrading_idoutils as well.

| Note
If you are using Icinga Web then you have to update it, too. Please take a look at upgrading_icingaweb as well.

| Note
Starting with 1.9, the directive `event_profiling_enabled` in `icinga.cfg` is deprecated.

### 2.10.1. Upgrading from previous Icinga Releases

During development there may be cases where the handling of bugfixes might touch the userspace. We try to avoid this as far as possible but sometimes it is inevitable.

Normal Icinga update Path

If there's a new Icinga version available on https://www.icinga.org/ you should consider updating. Newer versions contain bugfixes, minor or major, which makes it even more important to get the latest and the greatest. If you already installed Icinga using the quickstart guides it's rather easy to install newer versions. It's also possible to perform that without root privileges by doing an install from source. It highly depends on your likings.

Make sure you'll have a safe backup of your Icinga installation and configs. If anything goes wrong you can restore your old setup rather easy.

Regular updates of Icinga are possible just by re-installing Icinga. Please keep in mind that `configure` requires the same parameters as before - look it up in `config.log` and store that in a safe location.

Become the icinga user. Debian/Ubuntu users might use `sudo -s icinga`.

     $> su -l icinga

Get the latest Icinga version from https://www.icinga.org/ and extract it. Then run configure like you did with the old version.

     #> ./configure --with-command-group=icinga-cmd

| Note
Starting with Icinga 1.9 the default has changed so you might have to disable the compilation of IDOUtils explicitly.
     #> ./configure --with-command-group=icinga-cmd --disable-idoutils

Compile the source.

     #> make all

Please make sure that you don't overwrite your configs - always make a backup! Don't use `make install-config` and/or `make install-webconf` and/or `make install-webconf-auth`if you want to manually diff the config files.

     #> make install install-base install-cgis install-html install-init \
        install-commandmode install-idoutils

or decide what you want to upgrade by just typing 'make' which shows all available options. Check your config and restart Icinga.

     #> /etc/init.d/icinga checkconfig
     #> /etc/init.d/icinga restart

That's it!

Icinga 0.8.0 to Icinga 1.13

Archived Logfilename

There was a small misspelling bug in Icinga 0.8.0 resulting in archived logfile names beginning with a capital "I" like in 'Icinga-$date'". This was fixed in version 0.8.1. and newer.

If you experience this problem then please use the following script to fix the file names

     #> cd /usr/local/icinga/var/archives

     for oldfilename in `find ./ -name "Icinga-*"`
     do
       newfilename=`echo $oldfilename | sed -e 's/Icinga/icinga/g'`
       mv $oldfilename $newfilename
     done

Upgrading to Apache 2.4

Starting with Apache 2.4 the default web configuration folder changed from `/etc/apache2/conf.d` to `/etc/apache2/conf-available`. If you want to migrate then just move the file(s), enable the configuration(s) and reload the web server:

    #> mv /etc/apache2/conf.d/icinga*.conf /etc/apache2/conf-available
    #> a2enconf icinga icinga-web
    #> service apache2 reload

| Note
Following `a2enconf` you have to specify the configuration. The example assumes that you have installed both Icinga Classic UI and Icinga Web.

You have to enable the CGI module as well

    #> a2emod cgi

### 2.10.2. Upgrading from Nagios 3.x Releases

We try to be compatible with the configuration files of the current Nagios 3.x versions so there should be very little you have to do to "upgrade" from Nagios 3.x to Icinga 1.13. Assuming you've already installed Nagios from source code as described in the Nagios quickstart guide, you can install Icinga quite easily.

If you are upgrading from Nagios 3.0.x you might need to install PHP:

Debian / Ubuntu

     #> apt-get install php5 libapache2-mod-php5

Fedora / RedHat

     #> yum install php mod_php

openSuSE / SLES

Use Yast to install the packages php5 and apache2-mod_php5 or use zypper

     #> zypper install php5 apache2-mod_php5

Make sure you have a good backup of your existing Nagios installation and configuration files. If anything goes wrong or doesn't work, this will allow you to rollback to your old version.

Please install Icinga according to the quickstart guide. Please note that

- the default prefix has changed to "/usr/local/icinga"

- the environment macros start with ICINGA_

  PNP4Nagios is aware of that since 0.6rc1 (2009.09.20) but the macros are needed in "sync" mode only.

  check_multi includes support since v0.21 (2010.06.03), but you have to rerun the installation using '`configure --with-nagios_name=icinga`' so that check_multi contains the correct values. You can use the option "-s" instead to set certain values.

- the configuration file names of the (enhanced) IDOUtils are named `idomod.cfg/ido2db.cfg` instead of `ndomod.cfg/ndo2db.cfg`

Become the icinga user. Debian/Ubuntu users might use `sudo -s icinga`.

     $ su -l nagios

Get the latest Icinga version from https://www.icinga.org/

     #> wget https://github.com/Icinga/icinga-core/releases/download/v1.13/icinga-1.13.tar.gz

Extract the tarball and change to the directory just created

     #> tar xzf icinga-1.13.tar.gz
     #> cd icinga-1.13

Start the Icinga-configure-script with the options you used the last time with Nagios. You'll find the call in the file config.log. Example:

     #> ./configure --with-command-group=nagcmd

Compile the Icinga source code.

     #> make all

Install the programs, documentation, classic web interface and the init script. Your existing config files will not be overwritten.

     #> make cgis
     #> make install
     #> make install-cgis
     #> make install-init

or simply

     #> make fullinstall

| Important
Not till Icinga 1.5.0 `make install-config` is NOT included in `make fullinstall` anymore to avoid accidental overwriting of your config files.

Instead of using "`make install-config`" copy your configuration files from `<Nagios-path>/etc/` to `<Icinga-path>/etc/`. Before starting Icinga you have to alter some things:

- The filename of the main config file has changed from `nagios.cfg` to `icinga.cfg`. `#> mv nagios.cfg icinga.cfg` should be sufficient to change that

- You have to edit the main config file (`icinga.cfg`) to change the directives named "nagios_user" and "nagios_group" to "icinga_user" and "icinga_group" respectively. Depending on the paths you're using you may have to change them as well.

       #> sed -i 's/nagios/icinga/g' ./icinga.cfg/

- You have to edit the CGI config file (`cgi.cfg`) to change the paths you're using.

       #> sed -i 's/nagios/icinga/g' ./cgi.cfg/

Copy other relevant files from your Nagios installation to the new location. If you are unsure about the path then please have a look at `nagios.cfg` and/or `icinga.cfg`.

- `retention.dat` (it contains certain status information, comments and other "sticky" stuff)

- `nagios.log` (rename it to `icinga.log`)

- `archives/nagios-<date>.log` files (Icinga is able to process both nagios-<date>.log and icinga-<date>.log files so you don't have to rename the files)

- You don't have to copy `status.dat` and/or `objects.cache` because these files are recreated during startup. Please recreate `objects.precache` before startup if applicable instead of copying it

Verify your configuration files, correct errors (if any) and start Icinga.

     #> /usr/local/icinga/bin/icinga -v /usr/local/icinga/etc/icinga.cfg
     #> /etc/init.d/icinga start

That's it - you're done!

Please keep in mind that

- the URL has changed to http://localhost/icinga/ (for the classic UI)

- the name of the admin user has changed to icingaadmin

### 2.10.3. Upgrading from Nagios 2.x Releases

It shouldn't be too difficult to upgrade from Nagios 2.x to Icinga 1.13. The upgrade is essentially the same as what is described above for upgrading from Nagios 3.x releases. You will, however, have to change your configuration files a bit so they work with Icinga 1.13:

- The old service_reaper_frequency variable in the main config file has been renamed to check_result_reaper_frequency.

- The old $NOTIFICATIONNUMBER$ macro has been deprecated in favour of new $HOSTNOTIFICATIONNUMBER$ and $SERVICENOTIFICATIONNUMBER$ macros.

- The old parallelize directive in service definitions is now deprecated and no longer used, as all service checks are run in parallel.

- The old aggregate_status_updates option has been removed. All status file updates are now aggregated at a minimum interval of 1 second.

- Extended host and extended service definitions have been deprecated. They are still read and processed by Icinga, but it is recommended that you move the directives found in these definitions to your host and service definitions, respectively.

- The old downtime_file file variable in the main config file is no longer supported, as scheduled downtime entries are now saved in the retention file. To preserve existing downtime entries, stop Nagios 2.x and append the contents of your old downtime file to the retention file.

- The old comment_file file variable in the main config file is no longer supported, as comments are now saved in the retention file. To preserve existing comments, stop Nagios 2.x and append the contents of your old comment file to the retention file.

Also make sure to read the "What's New" section of the documentation. It describes all the changes that were made to the Icinga code since the latest stable release of Nagios 3.0.6. Quite a bit has changed, so make sure you read it over.

### 2.10.4. Upgrading from an RPM Installation

If you currently have an RPM- or Debian/Ubuntu APT package-based installation of Nagios and you would like to transition to installing Icinga from the official source code distribution, here's the basic process you should follow:

1. Backup your existing Nagios installation

   - Configuration files

     - Main config file (usually `nagios.cfg`)

     - Resource config file (usually `resource.cfg`)

     - CGI config file (usually `cgi.cfg`)

     - All your object definition files

   - Retention file (usually `retention.dat`)

   - Current Nagios log file (usually `nagios.log`)

   - Archived Nagios log files (usually `nagios-<date>.log`)

2. Uninstall the original RPM or APT package

3. Install Icinga from source by following the quickstart guide

4. Restore your original Nagios configuration files, retention file, and log files

5. Verify your configuration and start Icinga

Note that different RPMs or APT packages may install Icinga in different ways and in different locations. Make sure you've backed up all your critical Nagios files before removing the original RPM or APT package, so you can revert back if you encounter problems.

Prev | Up | Next
2.9. Links to other published Howtos | Home | 2.11. Upgrading IDOUtils Database

© 1999-2009 Ethan Galstad, 2009-2015 Icinga Development Team, http://www.icinga.org