1 # <a id="getting-started"></a> Getting Started
3 This tutorial is a step-by-step introduction to installing [Icinga 2](2-getting-started.md#setting-up-icinga2)
4 and [Icinga Web 2](2-getting-started.md#setting-up-icingaweb2).
5 It assumes that you are familiar with the operating system you're using to install Icinga 2.
7 ## <a id="setting-up-icinga2"></a> Setting up Icinga 2
9 First off you will have to install Icinga 2. The preferred way of doing this
10 is to use the official package repositories depending on which operating system
11 and distribution you are running.
13 Distribution | Repository
14 ------------------------|---------------------------
15 Debian | [debmon](https://debmon.org/packages/debmon-jessie/icinga2), [Icinga Repository](http://packages.icinga.org/debian/)
16 Ubuntu | [Icinga PPA](https://launchpad.net/~formorer/+archive/ubuntu/icinga), [Icinga Repository](http://packages.icinga.org/ubuntu/)
17 RHEL/CentOS | [Icinga Repository](http://packages.icinga.org/epel/)
18 openSUSE | [Icinga Repository](http://packages.icinga.org/openSUSE/), [Server Monitoring Repository](https://build.opensuse.org/package/show/server:monitoring/icinga2)
19 SLES | [Icinga Repository](http://packages.icinga.org/SUSE/)
20 Gentoo | [Upstream](http://packages.gentoo.org/package/net-analyzer/icinga2)
21 FreeBSD | [Upstream](http://www.freshports.org/net-mgmt/icinga2)
22 ArchLinux | [Upstream](https://aur.archlinux.org/packages/icinga2)
24 Packages for distributions other than the ones listed above may also be
25 available. Please contact your distribution packagers.
27 ### <a id="package-repositories"></a> Package Repositories
29 You need to add the Icinga repository to your package management configuration.
30 Below is a list with examples for the various distributions.
34 # wget -O - https://debmon.org/debmon/repo.key 2>/dev/null | apt-key add -
35 # echo 'deb http://debmon.org/debmon debmon-jessie main' >/etc/apt/sources.list.d/debmon.list
40 # add-apt-repository ppa:formorer/icinga
45 yum install https://packages.icinga.org/epel/7/release/noarch/icinga-rpm-release-7-1.el7.centos.noarch.rpm
49 yum install https://packages.icinga.org/epel/6/release/noarch/icinga-rpm-release-6-1.el6.noarch.rpm
53 rpm -i http://packages.icinga.org/epel/5/release/noarch/icinga-rpm-release-5-1.el5.centos.noarch.rpm
55 The packages for RHEL/CentOS depend on other packages which are distributed
56 as part of the [EPEL repository](http://fedoraproject.org/wiki/EPEL). Please
57 make sure to enable this repository by following
58 [these instructions](http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F).
62 dnf install https://packages.icinga.org/fedora/23/release/noarch/icinga-rpm-release-23-1.fc23.noarch.rpm
66 dnf install https://packages.icinga.org/fedora/22/release/noarch/icinga-rpm-release-22-1.fc22.noarch.rpm
70 yum install http://packages.icinga.org/fedora/21/release/noarch/icinga-rpm-release-21-1.fc21.noarch.rpm
74 # zypper ar http://packages.icinga.org/SUSE/ICINGA-release-11.repo
77 The packages for SLES 11 depend on the `openssl1` package which is distributed
78 as part of the [SLES 11 Security Module](https://www.suse.com/communities/conversations/introducing-the-suse-linux-enterprise-11-security-module/).
82 # zypper ar http://packages.icinga.org/SUSE/ICINGA-release.repo
87 # zypper ar http://packages.icinga.org/openSUSE/ICINGA-release.repo
90 ### <a id="installing-icinga2"></a> Installing Icinga 2
92 You can install Icinga 2 by using your distribution's package manager
93 to install the `icinga2` package.
97 # apt-get install icinga2
101 # yum install icinga2
102 # chkconfig icinga2 on
103 # service icinga2 start
105 RHEL/CentOS 7 and Fedora:
107 # yum install icinga2
108 # systemctl enable icinga2
109 # systemctl start icinga2
113 # zypper install icinga2
117 # pkg install icinga2
119 ### <a id="installation-enabled-features"></a> Enabled Features during Installation
121 The default installation will enable three features required for a basic
122 Icinga 2 installation:
124 * `checker` for executing checks
125 * `notification` for sending notifications
126 * `mainlog` for writing the `icinga2.log` file
128 You can verify that by calling `icinga2 feature list`
129 [CLI command](11-cli-commands.md#cli-command-feature) to see which features are
130 enabled and disabled.
132 # icinga2 feature list
133 Disabled features: api command compatlog debuglog graphite icingastatus ido-mysql ido-pgsql livestatus notification perfdata statusdata syslog
134 Enabled features: checker mainlog notification
137 ### <a id="installation-paths"></a> Installation Paths
139 By default Icinga 2 uses the following files and directories:
142 ------------------------------------|------------------------------------
143 /etc/icinga2 | Contains Icinga 2 configuration files.
144 /etc/init.d/icinga2 | The Icinga 2 init script.
145 /usr/sbin/icinga2 | The Icinga 2 binary.
146 /usr/share/doc/icinga2 | Documentation files that come with Icinga 2.
147 /usr/share/icinga2/include | The Icinga Template Library and plugin command configuration.
148 /var/run/icinga2 | PID file.
149 /var/run/icinga2/cmd | Command pipe and Livestatus socket.
150 /var/cache/icinga2 | status.dat/objects.cache, icinga2.debug files
151 /var/spool/icinga2 | Used for performance data spool files.
152 /var/lib/icinga2 | Icinga 2 state file, cluster log, local CA and configuration files.
153 /var/log/icinga2 | Log file location and compat/ directory for the CompatLogger feature.
155 FreeBSD uses slightly different paths:
157 By default Icinga 2 uses the following files and directories:
160 ------------------------------------|------------------------------------
161 /usr/local/etc/icinga2 | Contains Icinga 2 configuration files.
162 /usr/local/etc/rc.d/icinga2 | The Icinga 2 init script.
163 /usr/local/sbin/icinga2 | The Icinga 2 binary.
164 /usr/local/share/doc/icinga2 | Documentation files that come with Icinga 2.
165 /usr/local/share/icinga2/include | The Icinga Template Library and plugin command configuration.
166 /var/run/icinga2 | PID file.
167 /var/run/icinga2/cmd | Command pipe and Livestatus socket.
168 /var/cache/icinga2 | status.dat/objects.cache, icinga2.debug files
169 /var/spool/icinga2 | Used for performance data spool files.
170 /var/lib/icinga2 | Icinga 2 state file, cluster log, local CA and configuration files.
171 /var/log/icinga2 | Log file location and compat/ directory for the CompatLogger feature.
173 ## <a id="setting-up-check-plugins"></a> Setting up Check Plugins
175 Without plugins Icinga 2 does not know how to check external services. The
176 [Monitoring Plugins Project](https://www.monitoring-plugins.org/) provides
177 an extensive set of plugins which can be used with Icinga 2 to check whether
178 services are working properly.
180 These plugins are required to make the [example configuration](4-configuring-icinga-2.md#configuring-icinga2-overview)
183 For your convenience here is a list of package names for some of the more
184 popular operating systems/distributions:
186 OS/Distribution | Package Name | Repository | Installation Path
187 -----------------------|--------------------|---------------------------|----------------------------
188 RHEL/CentOS | nagios-plugins-all | [EPEL](http://fedoraproject.org/wiki/EPEL) | /usr/lib/nagios/plugins or /usr/lib64/nagios/plugins
189 SLES/OpenSUSE | monitoring-plugins | [server:monitoring](https://build.opensuse.org/project/repositories/server:monitoring) | /usr/lib/nagios/plugins
190 Debian/Ubuntu | nagios-plugins | - | /usr/lib/nagios/plugins
191 FreeBSD | monitoring-plugins | - | /usr/local/libexec/nagios
192 OS X | nagios-plugins | [MacPorts](http://www.macports.org), [Homebrew](http://brew.sh) | /opt/local/libexec or /usr/local/sbin
194 The recommended way of installing these standard plugins is to use your
195 distribution's package manager.
199 # apt-get install nagios-plugins
203 # yum install nagios-plugins-all
205 The packages for RHEL/CentOS depend on other packages which are distributed
206 as part of the [EPEL repository](http://fedoraproject.org/wiki/EPEL). Please
207 make sure to enable this repository by following
208 [these instructions](http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F).
212 # dnf install nagios-plugins-all
216 # zypper install monitoring-plugins
218 The packages for SLES/OpenSUSE depend on other packages which are distributed
219 as part of the [server:monitoring repository](https://build.opensuse.org/project/repositories/server:monitoring).
220 Please make sure to enable this repository beforehand.
224 # pkg install monitoring-plugins
226 Depending on which directory your plugins are installed into you may need to
227 update the global `PluginDir` constant in your [Icinga 2 configuration](4-configuring-icinga-2.md#constants-conf).
228 This constant is used by the check command definitions contained in the Icinga Template Library
229 to determine where to find the plugin binaries.
233 > Please refer to the [service monitoring](5-service-monitoring.md#service-monitoring-plugins) chapter for details about how to integrate
234 > additional check plugins into your Icinga 2 setup.
236 ## <a id="running-icinga2"></a> Running Icinga 2
238 ### <a id="init-script"></a> Init Script
240 Icinga 2's init script is installed in `/etc/init.d/icinga2` (`/usr/local/etc/rc.d/icinga2` on FreeBSD) by default:
242 # /etc/init.d/icinga2
243 Usage: /etc/init.d/icinga2 {start|stop|restart|reload|checkconfig|status}
245 The init script supports the following actions:
247 Command | Description
248 --------------------|------------------------
249 start | The `start` action starts the Icinga 2 daemon.
250 stop | The `stop` action stops the Icinga 2 daemon.
251 restart | The `restart` action is a shortcut for running the `stop` action followed by `start`.
252 reload | The `reload` action sends the `HUP` signal to Icinga 2 which causes it to restart. Unlike the `restart` action `reload` does not wait until Icinga 2 has restarted.
253 checkconfig | The `checkconfig` action checks if the `/etc/icinga2/icinga2.conf` configuration file contains any errors.
254 status | The `status` action checks if Icinga 2 is running.
256 By default the Icinga 2 daemon is running as `icinga` user and group
257 using the init script. Using Debian packages the user and group are set to
258 `nagios` for historical reasons.
260 ### <a id="systemd-service"></a> systemd Service
262 Some distributions (e.g. Fedora, openSUSE and RHEL/CentOS 7) use systemd. The
263 Icinga 2 packages automatically install the necessary systemd unit files.
265 The Icinga 2 systemd service can be (re-)started, reloaded, stopped and also
266 queried for its current status.
268 # systemctl status icinga2
269 icinga2.service - Icinga host/service/network monitoring system
270 Loaded: loaded (/usr/lib/systemd/system/icinga2.service; disabled)
271 Active: active (running) since Mi 2014-07-23 13:39:38 CEST; 15s ago
272 Process: 21692 ExecStart=/usr/sbin/icinga2 -c ${ICINGA2_CONFIG_FILE} -d -e ${ICINGA2_ERROR_LOG} -u ${ICINGA2_USER} -g ${ICINGA2_GROUP} (code=exited, status=0/SUCCESS)
273 Process: 21674 ExecStartPre=/usr/sbin/icinga2-prepare-dirs /etc/sysconfig/icinga2 (code=exited, status=0/SUCCESS)
274 Main PID: 21727 (icinga2)
275 CGroup: /system.slice/icinga2.service
276 21727 /usr/sbin/icinga2 -c /etc/icinga2/icinga2.conf -d -e /var/log/icinga2/error.log -u icinga -g icinga --no-stack-rlimit
278 Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 309 Service(s).
279 Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 1 User(s).
280 Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 15 Notification(s).
281 Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 4 ScheduledDowntime(s).
282 Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 1 UserGroup(s).
283 Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 1 IcingaApplication(s).
284 Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 8 Dependency(s).
285 Jul 23 13:39:38 nbmif systemd[1]: Started Icinga host/service/network monitoring system.
287 The `systemctl` command supports the following actions:
289 Command | Description
290 --------------------|------------------------
291 start | The `start` action starts the Icinga 2 daemon.
292 stop | The `stop` action stops the Icinga 2 daemon.
293 restart | The `restart` action is a shortcut for running the `stop` action followed by `start`.
294 reload | The `reload` action sends the `HUP` signal to Icinga 2 which causes it to restart. Unlike the `restart` action `reload` does not wait until Icinga 2 has restarted.
295 status | The `status` action checks if Icinga 2 is running.
296 enable | The `enable` action enables the service being started at system boot time (similar to `chkconfig`)
300 # systemctl enable icinga2
302 # systemctl restart icinga2
303 Job for icinga2.service failed. See 'systemctl status icinga2.service' and 'journalctl -xn' for details.
305 If you're stuck with configuration errors, you can manually invoke the
306 [configuration validation](11-cli-commands.md#config-validation).
310 On FreeBSD you need to enable icinga2 in your rc.conf
312 # sysrc icinga2_enable=yes
314 # service icinga2 restart
316 ## <a id="configuration-syntax-highlighting"></a> Configuration Syntax Highlighting
318 Icinga 2 ships configuration examples for syntax highlighting using the `vim` and `nano` editors.
319 The RHEL and SUSE package `icinga2-common` installs these files into `/usr/share/doc/icinga2-common-[x.x.x]/syntax`
320 (where `[x.x.x]` is the version number, e.g. `2.4.3` or `2.4.4`). Sources provide these files in `tools/syntax`.
321 On Debian systems the `icinga2-common` package provides only the Nano configuration file (`/usr/share/nano/icinga2.nanorc`);
322 to obtain the Vim configuration, please install the extra package `vim-icinga2`. The files are located in `/usr/share/vim/addons`.
324 ### <a id="configuration-syntax-highlighting-vim"></a> Configuration Syntax Highlighting using Vim
326 Install the package `vim-icinga2` with your distribution's package manager.
330 $ apt-get install vim-icinga2 vim-addon-manager
331 $ vim-addon-manager -w install icinga2
332 Info: installing removed addon 'icinga2' to /var/lib/vim/addons
336 $ yum install vim-icinga2
340 $ zypper install vim-icinga2
342 Ensure that syntax highlighting is enabled e.g. by editing the user's `vimrc`
350 $ vim /etc/icinga2/conf.d/templates.conf
352 ![Vim with syntax highlighting](images/getting-started/vim-syntax.png "Vim with Icinga 2 syntax highlighting")
355 ### <a id="configuration-syntax-highlighting-nano"></a> Configuration Syntax Highlighting using Nano
357 Install the package `nano-icinga2` with your distribution's package manager.
361 **Note:** The syntax files are installed with the `icinga2-common` package already.
365 $ yum install nano-icinga2
369 $ zypper install nano-icinga2
371 Copy the `/etc/nanorc` sample file to your home directory.
373 $ cp /etc/nanorc ~/.nanorc
375 Include the `icinga2.nanorc` file.
380 include "/usr/share/nano/icinga2.nanorc"
384 $ nano /etc/icinga2/conf.d/templates.conf
386 ![Nano with syntax highlighting](images/getting-started/nano-syntax.png "Nano with Icinga 2 syntax highlighting")
388 ## <a id="setting-up-icingaweb2"></a> Setting up Icinga Web 2
390 Icinga 2 can be used with Icinga Web 2 and a number of other web interfaces.
391 This chapter explains how to set up Icinga Web 2.
393 The DB IDO (Database Icinga Data Output) modules for Icinga 2 take care of
394 exporting all configuration and status information into a database. The IDO
395 database is used by a number of projects including
396 [Icinga Web 2](2-getting-started.md#setting-up-icingaweb2), Icinga Reporting
399 There is a separate module for each database backend. At present support for
400 both MySQL and PostgreSQL is implemented.
402 ### <a id="configuring-db-ido-mysql"></a> Configuring DB IDO MySQL
404 #### <a id="installing-database-mysql-server"></a> Installing MySQL database server
408 # apt-get install mysql-server mysql-client
412 # yum install mysql-server mysql
413 # chkconfig mysqld on
414 # service mysqld start
415 # mysql_secure_installation
417 RHEL/CentOS 7 and Fedora:
419 # yum install mariadb-server mariadb
420 # systemctl enable mariadb
421 # systemctl start mariadb
422 # mysql_secure_installation
426 # zypper install mysql mysql-client
427 # chkconfig mysqld on
428 # service mysqld start
432 # pkg install mysql56-server
433 # sysrc mysql_enable=yes
434 # service mysql-server restart
435 # mysql_secure_installation
437 #### <a id="installing-database-mysql-modules"></a> Installing the IDO modules for MySQL
439 The next step is to install the `icinga2-ido-mysql` package using your
440 distribution's package manager.
444 # apt-get install icinga2-ido-mysql
448 # yum install icinga2-ido-mysql
452 # zypper install icinga2-ido-mysql
456 On FreeBSD the IDO modules for MySQL are included with the icinga2 package
457 and located at /usr/local/share/icinga2-ido-mysql/schema/mysql.sql
461 > The Debian/Ubuntu packages provide a database configuration wizard by
462 > default. You can skip the automated setup and install/upgrade the
463 > database manually if you prefer that.
465 #### <a id="setting-up-mysql-db"></a> Setting up the MySQL database
467 Set up a MySQL database for Icinga 2:
471 mysql> CREATE DATABASE icinga;
472 mysql> GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga';
475 ![setting up the database on CentOS 7](images/getting-started/mariadb-centos7.png "Setting up the database on CentOS 7")
477 After creating the database you can import the Icinga 2 IDO schema using the
480 # mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/mysql.sql
483 #### <a id="enabling-ido-mysql"></a> Enabling the IDO MySQL module
485 The package provides a new configuration file that is installed in
486 `/etc/icinga2/features-available/ido-mysql.conf`. You will need to
487 update the database credentials in this file.
489 All available attributes are explained in the
490 [IdoMysqlConnection object](9-object-types.md#objecttype-idomysqlconnection)
493 You can enable the `ido-mysql` feature configuration file using
494 `icinga2 feature enable`:
496 # icinga2 feature enable ido-mysql
497 Module 'ido-mysql' was enabled.
498 Make sure to restart Icinga 2 for these changes to take effect.
500 After enabling the ido-mysql feature you have to restart Icinga 2:
502 Debian/Ubuntu, RHEL/CentOS 6 and SUSE:
504 # service icinga2 restart
506 RHEL/CentOS 7 and Fedora:
508 # systemctl restart icinga2
512 # service icinga2 restart
514 ### <a id="configuring-db-ido-postgresql"></a> Configuring DB IDO PostgreSQL
516 #### <a id="installing-database-postgresql-server"></a> Installing PostgreSQL database server
520 # apt-get install postgresql
524 # yum install postgresql-server postgresql
525 # chkconfig postgresql on
526 # service postgresql start
530 # yum install postgresql-server postgresql
531 # postgresql-setup initdb
532 # systemctl enable postgresql
533 # systemctl start postgresql
537 # zypper install postgresql postgresql-server
538 # chkconfig postgresql on
539 # service postgresql start
543 # pkg install postgresql93-server
544 # sysrc postgresql_enable=yes
545 # service postgresql start
547 #### <a id="installing-database-postgresql-modules"></a> Installing the IDO modules for PostgreSQL
549 The next step is to install the `icinga2-ido-pgsql` package using your
550 distribution's package manager.
554 # apt-get install icinga2-ido-pgsql
558 # yum install icinga2-ido-pgsql
562 # zypper install icinga2-ido-pgsql
566 On FreeBSD the IDO modules for PostgreSQL are included with the icinga2 package
567 and located at /usr/local/share/icinga2-ido-pgsql/schema/pgsql.sql
571 > Upstream Debian packages provide a database configuration wizard by default.
572 > You can skip the automated setup and install/upgrade the database manually
573 > if you prefer that.
575 #### Setting up the PostgreSQL database
577 Set up a PostgreSQL database for Icinga 2:
580 # sudo -u postgres psql -c "CREATE ROLE icinga WITH LOGIN PASSWORD 'icinga'"
581 # sudo -u postgres createdb -O icinga -E UTF8 icinga
582 # sudo -u postgres createlang plpgsql icinga
586 > When using PostgreSQL 9.x you can omit the `createlang` command.
587 > Also it is assumed here that your locale is set to utf-8, you may run into
588 > problems otherwise.
590 Locate your pg\_hba.conf (Debian: `/etc/postgresql/*/main/pg_hba.conf`,
591 RHEL/SUSE: `/var/lib/pgsql/data/pg_hba.conf`), add the icinga user with md5
592 authentication method and restart the postgresql server.
595 local icinga icinga md5
596 host icinga icinga 127.0.0.1/32 md5
597 host icinga icinga ::1/128 md5
599 # "local" is for Unix domain socket connections only
601 # IPv4 local connections:
602 host all all 127.0.0.1/32 ident
603 # IPv6 local connections:
604 host all all ::1/128 ident
606 # service postgresql restart
609 After creating the database and permissions you can import the Icinga 2 IDO
610 schema using the following command:
612 # export PGPASSWORD=icinga
613 # psql -U icinga -d icinga < /usr/share/icinga2-ido-pgsql/schema/pgsql.sql
615 ![importing the Icinga 2 IDO schema](images/getting-started/postgr-import-ido.png "Importing the Icinga 2 IDO schema on Debian Jessie")
618 #### <a id="enabling-ido-postgresql"></a> Enabling the IDO PostgreSQL module
620 The package provides a new configuration file that is installed in
621 `/etc/icinga2/features-available/ido-pgsql.conf`. You will need to update
622 the database credentials in this file.
624 All available attributes are explained in the
625 [IdoPgsqlConnection object](9-object-types.md#objecttype-idopgsqlconnection)
628 You can enable the `ido-pgsql` feature configuration file using
629 `icinga2 feature enable`:
631 # icinga2 feature enable ido-pgsql
632 Module 'ido-pgsql' was enabled.
633 Make sure to restart Icinga 2 for these changes to take effect.
635 After enabling the ido-pgsql feature you have to restart Icinga 2:
637 Debian/Ubuntu, RHEL/CentOS 6, SUSE and FreeBSD:
639 # service icinga2 restart
641 RHEL/CentOS 7 and Fedora:
643 # systemctl restart icinga2
646 ### <a id="icinga2-user-interface-webserver"></a> Webserver
650 # apt-get install apache2
656 # service httpd start
658 RHEL/CentOS 7/Fedora:
661 # systemctl enable httpd
662 # systemctl start httpd
666 # zypper install apache2
668 # service apache2 start
670 FreeBSD (nginx, but you could also use the apache24 package):
672 # pkg install nginx php56-gettext php56-ldap php56-openssl php56-mysql php56-pdo_mysql php56-pgsql php56-pdo_pgsql php56-sockets php56-gd pecl-imagick pecl-intl
673 # sysrc php_fpm_enable=yes
674 # sysrc nginx_enable=yes
675 # sed -i '' "s/listen\ =\ 127.0.0.1:9000/listen\ =\ \/var\/run\/php5-fpm.sock/" /usr/local/etc/php-fpm.conf
676 # sed -i '' "s/;listen.owner/listen.owner/" /usr/local/etc/php-fpm.conf
677 # sed -i '' "s/;listen.group/listen.group/" /usr/local/etc/php-fpm.conf
678 # sed -i '' "s/;listen.mode/listen.mode/" /usr/local/etc/php-fpm.conf
679 # service php-fpm start
680 # service nginx start
682 ### <a id="icinga2-user-interface-firewall-rules"></a> Firewall Rules
686 # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
687 # service iptables save
689 RHEL/CentOS 7 specific:
691 # firewall-cmd --add-service=http
692 # firewall-cmd --permanent --add-service=http
695 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.
698 ### <a id="setting-up-external-command-pipe"></a> Setting Up External Command Pipe
700 Web interfaces and other Icinga addons are able to send commands to
701 Icinga 2 through the external command pipe.
703 You can enable the External Command Pipe using the CLI:
705 # icinga2 feature enable command
707 After that you will have to restart Icinga 2:
709 Debian/Ubuntu, RHEL/CentOS 6 and SUSE:
711 # service icinga2 restart
713 RHEL/CentOS 7 and Fedora:
715 # systemctl restart icinga2
719 # service icinga2 restart
721 By default the command pipe file is owned by the group `icingacmd` with
722 read/write permissions. Add your webserver's user to the group `icingacmd` to
723 enable sending commands to Icinga 2 through your web interface:
725 # usermod -a -G icingacmd www-data
728 On FreeBSD the rw directory is owned by the group `www`. You do not need to add the
729 user `icinga` to the group `www`.
731 Debian packages use `nagios` as the default user and group name. Therefore
732 change `icingacmd` to `nagios`.
734 The webserver's user is different between distributions so you might have to
735 change `www-data` to `wwwrun`, `www`, or `apache`.
737 Change `www-data` to the user you're using to run queries.
739 You can verify that the user has been successfully added to the `icingacmd`
740 group using the `id` command:
742 $ id <your-webserver-user>
744 ![id command on CentOS 7](images/getting-started/id-apache-centos7.png "Confirm that the webserver's user
745 (here: `apache` on a CentOS 7 system) is a member of the group `icingacmd`.")
747 ### <a id="installing-icingaweb2"></a> Installing Icinga Web 2
749 Please consult the [installation documentation](https://github.com/Icinga/icingaweb2/blob/master/doc/02-Installation.md)
750 for further instructions on how to install Icinga Web 2.
753 ## <a id="install-addons"></a> Addons
755 A number of additional features are available in the form of addons. A list of
756 popular addons is available in the
757 [Addons and Plugins](13-addons.md#addons) chapter.
759 ## <a id="install-backup"></a> Backup
761 Ensure to include the following in your backups:
763 * Configuration files in `/etc/icinga2`
764 * Runtime files in `/var/lib/icinga2` (the master's CA is stored here as well)
765 * Optional: IDO database backup