|
| 1 | +<!-- {% if index %} --> |
| 2 | +# Installing Icinga Notifications |
| 3 | + |
| 4 | +The recommended way to install Icinga Notifications is to use prebuilt packages |
| 5 | +for all supported platforms from our official release repository. |
| 6 | +Please follow the steps listed for your target operating system, |
| 7 | +which guide you through setting up the repository and installing Icinga Notifications. |
| 8 | + |
| 9 | +To upgrade an existing Icinga Notifications installation to a newer version, |
| 10 | +see the [Upgrading](04-Upgrading.md) documentation for the necessary steps. |
| 11 | + |
| 12 | +<!-- {% else %} --> |
| 13 | +<!-- {% if not icingaDocs %} --> |
| 14 | +## Installing the Package |
| 15 | + |
| 16 | +The recommended way to install Icinga Notifications is to use prebuilt packages from our official release repository. |
| 17 | +If the [repository](https://packages.icinga.com) is not configured yet, please add it first. |
| 18 | +Then use your distribution's package manager to install the `icinga-notifications` package |
| 19 | +or install [from source](02-Installation.md.d/From-Source.md). |
| 20 | +<!-- {% endif %} --><!-- {# end if not icingaDocs #} --> |
| 21 | + |
| 22 | +## Setting up the Database |
| 23 | + |
| 24 | +A MySQL (≥5.5), MariaDB (≥10.1), or PostgreSQL (≥9.6) database is required to run Icinga Notifications. |
| 25 | +Please follow the steps listed for your target database, |
| 26 | +which guide you through setting up the database and user and importing the schema. |
| 27 | + |
| 28 | +### Setting up a MySQL or MariaDB Database |
| 29 | + |
| 30 | +If you use a version of MySQL < 5.7 or MariaDB < 10.2, the following server options must be set: |
| 31 | + |
| 32 | +``` |
| 33 | +innodb_file_format=barracuda |
| 34 | +innodb_file_per_table=1 |
| 35 | +innodb_large_prefix=1 |
| 36 | +``` |
| 37 | + |
| 38 | +Set up a MySQL database for Icinga Notifications: |
| 39 | + |
| 40 | +``` |
| 41 | +# mysql -u root -p |
| 42 | +
|
| 43 | +CREATE DATABASE notifications; |
| 44 | +CREATE USER 'notifications'@'localhost' IDENTIFIED BY 'CHANGEME'; |
| 45 | +GRANT ALL ON notifications.* TO 'notifications'@'localhost'; |
| 46 | +``` |
| 47 | + |
| 48 | +After creating the database, import the Icinga Notifications schema using the following command: |
| 49 | + |
| 50 | +``` |
| 51 | +mysql -u root -p notifications < /usr/share/icinga-notifications/schema/mysql/schema.sql |
| 52 | +``` |
| 53 | + |
| 54 | +### Setting up a PostgreSQL Database |
| 55 | + |
| 56 | +Set up a PostgreSQL database for Icinga Notifications: |
| 57 | + |
| 58 | +``` |
| 59 | +# su -l postgres |
| 60 | +
|
| 61 | +createuser -P notifications |
| 62 | +createdb -E UTF8 --locale en_US.UTF-8 -T template0 -O notifications notifications |
| 63 | +echo 'CREATE EXTENSION IF NOT EXISTS citext;' | psql notifications |
| 64 | +``` |
| 65 | + |
| 66 | +The `CREATE EXTENSION` command requires the `postgresql-contrib` package. |
| 67 | + |
| 68 | +Edit `pg_hba.conf`, insert the following before everything else: |
| 69 | + |
| 70 | +``` |
| 71 | +local all notifications md5 |
| 72 | +host all notifications 0.0.0.0/0 md5 |
| 73 | +host all notifications ::/0 md5 |
| 74 | +``` |
| 75 | + |
| 76 | +To apply these changes, run `systemctl reload postgresql`. |
| 77 | + |
| 78 | +After creating the database, import the Icinga Notifications schema using the following command: |
| 79 | + |
| 80 | +``` |
| 81 | +psql -U notifications notifications < /usr/share/icinga-notifications/schema/pgsql/schema.sql |
| 82 | +``` |
| 83 | + |
| 84 | +## Configuring Icinga Notifications |
| 85 | + |
| 86 | +Icinga Notifications installs its configuration file to `/etc/icinga-notifications/config.yml`, |
| 87 | +pre-populating most of the settings for a local setup. Before running Icinga Notifications, |
| 88 | +adjust the database credentials and the Icinga Web 2 URL. |
| 89 | +The configuration file explains general settings. |
| 90 | +All available settings can be found under [Configuration](03-Configuration.md). |
| 91 | + |
| 92 | +## Running Icinga Notifications |
| 93 | + |
| 94 | +The `icinga-notifications` package automatically installs the necessary systemd unit files to run Icinga Notifications. |
| 95 | +Please run the following command to enable and start its service: |
| 96 | + |
| 97 | +``` |
| 98 | +systemctl enable --now icinga-notifications |
| 99 | +``` |
| 100 | + |
| 101 | +## Installing Icinga Notifications Web |
| 102 | + |
| 103 | +With Icinga 2, Icinga Notifications and the database fully set up, it is now time to install Icinga Notifications Web, |
| 104 | +which connects to the database and allows configuring Icinga Notifications. |
| 105 | + |
| 106 | +Please follow the |
| 107 | +[Icinga Notifications Web documentation](https://icinga.com/docs/icinga-notifications-web/latest/doc/02-Installation/). |
| 108 | + |
| 109 | +<!-- {% endif %} --><!-- {# end else if index #} --> |
0 commit comments