Debian 11 Bullseye
Sponsored Link

Zabbix 5.0 : Install2021/09/16

 
Install Zabbix 5.0 LTS which is an enterprise open source monitoring system.
It's possible to monitor not only Linux but Windows, Solaris, IBM AIX and others.
[1]
[2]
[3]
[4] Set Zabbix 5.0 repository and Install Zabbix Server.
To monitor Zabbix Server itself, Install Zabbix Agent, too.
root@dlp:~#
wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-1+bullseye_all.deb

root@dlp:~#
dpkg -i zabbix-release_5.0-1+bullseye_all.deb

Selecting previously unselected package zabbix-release.
(Reading database ... 32101 files and directories currently installed.)
Preparing to unpack zabbix-release_5.0-1+bullseye_all.deb ...
Unpacking zabbix-release (1:5.0-1+bullseye) ...
Setting up zabbix-release (1:5.0-1+bullseye) ...

root@dlp:~#
apt update

root@dlp:~#
apt -y install zabbix-server-mysql zabbix-apache-conf zabbix-agent zabbix-frontend-php php-mysql php-gd php-bcmath php-net-socket php-pear

[5] Create a database for Zabbix.
root@dlp:~#
mysql

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 50
Server version: 10.5.11-MariaDB-1 Debian 11

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

# create DB with utf8 charset
# with utf8mb4, error occurs because of maximum index size 3072 bytes
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin; 
Query OK, 1 row affected (0.00 sec)

# replace any password for DB [password]
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@'localhost' identified by 'password'; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye

root@dlp:~#
cd /usr/share/doc/zabbix-server-mysql

root@dlp:/usr/share/doc/zabbix-server-mysql#
gzip -d create.sql.gz

root@dlp:/usr/share/doc/zabbix-server-mysql#
mysql zabbix < create.sql

[6] Configure and start Zabbix Server.
root@dlp:~#
vi /etc/zabbix/zabbix_server.conf
# line 100 : confirm DB name

DBName=zabbix
# line 116 : confirm DB user name

DBUser=zabbix
# line 125 : add DB user's password

DBPassword=password
root@dlp:~#
systemctl restart zabbix-server
[7] Configure and start Zabbix Agent to monitor Zabbix Server itself.
root@dlp:~#
vi /etc/zabbix/zabbix_agentd.conf
# line 169 : change to the own hostname

Hostname=
dlp.srv.world
root@dlp:~#
systemctl restart zabbix-agent
[8] Configure PHP-FPM and Apache2. That's OK to configure Zabbix Server.
root@dlp:~#
vi /etc/php/7.4/fpm/pool.d/zabbix.conf
# create new

[zabbix]
user = www-data
group = www-data

listen.owner = www-data
listen.group = www-data
listen = /run/php/zabbix.sock
listen.allowed_clients = 127.0.0.1

pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35

env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

php_value[session.save_handler] = files
php_value[session.save_path]    = /var/lib/php/sessions

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[always_populate_raw_post_data] = -1
# specify your timezone
php_value[date.timezone]        = Asia/Tokyo

root@dlp:~#
vi /etc/apache2/conf-enabled/zabbix.conf
    # line 10 : add access permittion for Zabbix Web frontend if you need
    # by default, All are allowed
    #Allow from all
    Allow from 10.0.0.10/24
    # add follows
    <FilesMatch \.php$>
        SetHandler "proxy:unix:/run/php/zabbix.sock|fcgi://localhost/"
    </FilesMatch>

root@dlp:~#
systemctl restart php7.4-fpm apache2
Matched Content