Home » Zabbix » Upgrade Zabbix 3.4 to 4.0

Upgrade Zabbix 3.4 to 4.0

On October 1, a new version of the monitoring server Zabbix 4.0 appeared. Today I will tell you how to upgrade zabbix from version 3.4 to the latest version 4.0. I have already used the alpha version for a long time, then rc, so I’m already quite familiar with the new version, and I really liked it.

What’s new in zabbix version 4.0

First, a brief overview of the main changes:

  1. Changed data visualization. In the dashboard widgets, you can build graphs that were previously unavailable. Changes to the graphs – this is what users most asked for from developers. Against the backdrop of Grafana, Kibana, etc. zabbix graphics look like a creepy archaic.
  2. Convenient selection of periods to display information. This is the first thing I noticed and appreciated when I installed the first version of zabbix 4.0. It is really convenient and saves time.
  3. Optimized Kiosk mode for displaying information in full screen mode on individual displays or video walls. You can remove all unnecessary interface elements that are not directly related to graphs and data.
  4. There is a new compact view mode for problems. It contains more useful information on the screen.
  5. Added support for compression when transferring information from zabbix proxy. In version 4.0, it is enabled by default. This will reduce the load on the network in large distributed systems.
  6. There are more options in the reaction to the problem. You can close the problem or change the importance without confirming and sending an alert. All this is granted the appropriate rights.
  7. There are new access rights based on tags.
  8. There is a new http agent for data collection! This is a curious thing, you will have to try.
  9. There are additional settings for HTTP authentication.
  10. Added two new high contrast themes for the interface. I did not like, did not appreciate.

And much more. You can look at the detailed description with pictures on a separate page of What’s New in Zabbix 4.0 LTS on the site. For completeness, link to Release Notes for Zabbix 4.0.0.

Let’s start updating the previous version 3.4 to 4.0.

Preparing for the upgrade

If you have a Zabbix version below 3.4, then first upgrade it to actual.

If you are using zabbix proxy, then the update scheme should be as follows: stop and update the server, update and start all proxies in turn. After that start the main zabbix server.

Before updating, we will make a database backup. To do this, first stop the server.

# systemctl stop zabbix-server
# /usr/bin/mysqldump --opt -v --databases zabbix -uzabbix -p'password' | /usr/bin/gzip -c > /root/zabbix.sql.gz
zabbix zabbix database name
-uzabbix key -u and then the database username
-p’password’ key -p and then the user’s DB password, if there are special characters in the password, escape them with single quotes

Save the admins page php scripts so that you can quickly run the old version in case of an emergency situation:

# cp -R /usr/share/zabbix /root

Centos 7

We connect the repository of the zabbix 4.0 version:

# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

Connecting the zabbix 4.0 repository
The old repository from version 3.4 will be automatically deleted.

Clear and rebuild the yum cache:

# yum clean all
# yum makecache

Debian 9

Delete the current repository package:

# rm -Rf /etc/apt/sources.list.d/zabbix.list

We connect new:

# wget https://repo.zabbix.com/zabbix/4.0/debian/pool/main/z/zabbix-release/zabbix-release_4.0-2+stretch_all.deb
# dpkg -i zabbix-release_4.0-2+stretch_all.deb

Update information about repositories:

# apt update

Ubuntu 18

Delete the current repository package:

rm -Rf /etc/apt/sources.list.d/zabbix.list

We connect new:

# wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-2+bionic_all.deb
# dpkg -i zabbix-release_4.0-2+bionic_all.deb

Update information about repositories:

# apt update

If you have other versions of the systems, then just find the package links for your version in the official repository – https://repo.zabbix.com/zabbix/4.0/ Further update will not differ from the current one.

Prepared for the update, you can proceed.

Installing update zabbix 3.4 to 4.0

Centos 7

Install the zabbix update on the Centos 7 server with the following command:

# yum upgrade zabbix-server-mysql zabbix-web-mysql zabbix-agent

This is a list of zabbix packages for the general case. If you have something else installed, it is better to update everything at once. You can view the list of installed zabbix packages with the command:

# rpm -qa | grep zabbix

In my case, there are still packages zabbix-get and zabbix-sender. We update everything at once:

# yum upgrade zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get zabbix-sender

Debian 9/Ubuntu 18

Install the zabbix update on Debian or Ubuntu server with the following command:

# apt-get install --only-upgrade zabbix-server-mysql zabbix-frontend-php zabbix-agent

Further instruction is common for all systems. After the update is complete, start the server:

# systemctl start zabbix-server

At startup, the database will be updated. For a small base (1-2 GB) it does not take much time. You may not even notice the process. If the base is larger, then you need to wait until the update is complete. You can monitor it by viewing the log file of the zabbix server.

# tail -f /var/log/zabbix/zabbix_server.log

Upgrade zabbix 3.4 to 4.0

After the database update is completed, the server will start. After that, you can start the agent.

# systemctl start zabbix-agent

In the agent and server logs, you can see the version of the running services.

Starting Zabbix Agent [serveradmin.ru]. Zabbix 4.0.0 (revision 85308).
Starting Zabbix Server. Zabbix 4.0.0 (revision 85308).

Now you can go to the web interface and look at the updated version of the zabbix server. Before this, clear the browser cache and delete cookies from the page zabbix. If this is not done, then there may be problems and errors, which I have often saw.

At the bottom of the web interface, the current server version will be displayed:

Dashboard zabbix 4.0

You can see changes and uses new features.


I performed the described zabbix update as I wrote the article on one of the small working servers. Everything went without problems. So if you have any errors or problems, it is most likely your local. If your web interface works on nginx, do not forget to change the owner of the /etc/zabbix/web directory to nginx. After updating, I often forget to do this and see a blank white screen instead of an authorization window.

Soon my new article on installing zabbix 4.0 will be released, where I will share my tips and tricks for setting up, which I usually do on new servers. Previously, I did not publish this information, limited to general advice. Now I decided to share my own experience and experience. I’ll not be there to disconnect SELinux for the first time, otherwise I’m already tired of complaining about this, as if it’s something that a zabbix server is just impossible to do without.

One comment

  1. Thank you! This howto helped me a lot! Waiting for the 5.0 version upgrade instructions..

Leave a Reply

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

Нажимая кнопку "Отправить комментарий" Я даю согласие на обработку персональных данных.