Zabbix Documentation 5.0

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


manual:installation:install_from_packages:rhel_centos

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:installation:install_from_packages:rhel_centos [2018/04/04 08:12]
dimir add installation prerequisites
manual:installation:install_from_packages:rhel_centos [2020/02/17 13:58] (current)
marinagen separate frontend installation instructions for RHEL 7 and 8, nginx in RHSCL note
Line 1: Line 1:
 ==== 1 Red Hat Enterprise Linux/​CentOS ==== ==== 1 Red Hat Enterprise Linux/​CentOS ====
  
-=== Overview ===+==== Overview ​====
  
-Official Zabbix packages are available for RHEL 7, CentOS 7 and Oracle Linux 7. In this documentation we will refer to all 3 using the term ''​RHEL''​.+Official Zabbix packages are available for:
  
-Some agent and proxy packages are available for [[http://​repo.zabbix.com/​zabbix/​4.0/​rhel/​6/​x86_64/​|RHEL 6]] and [[http://​repo.zabbix.com/​zabbix/​4.0/​rhel/​5/​x86_64|RHEL 5]] as well.+  * RHEL 8, CentOS 8 and Oracle Linux 8 
 +  * RHEL 7, CentOS 7 and Oracle Linux 7
  
-=== Adding Zabbix repository ===+In this documentation we will refer to all 3 using the term ''​RHEL''​. 
 + 
 +Some agent and proxy packages are available for [[https://​repo.zabbix.com/​zabbix/​3.5/​rhel/​6/​x86_64/​|RHEL 6]] and [[https://​repo.zabbix.com/​zabbix/​3.5/​rhel/​5/​x86_64|RHEL 5]] as well. 
 + 
 +==== Adding Zabbix repository ​====
  
 Install the repository configuration package. This package contains yum (software package manager) configuration files. Install the repository configuration package. This package contains yum (software package manager) configuration files.
 +
 +<note important>​Zabbix 5.0 is not released yet. The links below lead to pre-5.0 packages.</​note>​
 +
 +RHEL 8:
 +
 +  # rpm -Uvh https://​repo.zabbix.com/​zabbix/​4.5/​rhel/​8/​x86_64/​zabbix-release-4.5-1.el8.noarch.rpm
  
 RHEL 7: RHEL 7:
  
-  # rpm -ivh http://​repo.zabbix.com/​zabbix/​4.0/​rhel/​7/​x86_64/​zabbix-release-4.0-1.el7.noarch.rpm+  # rpm -Uvh https://​repo.zabbix.com/​zabbix/​4.5/​rhel/​7/​x86_64/​zabbix-release-4.5-1.el7.noarch.rpm
  
 RHEL 6: RHEL 6:
  
-  # rpm -ivh http://​repo.zabbix.com/​zabbix/​4.0/​rhel/​6/​x86_64/​zabbix-release-4.0-1.el6.noarch.rpm+  # rpm -Uvh https://​repo.zabbix.com/​zabbix/​4.5/​rhel/​6/​x86_64/​zabbix-release-4.5-1.el6.noarch.rpm
  
 RHEL 5: RHEL 5:
  
-  # rpm -ivh http://​repo.zabbix.com/​zabbix/​4.0/​rhel/​5/​x86_64/​zabbix-release-4.0-1.noarch.rpm+  # rpm -Uvh https://​repo.zabbix.com/​zabbix/​4.5/​rhel/​5/​x86_64/​zabbix-release-4.5-1.el5.noarch.rpm
  
-=== Installation ​prerequisites ===+=== Frontend installation ​prerequisites ===
  
 Zabbix frontend requires additional packages not available in basic installation. You need to enable repository of optional rpms in the system you will run Zabbix frontend on: Zabbix frontend requires additional packages not available in basic installation. You need to enable repository of optional rpms in the system you will run Zabbix frontend on:
Line 31: Line 42:
   # yum-config-manager --enable rhel-7-server-optional-rpms   # yum-config-manager --enable rhel-7-server-optional-rpms
  
-=== Server/​proxy/​frontend installation ===+==== Server/​proxy/​frontend installation ​====
  
-To install Zabbix server ​(available for RHEL 7[[manual/​installation/​install_from_packages/​rhel_centos#​zabbix_frontend_and_server_on_rhel_6|deprecated on RHEL 6]]) with MySQL support:+To install Zabbix server ​on RHEL 7/8 ([[manual/​installation/​install_from_packages/​rhel_centos#​zabbix_frontend_and_server_on_rhel_6|deprecated on RHEL 6]]) with MySQL support:
  
   # yum install zabbix-server-mysql   # yum install zabbix-server-mysql
Line 41: Line 52:
   # yum install zabbix-proxy-mysql   # yum install zabbix-proxy-mysql
  
-To install Zabbix frontend (available for RHEL 7[[manual/​installation/​install_from_packages/​rhel_centos#​zabbix_frontend_and_server_on_rhel_6|deprecated on RHEL 6]]) with MySQL support:+Substitute '​mysql'​ in the commands with '​pgsql'​ to use PostgreSQLor with '​sqlite3'​ to use SQLite3 (proxy only).
  
-  ​# yum install zabbix-web-mysql+=== Installing frontend on RHEL 8 === 
 +To install Zabbix frontend on RHEL 8 with MySQL/​Apache support: 
 + 
 +  ​# yum install zabbix-web-mysql ​zabbix-apache-conf 
 + 
 +To install Zabbix frontend on RHEL 8 with MySQL/Nginx support: 
 + 
 +  # yum install epel-release 
 +  # yum install zabbix-web-mysql zabbix-nginx-conf 
 +   
 + <​note>​ Note that Nginx for RHEL is available in Red Hat Software Collections and in [[https://​fedoraproject.org/​wiki/​EPEL|EPEL]]. If Red Hat Software Collections are used, simply install zabbix-nginx-conf-scl package. </​note>​ 
 + 
 + 
 +=== Installing frontend on RHEL 7=== 
 + 
 +Starting from version 5.0 Zabbix frontend requires PHP version 7.2 or higher. Unfortunately,​ RHEL/CentOS 7 only provides PHP 5.4. See [[:​manual/​installation/​install_from_packages/​frontend_on_rhel7|RHEL/​CentOS 7 frontend installation]] for detailed instructions on installing Zabbix frontend on Red Hat Enterprise Linux/​CentOS 7. 
  
-Substitute '​mysql'​ in the commands with '​pgsql'​ to use PostgreSQL, or with '​sqlite3'​ to use SQLite3 (proxy only). 
  
-<note important>​In order to install zabbix-web-mysql on RHEL 7 you need to enable ''​rhel-7-server-optional-rpms''​ repository.</​note>​ 
 === Creating database === === Creating database ===
  
-For Zabbix [[manual:​concepts:​server|server]] and [[manual:​concepts:​proxy|proxy]] daemons a database is required. It is not needed to run Zabbix [[manual:​concepts:​agent|agent]]. ​+For Zabbix [[manual:​concepts:​server|server]] and [[manual:​concepts:​proxy|proxy]] daemons a database is required. It is not needed to run Zabbix [[manual:​concepts:​agent|agent]].
  
-<note warning>If Zabbix server and proxy are installed on the same host, their databases must be created with different names!</​note>​+<note warning>Separate databases are needed for Zabbix server and Zabbix ​proxy; they cannot use the same database. Therefore, if they are installed on the same host, their databases must be created with different names!</​note>​
  
 Create the database using the provided instructions for [[manual:​appendix:​install:​db_scripts#​mysql|MySQL]] or [[manual:​appendix:​install:​db_scripts#​postgresql|PostgreSQL]]. Create the database using the provided instructions for [[manual:​appendix:​install:​db_scripts#​mysql|MySQL]] or [[manual:​appendix:​install:​db_scripts#​postgresql|PostgreSQL]].
Line 58: Line 82:
 === Importing data === === Importing data ===
  
-Now import initial schema and data for the server with MySQL:+Now import initial schema and data for the **server** with MySQL:
  
   # zcat /​usr/​share/​doc/​zabbix-server-mysql*/​create.sql.gz | mysql -uzabbix -p zabbix   # zcat /​usr/​share/​doc/​zabbix-server-mysql*/​create.sql.gz | mysql -uzabbix -p zabbix
Line 66: Line 90:
 With PostgreSQL: With PostgreSQL:
  
-  # zcat /​usr/​share/​doc/​zabbix-server-pgsql*/​create.sql.gz | sudo -u <​username> ​psql zabbix+  # zcat /​usr/​share/​doc/​zabbix-server-pgsql*/​create.sql.gz | sudo -u zabbix ​psql zabbix
  
-For proxy, import initial schema:+With TimescaleDB,​ in addition to the previous command, also run: 
 + 
 +  # zcat /​usr/​share/​doc/​zabbix-server-pgsql*/​timescaledb.sql.gz | sudo -u zabbix psql zabbix 
 + 
 +<note warning>​TimescaleDB is supported with Zabbix server only.</​note>​ 
 + 
 +For **proxy**, import initial schema:
  
   # zcat /​usr/​share/​doc/​zabbix-proxy-mysql*/​schema.sql.gz | mysql -uzabbix -p zabbix   # zcat /​usr/​share/​doc/​zabbix-proxy-mysql*/​schema.sql.gz | mysql -uzabbix -p zabbix
Line 74: Line 104:
 For proxy with PostgreSQL (or SQLite): For proxy with PostgreSQL (or SQLite):
  
-  # zcat /​usr/​share/​doc/​zabbix-proxy-pgsql*/​schema.sql.gz | sudo -u <​username> ​psql zabbix+  # zcat /​usr/​share/​doc/​zabbix-proxy-pgsql*/​schema.sql.gz | sudo -u zabbix ​psql zabbix
   # zcat /​usr/​share/​doc/​zabbix-proxy-sqlite3*/​schema.sql.gz | sqlite3 zabbix.db   # zcat /​usr/​share/​doc/​zabbix-proxy-sqlite3*/​schema.sql.gz | sqlite3 zabbix.db
  
 === Configure database for Zabbix server/​proxy === === Configure database for Zabbix server/​proxy ===
  
-Edit zabbix_server.conf ​or zabbix_proxy.conf to use the created database. For example:+Edit zabbix_server.conf ​(and zabbix_proxy.confto use their respective databases. For example:
  
   # vi /​etc/​zabbix/​zabbix_server.conf   # vi /​etc/​zabbix/​zabbix_server.conf
Line 93: Line 123:
 === Starting Zabbix server process === === Starting Zabbix server process ===
  
-It's time to start Zabbix server process:+To start Zabbix server process ​on RHEL8:
  
-  # service zabbix-server start+  # service zabbix-server ​httpd php-fpm ​start
  
-and make it start at system boot:+On RHEL 7:
  
-RHEL 7 and later+  # service zabbix-server httpd start 
-  # systemctl enable zabbix-server+ 
 +On RHEL 7/8 with Nginx: 
 + 
 +  # service zabbix-server nginx php-fpm start 
 + 
 +To make it start at system boot on RHEL 8: 
 + 
 +  # systemctl enable zabbix-server ​httpd php-fpm 
 + 
 +On RHEL 7: 
 + 
 +  # systemctl enable zabbix-server httpd 
 + 
 +On RHEL 7/8 with Nginx: 
 + 
 +  # systemctl enable zabbix-server nginx php-fpm
  
 RHEL prior to 7: RHEL prior to 7:
Line 109: Line 154:
 === Zabbix frontend configuration === === Zabbix frontend configuration ===
  
-For RHEL 7 and later the Apache configuration file for Zabbix frontend ​is located in /​etc/​httpd/​conf.d/​zabbix.conf. +Depending on the web server used (Apache/Nginx) edit the corresponding ​configuration file for Zabbix frontend:
- +
-If you use RHEL 6 please read the section about [[manual/​installation/​install_from_packages/​rhel_centos#​zabbix_frontend_and_server_on_rhel_6|using Zabbix frontend on RHEL 6]] on how to configure the frontend.+
  
-Some PHP settings are already configured. ​But it's necessary to uncomment ​the "​date.timezone"​ setting ​and [[http://​php.net/​manual/​en/​timezones.php|set the right timezone]] for you.+  * For Apache the configuration file is located in ''/​etc/​httpd/​conf.d/​zabbix.conf''​. ​Some PHP settings are already configured. ​Note that in RHEL 7 (but not in RHEL 8) it's necessary to uncomment and set the right [[http://​php.net/​manual/​en/​timezones.php|date.timezone]] ​setting ​for you.
  
   php_value max_execution_time 300   php_value max_execution_time 300
Line 120: Line 163:
   php_value upload_max_filesize 2M   php_value upload_max_filesize 2M
   php_value max_input_time 300   php_value max_input_time 300
 +  php_value max_input_vars 10000
   php_value always_populate_raw_post_data -1   php_value always_populate_raw_post_data -1
   # php_value date.timezone Europe/Riga   # php_value date.timezone Europe/Riga
 +
 +  * The zabbix-nginx-conf package installs a separate Nginx server for Zabbix frontend. Its configuration file is located in ''/​etc/​nginx/​conf.d/​zabbix.conf''​. For Zabbix frontend to work, it's necessary to uncomment and set ''​listen''​ and/or ''​server_name''​ directives.
 +
 +  # listen 80;
 +  # server_name example.com;​
 +
 +  * Zabbix uses its own dedicated php-fpm connection pool:
 +    * In RHEL 8 with both Apache and Nginx 
 +    * In RHEL 7 only with Nginx 
 +
 +Its configuration file is located in ''/​etc/​php-fpm.d/​zabbix.conf''​. Some PHP settings are already configured. But it's necessary to set the right [[http://​php.net/​manual/​en/​timezones.php|date.timezone]] setting for you in this file.
 +
 +  php_value[max_execution_time] = 300
 +  php_value[memory_limit] = 128M
 +  php_value[post_max_size] = 16M
 +  php_value[upload_max_filesize] = 2M
 +  php_value[max_input_time] = 300
 +  php_value[max_input_vars] = 10000
 +  ; php_value[date.timezone] = Europe/Riga
  
 Now you are ready to proceed with [[manual/​installation/​install#​installing_frontend|frontend installation steps]] which will allow you to access your newly installed Zabbix. Now you are ready to proceed with [[manual/​installation/​install#​installing_frontend|frontend installation steps]] which will allow you to access your newly installed Zabbix.
  
-<​note>​Zabbix official repository provides fping, iksemel, libssh2 packages as well. These packages are located in the //[[http://​repo.zabbix.com/​non-supported/​|non-supported]]//​ directory.</​note>​+Note that a Zabbix proxy does not have a frontend; it communicates with Zabbix server only. 
 + 
 +<​note>​Zabbix official repository provides fping, iksemel, libssh2 packages as well. These packages are located in the //[[https://​repo.zabbix.com/​non-supported/​|non-supported]]//​ directory.</​note>​ 
 + 
 +If you use RHEL 6 please read the section about [[manual/​installation/​install_from_packages/​rhel_centos#​zabbix_frontend_and_server_on_rhel_6|using Zabbix frontend on RHEL 6]] on how to configure the frontend.
  
 === SELinux configuration === === SELinux configuration ===
Line 143: Line 210:
  
   # service httpd restart   # service httpd restart
- 
-=== Agent installation === 
- 
-To install the agent, run 
- 
-  # yum install zabbix-agent 
- 
-To start the agent, run: 
- 
-  # service zabbix-agent start 
  
 === Zabbix frontend and server on RHEL 6 === === Zabbix frontend and server on RHEL 6 ===
Line 176: Line 233:
   $ rpm -ql zabbix-web | grep example.conf   $ rpm -ql zabbix-web | grep example.conf
  
 +==== Agent installation ====
 +
 +To install the agent, run
 +
 +  # yum install zabbix-agent
 +
 +To start the agent, run:
 +
 +  # service zabbix-agent start
 +
 +Substitute '​zabbix-agent'​ with '​zabbix-agent2'​ in these commands if using Zabbix agent 2 (only RHEL/CentOS 8).
 +
 +If you want to run Zabbix agent as root, see here [[https://​www.zabbix.com/​documentation/​5.0/​manual/​appendix/​install/​run_agent_as_root]].
 +==== Java gateway installation ====
 +
 +It is required to install [[:​manual/​concepts/​java|Java gateway]] only if you want to monitor JMX applications. Java gateway is lightweight and does not require a database.
 +
 +Once the required [[#​adding_zabbix_repository|repository]] is added, you can install Zabbix Java gateway by running:
 +
 +  # yum install zabbix-java-gateway
 +
 +Proceed to [[:​manual/​concepts/​java/​from_rhel_centos|setup]] for more details on configuring and running Java gateway.
 +
 +==== Installing debuginfo packages ====
 +
 +<​note>​ Debuginfo packages are currently available for RHEL/CentOS versions 7, 6 and 5. </​note>​
 +To enable debuginfo repository edit ///​etc/​yum.repos.d/​zabbix.repo//​ file.
 +Change ''​enabled=0''​ to ''​enabled=1''​ for zabbix-debuginfo repository.
 +  [zabbix-debuginfo]
 +  name=Zabbix Official Repository debuginfo - $basearch
 +  baseurl=http://​repo.zabbix.com/​zabbix/​4.5/​rhel/​7/​$basearch/​debuginfo/​
 +  enabled=0
 +  gpgkey=file:///​etc/​pki/​rpm-gpg/​RPM-GPG-KEY-ZABBIX-A14FE591
 +  gpgcheck=1
 +This will allow you to install the zabbix-debuginfo package.
 +  # yum install zabbix-debuginfo
 +This single packages contains debug information for all binary Zabbix componets.