About Zabbix Server
Zabbix is a free and open source network monitoring Software tool which is used to monitor and track the availability and performance of your IT infrastracture: servers, network devices and other IT assets.
In this tutorial we will cover how to upgrade Zabbix Server 3.4.x to 4.0.x on CentOS 7 or RHEL 7. those steps can be used also to upgrade Zabbix Server 3.2.x to 3.4.x or to 4.0.x.
1./ Stop Zabbix Server Daemon
– Stop Zabbix Server to make sure that no new data is inserted into database:
# systemctl stop zabbix-server
2./ Back up the existing Zabbix database
– Create a directory where we will backup the Zabbix Server database and configuration Files:
# mkdir /opt/zabbix-backup/
– Use the following command to backup the Zabbix Server database, replace zabbixdb with the name of your Zabbix Server database:
# mysqldump -u root -p zabbixdb > /opt/zabbix-backup/zabbixdb.sql
Enter password:
3./ Back up configuration files, PHP files and Zabbix binaries
Make a backup copy of Zabbix binaries, configuration files and the PHP file directory.
– To backup the Zabbix Server configuration files use the following command:
# cp /etc/zabbix/zabbix_server.conf /opt/zabbix-backup/ # cp /etc/httpd/conf.d/zabbix.conf /opt/zabbix-backup/ # cp /etc/zabbix/zabbix_agentd.conf /opt/zabbix-backup/
– To backup the PHP files and Zabbix Server binaries use the following command:
# cp -R /usr/share/zabbix/ /opt/zabbix-backup/ # cp -R /usr/share/doc/zabbix-* /opt/zabbix-backup/
4./ Update Zabbix Server repository configuration package
– Upgrade the Zabbix current repository package release as below:
# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm Retrieving https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm Preparing... ################################# [100%] Updating / installing... 1:zabbix-release-4.0-1.el7 ################################# [ 50%] Cleaning up / removing... 2:zabbix-release-3.4-1.el7.centos ################################# [100%]
5./ Upgrade Zabbix Server components
– To upgrade Zabbix Server components, run the following commands:
# yum clean all # yum upgrade zabbix-server-mysql zabbix-web-mysql zabbix-agent
6./ Start Zabbix Server Daemon
# systemctl start zabbix-server
We hope this tutorial was enough helpful. If you need more information, or have any questions, just comment below and we will be glad to assist you!
15 comments
I seem to have a problem when going from 3.2 to 4, After the upgrade I get and error message saying that the database is the wrong version. Do i have to do 3.2->3.4->4.0 or 3.2->4.0 is ok?
Hi Yan,
You need to upgrade from the version 3.2 to 3.4 and after that upgrade to 4.x
Hi,
I get “No packages marked for update” after running step 5, please can you advise?
Thanks.
Hi, I’ve followed the above steps but after step 5 I just get “No packages marked for update” – please can you help?
Hi rich,
you need to clean the yum repository and try again
Thanks, that worked. I’m a Linux newbie.
We are glad that u fix it, Please subscribe to our youtube channel to keep updated .
Thanks, in zabbix page does not say anything about clean!
Lofti – we’ve ran the update and we’re noticing that “problems” are not displaying on our dashboard since the upgrade. We have a Mariadb instance that supports our zabbix server. What specifically do we need to do to make sure the database is updated? We have a backup. Thanks for your time!
Hi steve,
you can check the /var/log/zabbix/zabbix_server.log file and you have to see the start and progress level (percentage) of the database upgrade. When the upgrade is completed, you should see the message “database upgrade fully completed”.
Lofti – I’ll check the log. Thanks for your time!
Lofti – I checked the zabbix_server.log (thanks again) and it looks like everything installed. Here’s the rub… In the log there’s a line that’s repeated a ton of times.
[Z3005] query failed: [1054] Unknown column ‘severity’ in ‘field list’ [insert into events (eventid,source,object,objectid,clock,ns,value,name,severity) values (35706045,3,4,127591,1566418591,289719932,1,’Value “Cannot open /var/log/sa/sa21: No such file or directory” of type “string” is not suitable for value type “Numeric (float)”‘,0);
I checked the table events and voila, there’s no field “severity”. So how do I fix this? Stop zabbix server, add the field, run yum upgrade zabbix-server-mysql on the database server and then start zabbix server? I’m not sure how to move forward. I’ve posted a question on the Zabbix forum but no one has replied. Thanks for your time.
Hi Steve,
From what version you are upgrading?
Can you access the database and run this query to check how the events table was created
SHOW CREATE TABLE events\G;
If you want you can try to create the column manually of course after backuping your database, by running this command : alter table `events` add `severity` integer def ault ‘0’ not null
Hope this will helps
Hello,
when I try to upgrade in step 5 it tells me No “packages marked for update” and it does not update the version, it is still in version 3.4.11
My database is PostgreSQL 9,6.9, it is not Mysql. This may be what is preventing it from updating? Will I have to follow a different procedure to have postgresQL installed?
Thanks for the help
hi,
try to run the below commands:
yum makecache
yum update