From: Michael Friedrich Date: Wed, 31 May 2017 11:59:16 +0000 (+0200) Subject: Docs: Replace the command pipe w/ the REST API as Icinga Web 2 requirement in 'Gettin... X-Git-Tag: v2.7.0~47^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e90473b35136d03b34979ac13fbdda55aa841ed3;p=icinga2 Docs: Replace the command pipe w/ the REST API as Icinga Web 2 requirement in 'Getting Started' chapter fixes #5077 --- diff --git a/doc/2-getting-started.md b/doc/2-getting-started.md index e5a26ac67..dbf19c241 100644 --- a/doc/2-getting-started.md +++ b/doc/2-getting-started.md @@ -412,6 +412,9 @@ or Icinga Web 1.x. There is a separate module for each database backend. At present support for both MySQL and PostgreSQL is implemented. +Please choose whether to install [MySQL](2-getting-started.md#configuring-db-ido-mysql) or +[PostgreSQL](2-getting-started.md#configuring-db-ido-postgresql). + ### Configuring DB IDO MySQL #### Installing MySQL database server @@ -524,6 +527,9 @@ FreeBSD: # service icinga2 restart + +Continue with the [webserver setup](2-getting-started.md#icinga2-user-interface-webserver). + ### Configuring DB IDO PostgreSQL #### Installing PostgreSQL database server @@ -656,6 +662,8 @@ RHEL/CentOS 7 and Fedora: # systemctl restart icinga2 +Continue with the [webserver setup](2-getting-started.md#icinga2-user-interface-webserver). + ### Webserver Debian/Ubuntu: @@ -708,16 +716,29 @@ FreeBSD: Please consult the [FreeBSD Handbook](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls.html) how to configure one of FreeBSD's firewalls. -### Setting Up External Command Pipe +### Setting Up Icinga 2 REST API + +Icinga Web 2 and other web interfaces require the [REST API](12-icinga2-api.md#icinga2-api-setup) +to send actions (reschedule check, etc.) and query object details. -Web interfaces and other Icinga addons are able to send commands to -Icinga 2 through the external command pipe. +You can run the CLI command `icinga2 api setup` to enable the +`api` [feature](11-cli-commands.md#enable-features) and set up +certificates as well as a new API user `root` with an auto-generated password in the +`/etc/icinga2/conf.d/api-users.conf` configuration file: -You can enable the External Command Pipe using the CLI: + # icinga2 api setup - # icinga2 feature enable command +Edit the `api-users.conf` file and add a new ApiUser object. Specify the [permissions](12-icinga2-api.md#icinga2-api-permissions) +attribute with minimal permissions required by Icinga Web 2. -After that you will have to restart Icinga 2: + # vim /etc/icinga2/conf.d/api-users.conf + + object ApiUser "icingaweb2" { + password = "Wijsn8Z9eRs5E25d" + permissions = [ "status/query", "actions/*", "objects/modify/*", "objects/query/*" ] + } + +Make sure to restart Icinga 2 to activate the configuration. Debian/Ubuntu, RHEL/CentOS 6 and SUSE: @@ -731,37 +752,13 @@ FreeBSD: # service icinga2 restart -By default the command pipe file is owned by the group `icingacmd` with -read/write permissions. Add your webserver's user to the group `icingacmd` to -enable sending commands to Icinga 2 through your web interface: - - # usermod -a -G icingacmd www-data - -FreeBSD: -On FreeBSD the rw directory is owned by the group `www`. You do not need to add the -user `icinga` to the group `www`. - -Debian packages use `nagios` as the default user and group name. Therefore -change `icingacmd` to `nagios`. - -The webserver's user is different between distributions so you might have to -change `www-data` to `wwwrun`, `www`, or `apache`. - -Change `www-data` to the user you're using to run queries. - -You can verify that the user has been successfully added to the `icingacmd` -group using the `id` command: - - $ id - -![id command on CentOS 7](images/getting-started/id-apache-centos7.png "Confirm that the webserver's user -(here: `apache` on a CentOS 7 system) is a member of the group `icingacmd`.") - ### Installing Icinga Web 2 Please consult the [installation documentation](https://github.com/Icinga/icingaweb2/blob/master/doc/02-Installation.md) for further instructions on how to install Icinga Web 2. +The Icinga 2 API can be defined as [command transport](https://github.com/Icinga/icingaweb2/blob/master/modules/monitoring/doc/commandtransports.md) +in Icinga Web 2 >= 2.4. ## Addons diff --git a/doc/images/getting-started/id-apache-centos7.png b/doc/images/getting-started/id-apache-centos7.png deleted file mode 100644 index 4f93a1aca..000000000 Binary files a/doc/images/getting-started/id-apache-centos7.png and /dev/null differ