Install the repository configuration package. This package contains yum (software package manager) configuration files.

SLES 15:

SLES 12:

  1. # zypper --gpg-auto-import-keys refresh 'Zabbix Official Repository'

To install Zabbix server/frontend/agent with MySQL support:

  1. # zypper install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-agent

Substitute ‘apache’ in the command with ‘nginx’ if using the package for Nginx web server. See also: Nginx setup for Zabbix on SLES 12/15.

Substitute ‘zabbix-agent’ with ‘zabbix-agent2’ in these commands if using Zabbix agent 2 (only SLES 15 SP1+).

To install Zabbix proxy with MySQL support:

  1. # zypper install zabbix-proxy-mysql

Substitute ‘mysql’ in the commands with ‘pgsql’ to use PostgreSQL.

Creating database

For Zabbix server and daemons a database is required. It is not needed to run Zabbix agent.

Create the database using the provided instructions for or PostgreSQL.

Importing data

Now import initial schema and data for the server with MySQL:

  1. # zcat /usr/share/doc/packages/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

You will be prompted to enter your newly created database password.

With PostgreSQL:

With TimescaleDB, in addition to the previous command, also run:

    TimescaleDB is supported with Zabbix server only.

    For proxy, import initial schema:

    1. # zcat /usr/share/doc/packages/zabbix-proxy-mysql*/schema.sql.gz | mysql -uzabbix -p zabbix

    For proxy with PostgreSQL:

    1. # zcat /usr/share/doc/packages/zabbix-proxy-pgsql*/schema.sql.gz | sudo -u <username> psql zabbix

    Configure database for Zabbix server/proxy

    Edit /etc/zabbix/zabbix_server.conf (and zabbix_proxy.conf) to use their respective databases. For example:

    1. # vi /etc/zabbix/zabbix_server.conf
    2. DBHost=localhost
    3. DBName=zabbix
    4. DBUser=zabbix
    5. DBPassword=<password>

    Use with PostgreSQL. You might want to keep the default setting DBHost=localhost (or an IP address), but this would make PostgreSQL use a network socket for connecting to Zabbix.

    Zabbix frontend configuration

    Depending on the web server used (Apache/Nginx) edit the corresponding configuration file for Zabbix frontend:

    • For Apache the configuration file is located in /etc/apache2/conf.d/zabbix.conf. Some PHP settings are already configured. But it’s necessary to uncomment the “date.timezone” setting and set the right timezone for you.
    • 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.
    1. # listen 80;
    2. # server_name example.com;
    • Zabbix uses its own dedicated php-fpm connection pool with Nginx:

    Its configuration file is located in /etc/php7/fpm/php-fpm.d/zabbix.conf. Some PHP settings are already configured. But it’s necessary to set the right setting for you.

    1. php_value[max_execution_time] = 300
    2. php_value[memory_limit] = 128M
    3. php_value[upload_max_filesize] = 2M
    4. php_value[max_input_vars] = 10000
    5. ; php_value[date.timezone] = Europe/Riga

    Now you are ready to proceed with frontend installation steps which will allow you to access your newly installed Zabbix.

    Note that a Zabbix proxy does not have a frontend; it communicates with Zabbix server only.

    Starting Zabbix server/agent process

    Start Zabbix server and agent processes and make it start at system boot.

    With Apache web server:

    1. # systemctl restart zabbix-server zabbix-agent apache2 php-fpm
    2. # systemctl enable zabbix-server zabbix-agent apache2 php-fpm

    Substitute ‘apache2’ with ‘nginx’ for Nginx web server.

    To enable debuginfo repository edit /etc/zypp/repos.d/zabbix.repo file. Change enabled=0 to enabled=1 for zabbix-debuginfo repository.

    1. [zabbix-debuginfo]
    2. name=Zabbix Official Repository debuginfo
    3. type=rpm-md
    4. baseurl=http://repo.zabbix.com/zabbix/5.2/sles/15/x86_64/debuginfo/
    5. gpgcheck=1
    6. gpgkey=http://repo.zabbix.com/zabbix/5.2/sles/15/x86_64/debuginfo/repodata/repomd.xml.key
    7. update=1