CentOS 8
Sponsored Link

Zabbix 4.0 : Install2019/11/11

Install Zabbix 4.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.
[4] Install required PHP modules and Add Zabbix 4.0 repository.
[root@dlp ~]#
dnf -y install php-mysqlnd php-gd php-xml php-bcmath php-ldap

[root@dlp ~]#
dnf -y install https://repo.zabbix.com/zabbix/4.0/rhel/8/x86_64/zabbix-release-4.0-2.el8.noarch.rpm
[root@dlp ~]#
systemctl restart httpd

[5] Install Zabbix Server. To monitor Zabbix Server itself, Install Zabbix Agent, too.
[root@dlp ~]#
dnf -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get

[6] Create a database for Zabbix.
[root@dlp ~]#
mysql -u root -p

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.3.11-MariaDB MariaDB Server

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

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

MariaDB [(none)]>
create database zabbix;

Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on zabbix.* to zabbix@'localhost' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on zabbix.* to zabbix@'%' 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)]>

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

[root@dlp zabbix-server-mysql]#
gzip -d create.sql.gz

[root@dlp zabbix-server-mysql]#
mysql -u root -p zabbix < create.sql

Enter password:
[7] Configure and start Zabbix Server.
[root@dlp ~]#
vi /etc/zabbix/zabbix_server.conf
# line 92: add

# line 125: add Zabbix DB password

[root@dlp ~]#
systemctl enable --now zabbix-server

[8] If SELinux is enabled, change policy like follows.
[root@dlp ~]#
setsebool -P zabbix_can_network on

[root@dlp ~]#
setsebool -P httpd_can_connect_zabbix on

[root@dlp ~]#
setsebool -P daemons_enable_cluster_mode on

[root@dlp ~]#
vi zabbix_server.te
# create new

module zabbix_server 1.0;

require {
        type zabbix_var_run_t;
        type zabbix_t;
        class sock_file { create unlink write };
        class unix_stream_socket connectto;
        class capability dac_override;

#============= zabbix_t ==============
allow zabbix_t self:unix_stream_socket connectto;
allow zabbix_t self:capability dac_override;
allow zabbix_t zabbix_var_run_t:sock_file { create unlink write };

[root@dlp ~]#
checkmodule -m -M -o zabbix_server.mod zabbix_server.te

checkmodule: loading policy configuration from zabbix_server.te
checkmodule: policy configuration loaded
checkmodule: writing binary representation (version 19) to zabbix_server.mod
[root@dlp ~]#
semodule_package --outfile zabbix_server.pp --module zabbix_server.mod

[root@dlp ~]#
semodule -i zabbix_server.pp

[9] If Firewalld is running, allow Zabbix related ports.
[root@dlp ~]#
firewall-cmd --add-service={http,https} --permanent

[root@dlp ~]#
firewall-cmd --add-port={10051/tcp,10050/tcp} --permanent

[root@dlp ~]#
firewall-cmd --reload

[10] Configure and start Zabbix Agent to monitor Zabbix Server itself.
[root@dlp ~]#
vi /etc/zabbix/zabbix_agentd.conf
# line 98: specify Zabbix server

# line 139: specify Zabbix server

# line 150: change to the own hostname

[root@dlp ~]#
systemctl enable --now zabbix-agent

[11] Change httpd settings. That's OK to configure Zabbix Server.
[root@dlp ~]#
vi /etc/httpd/conf.d/zabbix.conf
# line 10: add access permittion for Zabbix Web frontend if you need

# by default, All are allowed

Require all granted
Require ip
[root@dlp ~]#
vi /etc/php.ini
# line 902: uncomment and add your timezone

date.timezone =
[root@dlp ~]#
systemctl restart httpd php-fpm

Matched Content