Skip to main content

Install Zabbix 5 di CentOS 8 Apache MySQL

Pre Installed

yum update
yum install epel-release
[root@monitoring-test ~]# firewall-cmd --add-service=http --permanent
[root@monitoring-test ~]# firewall-cmd --reload

Alternatif : Kalau server hanya di lokal, disable firewallnya saja systemctl stop firewalld

Install Zabbix

rpm -Uvh
dnf clean all
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-agent

systemctl start zabbix-server zabbix-agent
systemctl enable zabbix-server zabbix-agent


yum install mysql-server
[root@monitoring-test ~]# systemctl enable mysqld
Created symlink /etc/systemd/system/ → /usr/lib/systemd/system/mysqld.service.
[root@monitoring-test ~]# systemctl start mysqld

[root@monitoring-test ~]# mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: y

There are three levels of password validation policy:

LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 1
Please set the password for root here.

New password:

Re-enter new password:

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y

Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
- Dropping test database...

- Removing privileges on test database...

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

All done!
[root@monitoring-test ~]#

Buat Database dan User Zabbix

mysql> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected, 2 warnings (0.00 sec)

mysql> create user 'zabbix'@'%' identified by 'Passw0rd!';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on zabbix.* to 'zabbix'@'%';

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

Config DBPassword di file zabbix

nano /etc/zabbix/zabbix_server.conf

nano /etc/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Makassar

systemctl restart php-fpm.service

Install Frontend (\_frontend)

Install Agent Di Windows

Panduan :

C:\Users\Administrator>c:\zabbix\zabbix_agentd.exe -c c:\zabbix\
nf -i
zabbix_agentd.exe [6024]: service [Zabbix Agent] installed successfully
zabbix_agentd.exe [6024]: event source [Zabbix Agent] installed successfully


Pastikan :
- firewall tidak nge-block,
- settingan di agent.conf Server, Server Active, Hostname
- Jangan lupa restart juga di agent kalo sudah ganti konfig

So, Zabbix server or proxy successfully opens a TCP connection to agent to do a passive check (to get an item value).
One possible reason - Zabbix agent closes connection because it comes from a host or IP address, not matching "Server=" parameter in zabbix_agentd.conf file.
Another reason - if encryption is used - could be problems with TLS.
Yet another reason - some network device (firewall?) between server and agent is disrupting communication.\_tcp\_read-failed-104-connection-reset-by-peer

Referensi lainnya