How To Install Zabbix 5 On CentOS 8

Zabbix 5 has a lot of GUI imrovment and other new features, notice the installation on CentOS 8 is a little different. lets start .

If you are a fan of SELinux you can set it to permissive mode :

setenforce 0 && sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config

To disable just edit with #nano /etc/selinux/config

And set : SELINUX=disabled

Next install libssh2.so.1 which is needed by zabbix 5

To use libssh2 you must enable the EPEL repo. After that libssh2 can be installed

yum install epel-release

yum install libssh2

In case of develop environment you can install the libssh2-devel

yum install libssh2-devel

Then install zabbix

rpm -Uvh https://repo.zabbix.com/zabbix/5.4/rhel/8/x86_64/zabbix-release-5.4-1.el8.noarch.rpm
dnf clean all
dnf -y install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-agent zabbix-sql-scripts

Now we have to add mysql server = mariaDB

dnf -y install mariadb-server && systemctl start mariadb && systemctl enable mariadb

configure the mysql server :

If your environment is going to monitor a lot of host , I recommend using MySQL database with file for each table, this option is going to help in reducing the database size in the future as the table can be controlled and all the data is spread. in the default setting the data is in one file ibdata1 which can be very big. So edit the file /etc/my.cnf :

[mysqld]
innodb_file_per_table


So Lets continue :


mysql_secure_installation

Create User & DB (notice the charset = utf8 which is required by zabbix 5)

mysql -u root -p
create database zabbix_db character set utf8 collate utf8_bin;
grant all privileges on zabbix_db.* to zabbix_user@localhost identified by 'zabbix' ;
flush privileges;
show create database zabbix_db;     ->to make sure db is created O.K
exit
Temporary disable strict mode (ZBX-16465) to avoid MySQL error “ERROR 1118 (42000) at line 1284: Row size too large (> 8126)” :
#mysql -uroot -p'your_password you set for mysql' zabbix_db -e "set global innodb_strict_mode='OFF';"
build database :
#zcat /usr/share/doc/zabbix-sql-scripts/mysql/create.sql.gz | mysql zabbix_db -uzabbix_user -pzabbix

re-enable stric mode:
#mysql -uroot -p'your_password you set for mysql' zabbix_db -e "set global innodb_strict_mode='ON';"

configure Zabbix for the database we have prepared for it :

#nano /etc/zabbix/zabbix_server.conf
DBname=zabbix_db
DBuser=zabbix_user
DBPassword=zabbix

Start zabbix

#systemctl restart zabbix-server zabbix-agent 
#systemctl enable zabbix-server zabbix-agent

Add firewall rules

#firewall-cmd --add-service={http,https} --permanent
#firewall-cmd --add-port={10051/tcp,10050/tcp} --permanent
#firewall-cmd --reload

Now lets start configure the web frontend

#nano /etc/php-fpm.d/zabbix.conf
php_value date.timezone Asia/Jerusalem

restart the website service :

#systemctl restart httpd php-fpm
#systemctl enable httpd php-fpm

Thats it ! Now open a browser and surf to

http://your_zabbix_server_IP/zabbix
Enter this variables 
Database name : zabbix_db
user : zabbix_user
Password : zabbix

default user name : Admin   Password: zabbix

Now you are done! enjoy


Good Luck

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post