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
success
[root@monitoring-test ~]# firewall-cmd --reload

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

Install Zabbix

rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
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

MySQL

yum install mysql-server
[root@monitoring-test ~]# systemctl enable mysqld
Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service → /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
environment.

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


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
Success.

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
environment.


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

- Removing privileges on test database...
Success.

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
Success.

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
DBPassword=Passw0rd!

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

systemctl restart php-fpm.service

Install Frontend (https://www.zabbix.com/documentation/current/manual/installation/install#installing\_frontend)

Install Agent Di Windows

Panduan : https://tecadmin.net/add-host-zabbix-server-monitor/

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

C:\Users\Administrator>hostname
DEPO-SERVER

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.

https://www.zabbix.com/forum/zabbix-troubleshooting-and-problems/45455-get-value-from-agent-failed-zbx\_tcp\_read-failed-104-connection-reset-by-peer

Referensi lainnya