How To Install Zabbix 6 On CentOS 9

Zabbix 6 is the new version supplied by zabbix , another GUI changes and new abilities. To install it on CentOS stream 9 you need to Disable Zabbix packages provided by EPEL, if you have it installed. Edit file /etc/yum.repos.d/epel.repo and add the following statement

[epel]
...
excludepkgs=zabbix*

Then you Proceed with installing zabbix repository.

# rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/9/x86_64/zabbix-release-6.4-1.el9.noarch.rpm
# dnf clean all

Now you can install all the software part :

# dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent

Depend on your Linux installation, some time you will need to install MySQL separately

#yum install mariadb-server
#mysql -V
#systemctl enable mariadb
#systemctl start mariadb
#systemctl status mariadb

Next Create the database after you make sure it is up and running ! If you are planning to monitor large environment I recommend splinting the database to table per files (instead of one large file), edit the file /etc/my.cnf :

[mysqld]
innodb_file_per_table

Now lets create the database :

mysql_secure_installation

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';"

Now you can safley build the database :

#zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql zabbix_db -uzabbix_user -pzabbix

Re-Enable the sql strict mode:

#mysql -uroot -p'your_password you set for mysql' zabbix_db -e "set global innodb_strict_mode='ON';"

And continue to configure the database for Zabbix server, Edit file /etc/zabbix/zabbix_server.conf :

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

Start Zabbix server and agent processes and enable it to start with the server:

# systemctl restart zabbix-server zabbix-agent httpd php-fpm
# systemctl enable zabbix-server zabbix-agent httpd php-fpm

Add the 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 front-end :

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

Restart the services :

#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

Start using zabbix, you can find the quick start guide here (the default user is Admin and the password is zabbix):

https://www.zabbix.com/documentation/6.4/en/manual/quickstart/login

Good Luck

Leave a Reply

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

Related Post